diff --git a/include/testharness/TestHarness.h b/include/testharness/TestHarness.h index a77b2b1..a66e790 100644 --- a/include/testharness/TestHarness.h +++ b/include/testharness/TestHarness.h @@ -63,7 +63,6 @@ class TestHarness { private: // test running - bool runTestsForToolChain(std::string tcId, std::string exeName); void threadRunTestsForToolChain(std::string tcId, std::string exeName); // helper for formatting tester output diff --git a/src/testharness/TestHarness.cpp b/src/testharness/TestHarness.cpp index 5eb30a7..a0d2bac 100644 --- a/src/testharness/TestHarness.cpp +++ b/src/testharness/TestHarness.cpp @@ -185,83 +185,6 @@ void TestHarness::threadRunTestsForToolChain(std::string tcName, std::string exe } } -bool TestHarness::runTestsForToolChain(std::string exeName, std::string tcName) { - bool failed = false; - - ToolChain toolChain = cfg.getToolChain(tcName); // Get the toolchain to use. - const fs::path& exe = cfg.getExecutablePath(exeName); // Set the toolchain's exe to be tested. - toolChain.setTestedExecutable(exe); - - if (cfg.hasRuntime(exeName)) // If we have a runtime, set that as well. - toolChain.setTestedRuntime(cfg.getRuntimePath(exeName)); - else - toolChain.setTestedRuntime(""); - - std::cout << "\nTesting executable: " << exeName << " -> " << exe << '\n'; - std::cout << "With toolchain: " << tcName << " -> " << toolChain.getBriefDescription() << '\n'; - - unsigned int toolChainCount = 0, toolChainPasses = 0; // Stat tracking for toolchain tests. - - // Iterate over each package. - for (auto& [packageName, package] : testSet) { - std::cout << "Entering package: " << packageName << '\n'; - unsigned int packageCount = 0, packagePasses = 0; - - // Iterate over each subpackage - for (auto& [subPackageName, subPackage] : package) { - std::cout << " Entering subpackage: " << subPackageName << '\n'; - unsigned int subPackagePasses = 0, subPackageSize = subPackage.size(); - - // Iterate over each test in the package - for (size_t i = 0; i < subPackage.size(); ++i) { - std::unique_ptr& test = subPackage[i].first; - if (test->getParseError() == ParseError::NoError) { - - TestResult result = runTest(test.get(), toolChain, cfg); - // keep the result with the test for pretty printing - std::optional res_clone = std::make_optional(result.clone()); - subPackage[i].second.swap(res_clone); - - results.addResult(exeName, tcName, subPackageName, result); - printTestResult(test.get(), result); - - if (result.pass) { - ++packagePasses; - ++subPackagePasses; - } else { - failed = true; - } - } else { - std::cout << " " << (Colors::YELLOW + "[INVALID]" + Colors::RESET) << " " - << test->getTestPath().stem().string() << '\n'; - --subPackageSize; - } - } - std::cout << " Subpackage passed " << subPackagePasses << " / " << subPackageSize << '\n'; - // Track how many tests we run. - packageCount += subPackageSize; - } - - // Update the toolchain stats from the package stats. - toolChainPasses += packagePasses; - toolChainCount += packageCount; - - std::cout << " Package passed " << packagePasses << " / " << packageCount << '\n'; - } - - std::cout << "Toolchain passed " << toolChainPasses << " / " << toolChainCount << "\n\n"; - std::cout << "Invalid " << invalidTests.size() << " / " << toolChainCount + invalidTests.size() - << "\n"; - - for (auto& test : invalidTests) { - std::cout << " Skipped: " << test.first->getTestPath().filename().stem() << std::endl - << " Error: " << Colors::YELLOW << test.first->getParseErrorMsg() << Colors::RESET << "\n"; - } - std::cout << "\n"; - - return failed; -} - bool isTestFile(const fs::path& path) { return (fs::exists(path) && !fs::is_directory(path)