test/TestRunner.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2026 ChilliBits. All rights reserved. | ||
| 2 | |||
| 3 | #include <string> | ||
| 4 | #include <vector> | ||
| 5 | |||
| 6 | #include <gtest/gtest.h> | ||
| 7 | |||
| 8 | #include <SourceFile.h> | ||
| 9 | #include <driver/Driver.h> | ||
| 10 | #include <exception/CompilerError.h> | ||
| 11 | #include <exception/LexerError.h> | ||
| 12 | #include <exception/LinkerError.h> | ||
| 13 | #include <exception/ParserError.h> | ||
| 14 | #include <exception/SemanticError.h> | ||
| 15 | #include <global/GlobalResourceManager.h> | ||
| 16 | #include <global/TypeRegistry.h> | ||
| 17 | #include <llvm/TargetParser/Triple.h> | ||
| 18 | #include <symboltablebuilder/Scope.h> | ||
| 19 | #include <symboltablebuilder/SymbolTable.h> | ||
| 20 | #include <typechecker/FunctionManager.h> | ||
| 21 | #include <typechecker/InterfaceManager.h> | ||
| 22 | #include <typechecker/StructManager.h> | ||
| 23 | #include <util/SystemUtil.h> | ||
| 24 | |||
| 25 | #include "driver/TestDriver.h" | ||
| 26 | #include "util/TestUtil.h" | ||
| 27 | |||
| 28 | using namespace spice::compiler; | ||
| 29 | |||
| 30 | namespace spice::testing { | ||
| 31 | |||
| 32 | extern TestDriverCliOptions testDriverCliOptions; | ||
| 33 | |||
| 34 | 565 | void execTestCase(const TestCase &testCase) { | |
| 35 | // Check if test is disabled | ||
| 36 |
3/4✓ Branch 2 → 3 taken 565 times.
✗ Branch 2 → 761 not taken.
✓ Branch 3 → 4 taken 3 times.
✓ Branch 3 → 10 taken 562 times.
|
565 | if (TestUtil::isDisabled(testCase)) |
| 37 |
3/6✓ Branch 4 → 5 taken 3 times.
✗ Branch 4 → 394 not taken.
✓ Branch 5 → 6 taken 3 times.
✗ Branch 5 → 391 not taken.
✓ Branch 6 → 7 taken 3 times.
✗ Branch 6 → 389 not taken.
|
3 | GTEST_SKIP(); |
| 38 | |||
| 39 | // Create fake cli options | ||
| 40 |
2/4✓ Branch 10 → 11 taken 562 times.
✗ Branch 10 → 397 not taken.
✓ Branch 11 → 12 taken 562 times.
✗ Branch 11 → 395 not taken.
|
562 | const std::filesystem::path mainSourceFilePath = testCase.testPath / REF_NAME_SOURCE; |
| 41 | 562 | CliOptions cliOptions = { | |
| 42 | /* mainSourceFile= */ mainSourceFilePath, | ||
| 43 | /* targetTriple= */ {}, | ||
| 44 | − | /* targetArch= */ TARGET_UNKNOWN, // GCOV_EXCL_LINE - coverage tool bug | |
| 45 | ✗ | /* targetVendor= */ TARGET_UNKNOWN, | |
| 46 | ✗ | /* targetOs= */ TARGET_UNKNOWN, | |
| 47 | /* isNativeTarget= */ true, | ||
| 48 | /* useCPUFeatures*/ false, // Disabled because it makes the refs differ on different machines | ||
| 49 | /* execute= */ false, // If we set this to 'true', the compiler will not emit object files | ||
| 50 | /* cacheDir= */ "./cache", | ||
| 51 | /* outputDir= */ "./", | ||
| 52 | /* outputPath= */ "", | ||
| 53 | /* buildMode= */ BuildMode::DEBUG, | ||
| 54 | /* outputContainer= */ OutputContainer::EXECUTABLE, | ||
| 55 | /* compileJobCount= */ 0, | ||
| 56 | /* ignoreCache */ true, | ||
| 57 | ✗ | /* llvmArgs= */ "", | |
| 58 | /* printDebugOutput= */ false, | ||
| 59 | CliOptions::DumpSettings{ | ||
| 60 | /* dumpCST= */ false, | ||
| 61 | /* dumpAST= */ false, | ||
| 62 | /* dumpSymbolTables= */ false, | ||
| 63 | /* dumpTypes= */ false, | ||
| 64 | /* dumpCacheStats= */ false, | ||
| 65 | /* dumpDependencyGraph= */ false, | ||
| 66 | /* dumpIR= */ false, | ||
| 67 | /* dumpAssembly= */ false, | ||
| 68 | /* dumpObjectFile= */ false, | ||
| 69 | /* dumpToFiles= */ false, | ||
| 70 | /* abortAfterDump */ false, | ||
| 71 | }, | ||
| 72 | /* namesForIRValues= */ true, | ||
| 73 | /* useLifetimeMarkers= */ false, | ||
| 74 | /* useTBAAMetadata */ false, | ||
| 75 | /* optLevel= */ OptLevel::O0, | ||
| 76 | /* useLTO= */ false, | ||
| 77 |
2/4✓ Branch 31 → 32 taken 562 times.
✗ Branch 31 → 406 not taken.
✓ Branch 32 → 33 taken 562 times.
✗ Branch 32 → 404 not taken.
|
1124 | /* noEntryFct= */ exists(testCase.testPath / CTL_RUN_BUILTIN_TESTS), |
| 78 |
2/4✓ Branch 34 → 35 taken 562 times.
✗ Branch 34 → 400 not taken.
✓ Branch 35 → 36 taken 562 times.
✗ Branch 35 → 398 not taken.
|
1124 | /* generateTestMain= */ exists(testCase.testPath / CTL_RUN_BUILTIN_TESTS), |
| 79 | /* staticLinking= */ false, | ||
| 80 | CliOptions::InstrumentationSettings{ | ||
| 81 | /* generateDebugInfo= */ false, | ||
| 82 | /* sanitizer= */ Sanitizer::NONE, | ||
| 83 | }, | ||
| 84 | /* disableVerifier= */ false, | ||
| 85 | /* testMode= */ true, | ||
| 86 | /* comparableOutput= */ true, | ||
| 87 | /* buildVars= */ {}, | ||
| 88 |
19/56✓ Branch 13 → 14 taken 562 times.
✗ Branch 13 → 759 not taken.
✓ Branch 17 → 18 taken 562 times.
✗ Branch 17 → 440 not taken.
✓ Branch 20 → 21 taken 562 times.
✗ Branch 20 → 434 not taken.
✓ Branch 23 → 24 taken 562 times.
✗ Branch 23 → 428 not taken.
✓ Branch 24 → 25 taken 562 times.
✗ Branch 24 → 425 not taken.
✓ Branch 25 → 26 taken 562 times.
✗ Branch 25 → 422 not taken.
✓ Branch 26 → 27 taken 562 times.
✗ Branch 26 → 419 not taken.
✓ Branch 29 → 30 taken 562 times.
✗ Branch 29 → 413 not taken.
✓ Branch 30 → 31 taken 562 times.
✗ Branch 30 → 408 not taken.
✓ Branch 33 → 34 taken 562 times.
✗ Branch 33 → 402 not taken.
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 562 times.
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 46 taken 562 times.
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 562 times.
✗ Branch 48 → 49 not taken.
✓ Branch 48 → 50 taken 562 times.
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 562 times.
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 55 taken 562 times.
✗ Branch 56 → 57 not taken.
✓ Branch 56 → 58 taken 562 times.
✗ Branch 59 → 60 not taken.
✓ Branch 59 → 61 taken 562 times.
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 63 taken 562 times.
✗ Branch 410 → 411 not taken.
✗ Branch 410 → 412 not taken.
✗ Branch 416 → 417 not taken.
✗ Branch 416 → 418 not taken.
✗ Branch 419 → 420 not taken.
✗ Branch 419 → 421 not taken.
✗ Branch 422 → 423 not taken.
✗ Branch 422 → 424 not taken.
✗ Branch 425 → 426 not taken.
✗ Branch 425 → 427 not taken.
✗ Branch 431 → 432 not taken.
✗ Branch 431 → 433 not taken.
✗ Branch 437 → 438 not taken.
✗ Branch 437 → 439 not taken.
✗ Branch 443 → 444 not taken.
✗ Branch 443 → 445 not taken.
✗ Branch 446 → 447 not taken.
✗ Branch 446 → 448 not taken.
|
6744 | }; |
| 89 | static_assert(sizeof(CliOptions::DumpSettings) == 11, "CliOptions::DumpSettings struct size changed"); | ||
| 90 | static_assert(sizeof(CliOptions::InstrumentationSettings) == 2, "CliOptions::InstrumentationSettings struct size changed"); | ||
| 91 | #if defined(__clang__) && defined(__apple_build_version__) | ||
| 92 | // some std types for Apple Clang are smaller than for GCC and Clang | ||
| 93 | static_assert(sizeof(CliOptions) == 312, "CliOptions struct size changed"); | ||
| 94 | #else | ||
| 95 | static_assert(sizeof(CliOptions) == 440, "CliOptions struct size changed"); | ||
| 96 | #endif | ||
| 97 | |||
| 98 | // Parse test args | ||
| 99 |
1/2✓ Branch 65 → 66 taken 562 times.
✗ Branch 65 → 449 not taken.
|
1124 | std::vector<std::string> args = {"spice", "build"}; |
| 100 |
1/2✓ Branch 67 → 68 taken 562 times.
✗ Branch 67 → 755 not taken.
|
562 | TestUtil::parseTestArgs(cliOptions.mainSourceFile, args); |
| 101 |
2/4✓ Branch 68 → 69 taken 562 times.
✗ Branch 68 → 454 not taken.
✓ Branch 69 → 70 taken 562 times.
✗ Branch 69 → 452 not taken.
|
562 | args.push_back(mainSourceFilePath.string()); |
| 102 | |||
| 103 | 562 | bool explicitlySelectedTarget = false; | |
| 104 | 562 | std::vector<const char *> argv; | |
| 105 |
1/2✓ Branch 72 → 73 taken 562 times.
✗ Branch 72 → 753 not taken.
|
562 | argv.reserve(args.size()); |
| 106 |
2/2✓ Branch 91 → 75 taken 1744 times.
✓ Branch 91 → 92 taken 562 times.
|
2868 | for (const std::string &arg : args) { |
| 107 |
2/2✓ Branch 78 → 79 taken 5 times.
✓ Branch 78 → 80 taken 1739 times.
|
1744 | if (arg.starts_with("--target")) |
| 108 | 5 | explicitlySelectedTarget = true; | |
| 109 |
1/2✓ Branch 81 → 82 taken 1744 times.
✗ Branch 81 → 455 not taken.
|
1744 | argv.push_back(arg.c_str()); |
| 110 | } | ||
| 111 |
1/2✓ Branch 92 → 93 taken 562 times.
✗ Branch 92 → 753 not taken.
|
562 | Driver driver(cliOptions, true); |
| 112 |
1/2✓ Branch 95 → 96 taken 562 times.
✗ Branch 95 → 751 not taken.
|
562 | driver.parse(static_cast<int>(argv.size()), argv.data()); |
| 113 |
1/2✓ Branch 96 → 97 taken 562 times.
✗ Branch 96 → 751 not taken.
|
562 | driver.enrich(); |
| 114 | |||
| 115 | // If this is a cross-compilation test, we want to emit the target information in IR. For this we need to set native to false | ||
| 116 |
2/2✓ Branch 97 → 98 taken 5 times.
✓ Branch 97 → 99 taken 557 times.
|
562 | if (explicitlySelectedTarget) |
| 117 | 5 | cliOptions.isNativeTarget = false; | |
| 118 | |||
| 119 | // Redirect all build artifacts to a per-test directory. Driver::enrich() resets these to shared paths (e.g. "./" and a | ||
| 120 | // shared temp cache dir), which would cause concurrently running test processes to clobber each other's object files and | ||
| 121 | // executables. Using a unique directory per test keeps parallel runs (e.g. via gtest-parallel) collision-free. | ||
| 122 |
1/2✓ Branch 99 → 100 taken 562 times.
✗ Branch 99 → 751 not taken.
|
562 | const std::filesystem::path artifactDir = TestUtil::prepareArtifactDir(testCase); |
| 123 |
1/2✓ Branch 100 → 101 taken 562 times.
✗ Branch 100 → 749 not taken.
|
562 | const std::filesystem::path executablePath = TestUtil::getExecutablePath(artifactDir); |
| 124 |
1/2✓ Branch 101 → 102 taken 562 times.
✗ Branch 101 → 747 not taken.
|
562 | cliOptions.outputDir = artifactDir; |
| 125 |
2/4✓ Branch 102 → 103 taken 562 times.
✗ Branch 102 → 459 not taken.
✓ Branch 103 → 104 taken 562 times.
✗ Branch 103 → 457 not taken.
|
562 | cliOptions.cacheDir = artifactDir / "cache"; |
| 126 |
1/2✓ Branch 107 → 108 taken 562 times.
✗ Branch 107 → 747 not taken.
|
562 | std::filesystem::create_directories(cliOptions.cacheDir); |
| 127 | |||
| 128 | // Instantiate GlobalResourceManager | ||
| 129 |
1/2✓ Branch 108 → 109 taken 562 times.
✗ Branch 108 → 747 not taken.
|
562 | GlobalResourceManager resourceManager(cliOptions); |
| 130 | |||
| 131 | try { | ||
| 132 | // Create source file instance for main source file | ||
| 133 |
2/4✓ Branch 111 → 112 taken 562 times.
✗ Branch 111 → 463 not taken.
✓ Branch 112 → 113 taken 562 times.
✗ Branch 112 → 461 not taken.
|
562 | SourceFile *mainSourceFile = resourceManager.createSourceFile(nullptr, MAIN_FILE_NAME, cliOptions.mainSourceFile, false); |
| 134 | |||
| 135 | // Run Lexer and Parser | ||
| 136 |
2/2✓ Branch 115 → 116 taken 560 times.
✓ Branch 115 → 706 taken 2 times.
|
562 | mainSourceFile->runLexer(); |
| 137 |
1/2✓ Branch 116 → 117 taken 560 times.
✗ Branch 116 → 706 not taken.
|
560 | mainSourceFile->runParser(); |
| 138 | |||
| 139 | // Check CST | ||
| 140 |
3/6✓ Branch 119 → 120 taken 560 times.
✗ Branch 119 → 471 not taken.
✓ Branch 120 → 121 taken 560 times.
✗ Branch 120 → 469 not taken.
✓ Branch 121 → 122 taken 560 times.
✗ Branch 121 → 467 not taken.
|
560 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_PARSE_TREE, [&] { |
| 141 | 7 | mainSourceFile->runCSTVisualizer(); | |
| 142 | 7 | return mainSourceFile->compilerOutput.cstString; | |
| 143 | }); | ||
| 144 | |||
| 145 | // Build and optimize AST | ||
| 146 |
2/2✓ Branch 126 → 127 taken 552 times.
✓ Branch 126 → 706 taken 8 times.
|
560 | mainSourceFile->runASTBuilder(); |
| 147 | |||
| 148 | // Check AST | ||
| 149 |
3/6✓ Branch 129 → 130 taken 552 times.
✗ Branch 129 → 485 not taken.
✓ Branch 130 → 131 taken 552 times.
✗ Branch 130 → 483 not taken.
✓ Branch 131 → 132 taken 552 times.
✗ Branch 131 → 481 not taken.
|
552 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYNTAX_TREE, [&] { |
| 150 | 7 | mainSourceFile->runASTVisualizer(); | |
| 151 | 7 | return mainSourceFile->compilerOutput.astString; | |
| 152 | }); | ||
| 153 | |||
| 154 | // Execute import collector and semantic analysis stages | ||
| 155 |
2/2✓ Branch 136 → 137 taken 548 times.
✓ Branch 136 → 706 taken 4 times.
|
552 | mainSourceFile->runImportCollector(); |
| 156 |
2/2✓ Branch 137 → 138 taken 529 times.
✓ Branch 137 → 706 taken 19 times.
|
548 | mainSourceFile->runSymbolTableBuilder(); |
| 157 |
2/2✓ Branch 138 → 139 taken 367 times.
✓ Branch 138 → 706 taken 162 times.
|
529 | mainSourceFile->runMiddleEnd(); // TypeChecker pre + post |
| 158 | |||
| 159 | // Check symbol table output (check happens here to include updates from type checker) | ||
| 160 |
3/6✓ Branch 141 → 142 taken 367 times.
✗ Branch 141 → 499 not taken.
✓ Branch 142 → 143 taken 367 times.
✗ Branch 142 → 497 not taken.
✓ Branch 143 → 144 taken 367 times.
✗ Branch 143 → 495 not taken.
|
734 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYMBOL_TABLE, |
| 161 |
2/4✓ Branch 3 → 4 taken 8 times.
✗ Branch 3 → 11 not taken.
✓ Branch 4 → 5 taken 8 times.
✗ Branch 4 → 9 not taken.
|
750 | [&] { return mainSourceFile->globalScope->getSymbolTableJSON().dump(/*indent=*/2); }); |
| 162 | |||
| 163 | // Fail if an error was expected | ||
| 164 | − | if (TestUtil::doesRefExist(testCase.testPath / REF_NAME_ERROR_OUTPUT)) // GCOV_EXCL_LINE | |
| 165 | − | FAIL() << "Expected error, but got no error"; // GCOV_EXCL_LINE | |
| 166 | |||
| 167 | // Check dependency graph | ||
| 168 |
3/6✓ Branch 163 → 164 taken 367 times.
✗ Branch 163 → 525 not taken.
✓ Branch 164 → 165 taken 367 times.
✗ Branch 164 → 523 not taken.
✓ Branch 165 → 166 taken 367 times.
✗ Branch 165 → 521 not taken.
|
367 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_DEP_GRAPH, [&] { |
| 169 | 2 | mainSourceFile->runDependencyGraphVisualizer(); | |
| 170 | 2 | return mainSourceFile->compilerOutput.depGraphString; | |
| 171 | }); | ||
| 172 | |||
| 173 | // Run backend for all dependencies | ||
| 174 |
5/8✓ Branch 170 → 171 taken 367 times.
✗ Branch 170 → 535 not taken.
✓ Branch 171 → 172 taken 367 times.
✗ Branch 171 → 535 not taken.
✓ Branch 172 → 173 taken 367 times.
✗ Branch 172 → 535 not taken.
✓ Branch 178 → 174 taken 371 times.
✓ Branch 178 → 179 taken 367 times.
|
738 | for (SourceFile *sourceFile : mainSourceFile->dependencies | std::views::values) |
| 175 |
1/2✓ Branch 175 → 176 taken 371 times.
✗ Branch 175 → 535 not taken.
|
371 | sourceFile->runBackEnd(); |
| 176 | |||
| 177 | // Execute IR generator in normal or debug mode | ||
| 178 |
1/2✓ Branch 179 → 180 taken 367 times.
✗ Branch 179 → 706 not taken.
|
367 | mainSourceFile->runIRGenerator(); |
| 179 | |||
| 180 | // Check IR code | ||
| 181 |
2/2✓ Branch 191 → 181 taken 2202 times.
✓ Branch 191 → 192 taken 367 times.
|
2569 | for (uint8_t i = 0; i <= 5; i++) { |
| 182 |
1/2✓ Branch 185 → 186 taken 2202 times.
✗ Branch 185 → 536 not taken.
|
2202 | TestUtil::checkRefMatch( |
| 183 |
2/4✓ Branch 183 → 184 taken 2202 times.
✗ Branch 183 → 540 not taken.
✓ Branch 184 → 185 taken 2202 times.
✗ Branch 184 → 538 not taken.
|
4404 | testCase.testPath / REF_NAME_OPT_IR[i], |
| 184 |
1/2✓ Branch 182 → 183 taken 2202 times.
✗ Branch 182 → 544 not taken.
|
4404 | [&] { |
| 185 | 203 | cliOptions.optLevel = static_cast<OptLevel>(i); | |
| 186 | |||
| 187 |
2/2✓ Branch 2 → 3 taken 1 time.
✓ Branch 2 → 6 taken 202 times.
|
203 | if (cliOptions.useLTO) { |
| 188 | 1 | mainSourceFile->runPreLinkIROptimizer(); | |
| 189 | 1 | mainSourceFile->runBitcodeLinker(); | |
| 190 | 1 | mainSourceFile->runPostLinkIROptimizer(); | |
| 191 | } else { | ||
| 192 | 202 | mainSourceFile->runDefaultIROptimizer(); | |
| 193 | } | ||
| 194 | |||
| 195 | 203 | return mainSourceFile->compilerOutput.irOptString; | |
| 196 | }, | ||
| 197 | 4404 | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 198 |
2/2✓ Branch 2 → 3 taken 6 times.
✓ Branch 2 → 5 taken 197 times.
|
203 | if (cliOptions.instrumentation.generateDebugInfo) { |
| 199 | // Remove the lines, containing paths on the local file system | ||
| 200 | 6 | TestUtil::eraseLinesBySubstring(expectedOutput, " = !DIFile(filename:"); | |
| 201 | 6 | TestUtil::eraseLinesBySubstring(actualOutput, " = !DIFile(filename:"); | |
| 202 | } | ||
| 203 | 203 | }, | |
| 204 | true); | ||
| 205 | } | ||
| 206 | |||
| 207 | // Link the bitcode if not happened yet | ||
| 208 |
3/4✓ Branch 192 → 193 taken 1 time.
✓ Branch 192 → 195 taken 366 times.
✗ Branch 193 → 194 not taken.
✓ Branch 193 → 195 taken 1 time.
|
367 | if (cliOptions.useLTO && cliOptions.optLevel == OptLevel::O0) |
| 209 | ✗ | mainSourceFile->runBitcodeLinker(); | |
| 210 | |||
| 211 | // Check assembly code (only when not running test on GitHub Actions) | ||
| 212 | 367 | bool objectFilesEmitted = false; | |
| 213 | // GCOV_EXCL_START | ||
| 214 | − | if (!testDriverCliOptions.isGitHubActions) { | |
| 215 | − | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_ASM, [&] { | |
| 216 | − | mainSourceFile->runObjectEmitter(); | |
| 217 | − | objectFilesEmitted = true; | |
| 218 | |||
| 219 | − | return mainSourceFile->compilerOutput.asmString; | |
| 220 | }); | ||
| 221 | } | ||
| 222 | // GCOV_EXCL_STOP | ||
| 223 | |||
| 224 | // Check warnings | ||
| 225 | // The bootstrap compiler is still incomplete, so its sources emit huge amounts of unused-symbol warnings. Skip warning | ||
| 226 | // collection for the whole bootstrap-compiler suite to keep the test output readable. | ||
| 227 |
3/4✓ Branch 206 → 207 taken 367 times.
✗ Branch 206 → 706 not taken.
✓ Branch 207 → 208 taken 336 times.
✓ Branch 207 → 219 taken 31 times.
|
367 | if (testCase.testSuite != "bootstrapCompiler") { |
| 228 |
1/2✓ Branch 208 → 209 taken 336 times.
✗ Branch 208 → 706 not taken.
|
336 | mainSourceFile->collectAndPrintWarnings(); |
| 229 |
3/6✓ Branch 211 → 212 taken 336 times.
✗ Branch 211 → 569 not taken.
✓ Branch 212 → 213 taken 336 times.
✗ Branch 212 → 567 not taken.
✓ Branch 213 → 214 taken 336 times.
✗ Branch 213 → 565 not taken.
|
336 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_WARNING_OUTPUT, [&] { |
| 230 |
1/2✓ Branch 2 → 3 taken 22 times.
✗ Branch 2 → 27 not taken.
|
22 | std::stringstream actualWarningString; |
| 231 |
2/2✓ Branch 18 → 5 taken 23 times.
✓ Branch 18 → 19 taken 22 times.
|
67 | for (const CompilerWarning &warning : mainSourceFile->compilerOutput.warnings) |
| 232 |
2/4✓ Branch 7 → 8 taken 23 times.
✗ Branch 7 → 24 not taken.
✓ Branch 8 → 9 taken 23 times.
✗ Branch 8 → 24 not taken.
|
23 | actualWarningString << warning.warningMessage << "\n"; |
| 233 |
1/2✓ Branch 19 → 20 taken 22 times.
✗ Branch 19 → 25 not taken.
|
44 | return actualWarningString.str(); |
| 234 | 22 | }); | |
| 235 | } | ||
| 236 | |||
| 237 | // Do linking and conclude compilation | ||
| 238 |
3/6✓ Branch 219 → 220 taken 367 times.
✗ Branch 219 → 583 not taken.
✓ Branch 220 → 221 taken 367 times.
✗ Branch 220 → 581 not taken.
✓ Branch 221 → 222 taken 367 times.
✗ Branch 221 → 579 not taken.
|
367 | const bool needsNormalRunForOutput = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXECUTION_OUTPUT); |
| 239 |
3/6✓ Branch 224 → 225 taken 367 times.
✗ Branch 224 → 589 not taken.
✓ Branch 225 → 226 taken 367 times.
✗ Branch 225 → 587 not taken.
✓ Branch 226 → 227 taken 367 times.
✗ Branch 226 → 585 not taken.
|
367 | const bool needsNormalRunForExitCode = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXIT_CODE); |
| 240 |
3/6✓ Branch 229 → 230 taken 367 times.
✗ Branch 229 → 595 not taken.
✓ Branch 230 → 231 taken 367 times.
✗ Branch 230 → 593 not taken.
✓ Branch 231 → 232 taken 367 times.
✗ Branch 231 → 591 not taken.
|
367 | const bool needsDebuggerRun = TestUtil::doesRefExist(testCase.testPath / REF_NAME_GDB_OUTPUT); |
| 241 |
5/6✓ Branch 234 → 235 taken 61 times.
✓ Branch 234 → 237 taken 306 times.
✓ Branch 235 → 236 taken 48 times.
✓ Branch 235 → 237 taken 13 times.
✗ Branch 236 → 237 not taken.
✓ Branch 236 → 244 taken 48 times.
|
367 | if (needsNormalRunForOutput || needsNormalRunForExitCode || needsDebuggerRun) { |
| 242 | // Emit main source file object if not done already | ||
| 243 |
1/2✓ Branch 237 → 238 taken 319 times.
✗ Branch 237 → 239 not taken.
|
319 | if (!objectFilesEmitted) |
| 244 |
1/2✓ Branch 238 → 239 taken 319 times.
✗ Branch 238 → 706 not taken.
|
319 | mainSourceFile->runObjectEmitter(); |
| 245 | |||
| 246 | // Conclude the compilation | ||
| 247 |
1/2✓ Branch 239 → 240 taken 319 times.
✗ Branch 239 → 706 not taken.
|
319 | mainSourceFile->concludeCompilation(); |
| 248 | |||
| 249 | // Prepare linker | ||
| 250 |
1/2✓ Branch 240 → 241 taken 319 times.
✗ Branch 240 → 706 not taken.
|
319 | resourceManager.linker.outputPath = executablePath; |
| 251 | |||
| 252 | // Prepare and run linker | ||
| 253 |
1/2✓ Branch 241 → 242 taken 319 times.
✗ Branch 241 → 706 not taken.
|
319 | resourceManager.linker.prepare(); |
| 254 |
1/2✓ Branch 242 → 243 taken 319 times.
✗ Branch 242 → 706 not taken.
|
319 | resourceManager.linker.run(); |
| 255 |
1/2✓ Branch 243 → 244 taken 319 times.
✗ Branch 243 → 706 not taken.
|
319 | resourceManager.linker.cleanup(); |
| 256 | } | ||
| 257 | |||
| 258 | // Check type registry output | ||
| 259 |
3/6✓ Branch 246 → 247 taken 367 times.
✗ Branch 246 → 601 not taken.
✓ Branch 247 → 248 taken 367 times.
✗ Branch 247 → 599 not taken.
✓ Branch 248 → 249 taken 367 times.
✗ Branch 248 → 597 not taken.
|
373 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_TYPE_REGISTRY, [&] { return TypeRegistry::dump(); }); |
| 260 | |||
| 261 | // Check cache stats output | ||
| 262 |
3/6✓ Branch 255 → 256 taken 367 times.
✗ Branch 255 → 615 not taken.
✓ Branch 256 → 257 taken 367 times.
✗ Branch 256 → 613 not taken.
✓ Branch 257 → 258 taken 367 times.
✗ Branch 257 → 611 not taken.
|
367 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_CACHE_STATS, [&] { |
| 263 |
1/2✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 31 not taken.
|
1 | std::stringstream cacheStats; |
| 264 |
3/6✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 22 not taken.
✓ Branch 4 → 5 taken 1 time.
✗ Branch 4 → 20 not taken.
✓ Branch 5 → 6 taken 1 time.
✗ Branch 5 → 20 not taken.
|
1 | cacheStats << FunctionManager::dumpLookupCacheStatistics() << std::endl; |
| 265 |
3/6✓ Branch 7 → 8 taken 1 time.
✗ Branch 7 → 25 not taken.
✓ Branch 8 → 9 taken 1 time.
✗ Branch 8 → 23 not taken.
✓ Branch 9 → 10 taken 1 time.
✗ Branch 9 → 23 not taken.
|
1 | cacheStats << StructManager::dumpLookupCacheStatistics() << std::endl; |
| 266 |
3/6✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 28 not taken.
✓ Branch 12 → 13 taken 1 time.
✗ Branch 12 → 26 not taken.
✓ Branch 13 → 14 taken 1 time.
✗ Branch 13 → 26 not taken.
|
1 | cacheStats << InterfaceManager::dumpLookupCacheStatistics() << std::endl; |
| 267 |
1/2✓ Branch 15 → 16 taken 1 time.
✗ Branch 15 → 29 not taken.
|
2 | return cacheStats.str(); |
| 268 | 1 | }); | |
| 269 | |||
| 270 |
3/6✓ Branch 262 → 263 taken 367 times.
✗ Branch 262 → 629 not taken.
✓ Branch 263 → 264 taken 367 times.
✗ Branch 263 → 627 not taken.
✓ Branch 264 → 265 taken 367 times.
✗ Branch 264 → 625 not taken.
|
367 | const bool checkExecutionOutput = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXECUTION_OUTPUT); |
| 271 |
3/6✓ Branch 267 → 268 taken 367 times.
✗ Branch 267 → 635 not taken.
✓ Branch 268 → 269 taken 367 times.
✗ Branch 268 → 633 not taken.
✓ Branch 269 → 270 taken 367 times.
✗ Branch 269 → 631 not taken.
|
367 | const bool checkExecutionExitCode = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXIT_CODE); |
| 272 |
4/4✓ Branch 272 → 273 taken 61 times.
✓ Branch 272 → 274 taken 306 times.
✓ Branch 273 → 274 taken 13 times.
✓ Branch 273 → 330 taken 48 times.
|
367 | if (checkExecutionOutput || checkExecutionExitCode) { |
| 273 |
2/4✓ Branch 274 → 275 taken 319 times.
✗ Branch 274 → 639 not taken.
✓ Branch 275 → 276 taken 319 times.
✗ Branch 275 → 637 not taken.
|
319 | const std::filesystem::path cliFlagsFile = testCase.testPath / INPUT_NAME_CLI_FLAGS; |
| 274 | // Execute binary | ||
| 275 |
1/2✓ Branch 277 → 278 taken 319 times.
✗ Branch 277 → 689 not taken.
|
319 | std::stringstream cmd; |
| 276 |
1/2✗ Branch 278 → 279 not taken.
✓ Branch 278 → 280 taken 319 times.
|
319 | if (testDriverCliOptions.enableLeakDetection) |
| 277 | ✗ | cmd << "valgrind -q --leak-check=full --suppressions=../../valgrind.supp --num-callers=100 --error-exitcode=1 "; | |
| 278 |
2/4✓ Branch 280 → 281 taken 319 times.
✗ Branch 280 → 642 not taken.
✓ Branch 281 → 282 taken 319 times.
✗ Branch 281 → 640 not taken.
|
319 | cmd << executablePath.string(); |
| 279 |
3/4✓ Branch 283 → 284 taken 319 times.
✗ Branch 283 → 687 not taken.
✓ Branch 284 → 285 taken 3 times.
✓ Branch 284 → 291 taken 316 times.
|
319 | if (exists(cliFlagsFile)) |
| 280 |
4/8✓ Branch 285 → 286 taken 3 times.
✗ Branch 285 → 687 not taken.
✓ Branch 286 → 287 taken 3 times.
✗ Branch 286 → 645 not taken.
✓ Branch 287 → 288 taken 3 times.
✗ Branch 287 → 643 not taken.
✓ Branch 288 → 289 taken 3 times.
✗ Branch 288 → 643 not taken.
|
3 | cmd << " " << TestUtil::getFileContentLinesVector(cliFlagsFile).at(0); |
| 281 |
2/4✓ Branch 291 → 292 taken 319 times.
✗ Branch 291 → 648 not taken.
✓ Branch 292 → 293 taken 319 times.
✗ Branch 292 → 646 not taken.
|
319 | const auto [output, exitCode] = SystemUtil::exec(cmd.str(), checkExecutionOutput); |
| 282 | |||
| 283 | // Check if the execution output matches the expected output | ||
| 284 | 306 | const auto getActualOutput = [&] { return output; }; | |
| 285 |
3/6✓ Branch 296 → 297 taken 319 times.
✗ Branch 296 → 653 not taken.
✓ Branch 297 → 298 taken 319 times.
✗ Branch 297 → 651 not taken.
✓ Branch 298 → 299 taken 319 times.
✗ Branch 298 → 649 not taken.
|
319 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXECUTION_OUTPUT, getActualOutput); |
| 286 | |||
| 287 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 288 | // Check if the exit code matches the expected one | ||
| 289 | // If no exit code ref file exists, check against 0 | ||
| 290 | 18 | const auto getActualExitCode = [&] { return std::to_string(exitCode); }; | |
| 291 |
3/6✓ Branch 305 → 306 taken 319 times.
✗ Branch 305 → 666 not taken.
✓ Branch 306 → 307 taken 319 times.
✗ Branch 306 → 664 not taken.
✓ Branch 307 → 308 taken 319 times.
✗ Branch 307 → 662 not taken.
|
319 | const bool refExists = TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXIT_CODE, getActualExitCode); |
| 292 |
2/2✓ Branch 312 → 313 taken 301 times.
✓ Branch 312 → 326 taken 18 times.
|
319 | if (!refExists) { |
| 293 |
2/12✓ Branch 313 → 314 taken 301 times.
✗ Branch 313 → 675 not taken.
✗ Branch 315 → 316 not taken.
✓ Branch 315 → 324 taken 301 times.
✗ Branch 316 → 317 not taken.
✗ Branch 316 → 681 not taken.
✗ Branch 317 → 318 not taken.
✗ Branch 317 → 679 not taken.
✗ Branch 319 → 320 not taken.
✗ Branch 319 → 678 not taken.
✗ Branch 320 → 321 not taken.
✗ Branch 320 → 676 not taken.
|
301 | EXPECT_EQ(0, exitCode) << "Program exited with non-zero exit code"; |
| 294 | } | ||
| 295 | #endif | ||
| 296 | 319 | } | |
| 297 | |||
| 298 | // Check if the debugger output matches the expected output | ||
| 299 | // GCOV_EXCL_START | ||
| 300 | − | if (!testDriverCliOptions.isGitHubActions) { // GDB tests are currently not support on GH actions | |
| 301 | − | TestUtil::checkRefMatch( | |
| 302 | − | testCase.testPath / REF_NAME_GDB_OUTPUT, | |
| 303 | − | [&] { | |
| 304 | // Execute debugger script | ||
| 305 | − | std::filesystem::path gdbScriptPath = testCase.testPath / CTL_DEBUG_SCRIPT; | |
| 306 | − | EXPECT_TRUE(std::filesystem::exists(gdbScriptPath)) << "Debug output requested, but debug script not found"; | |
| 307 | − | gdbScriptPath.make_preferred(); | |
| 308 | − | const std::string cmd = "gdb -x " + gdbScriptPath.string() + " " + executablePath.string(); | |
| 309 | − | const auto [output, exitCode] = SystemUtil::exec(cmd); | |
| 310 | |||
| 311 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 312 | − | EXPECT_EQ(0, exitCode) << "GDB exited with non-zero exit code when running debug script"; | |
| 313 | #endif | ||
| 314 | |||
| 315 | − | return output; | |
| 316 | − | }, | |
| 317 | − | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 318 | // Do not compare against the GDB header | ||
| 319 | − | TestUtil::eraseGDBHeader(expectedOutput); | |
| 320 | − | TestUtil::eraseGDBHeader(actualOutput); | |
| 321 | − | }); | |
| 322 | } | ||
| 323 | // GCOV_EXCL_STOP | ||
| 324 |
4/7✗ Branch 707 → 708 not taken.
✓ Branch 707 → 709 taken 1 time.
✓ Branch 707 → 712 taken 8 times.
✓ Branch 707 → 715 taken 68 times.
✓ Branch 707 → 718 taken 118 times.
✗ Branch 707 → 721 not taken.
✗ Branch 707 → 724 not taken.
|
195 | } catch (LexerError &error) { |
| 325 |
1/2✓ Branch 710 → 711 taken 1 time.
✗ Branch 710 → 727 not taken.
|
1 | TestUtil::handleError(testCase, error); |
| 326 |
1/2✓ Branch 711 → 342 taken 1 time.
✗ Branch 711 → 745 not taken.
|
9 | } catch (ParserError &error) { |
| 327 |
1/2✓ Branch 713 → 714 taken 8 times.
✗ Branch 713 → 729 not taken.
|
8 | TestUtil::handleError(testCase, error); |
| 328 |
1/2✓ Branch 714 → 342 taken 8 times.
✗ Branch 714 → 745 not taken.
|
76 | } catch (SemanticError &error) { |
| 329 |
1/2✓ Branch 716 → 717 taken 68 times.
✗ Branch 716 → 731 not taken.
|
68 | TestUtil::handleError(testCase, error); |
| 330 |
1/2✓ Branch 717 → 342 taken 68 times.
✗ Branch 717 → 745 not taken.
|
186 | } catch (CompilerError &error) { |
| 331 |
1/2✓ Branch 719 → 720 taken 118 times.
✗ Branch 719 → 733 not taken.
|
118 | TestUtil::handleError(testCase, error); |
| 332 | 118 | } catch (LinkerError &error) { | |
| 333 | ✗ | TestUtil::handleError(testCase, error); | |
| 334 | − | } catch (std::exception &error) { // GCOV_EXCL_LINE | |
| 335 | − | TestUtil::handleError(testCase, error); // GCOV_EXCL_LINE | |
| 336 | − | } // GCOV_EXCL_LINE | |
| 337 | |||
| 338 |
3/6✓ Branch 342 → 343 taken 562 times.
✗ Branch 342 → 744 not taken.
✓ Branch 343 → 344 taken 562 times.
✗ Branch 343 → 741 not taken.
✓ Branch 344 → 345 taken 562 times.
✗ Branch 344 → 739 not taken.
|
562 | SUCCEED(); |
| 339 |
8/16✓ Branch 349 → 350 taken 562 times.
✗ Branch 349 → 351 not taken.
✓ Branch 354 → 355 taken 562 times.
✗ Branch 354 → 356 not taken.
✓ Branch 359 → 360 taken 562 times.
✗ Branch 359 → 361 not taken.
✓ Branch 364 → 365 taken 562 times.
✗ Branch 364 → 366 not taken.
✓ Branch 369 → 370 taken 562 times.
✗ Branch 369 → 371 not taken.
✓ Branch 374 → 375 taken 562 times.
✗ Branch 374 → 376 not taken.
✓ Branch 379 → 380 taken 562 times.
✗ Branch 379 → 381 not taken.
✓ Branch 384 → 385 taken 562 times.
✗ Branch 384 → 387 not taken.
|
4496 | } |
| 340 | |||
| 341 | class CommonTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 342 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
29 | TEST_P(CommonTests, ) { execTestCase(GetParam()); } |
| 343 |
4/14spice::testing::gtest_CommonTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_CommonTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 11 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 11 times.
✗ Branch 12 → 24 not taken.
|
24 | INSTANTIATE_TEST_SUITE_P(, CommonTests, ::testing::ValuesIn(TestUtil::collectTestCases("common", false)), |
| 344 | TestUtil::NameResolver()); | ||
| 345 | |||
| 346 | class LexerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 347 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
9 | TEST_P(LexerTests, ) { execTestCase(GetParam()); } |
| 348 |
4/14spice::testing::gtest_LexerTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_LexerTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 1 time.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 1 time.
✗ Branch 12 → 24 not taken.
|
4 | INSTANTIATE_TEST_SUITE_P(, LexerTests, ::testing::ValuesIn(TestUtil::collectTestCases("lexer", false)), TestUtil::NameResolver()); |
| 349 | |||
| 350 | class ParserTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 351 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
23 | TEST_P(ParserTests, ) { execTestCase(GetParam()); } |
| 352 |
4/14spice::testing::gtest_ParserTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_ParserTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 8 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 8 times.
✗ Branch 12 → 24 not taken.
|
18 | INSTANTIATE_TEST_SUITE_P(, ParserTests, ::testing::ValuesIn(TestUtil::collectTestCases("parser", false)), |
| 353 | TestUtil::NameResolver()); | ||
| 354 | |||
| 355 | class SymbolTableBuilderTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 356 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
51 | TEST_P(SymbolTableBuilderTests, ) { execTestCase(GetParam()); } |
| 357 |
4/14spice::testing::gtest_SymbolTableBuilderTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_SymbolTableBuilderTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 22 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 22 times.
✗ Branch 12 → 24 not taken.
|
46 | INSTANTIATE_TEST_SUITE_P(, SymbolTableBuilderTests, ::testing::ValuesIn(TestUtil::collectTestCases("symboltablebuilder", true)), |
| 358 | TestUtil::NameResolver()); | ||
| 359 | |||
| 360 | class TypeCheckerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 361 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
411 | TEST_P(TypeCheckerTests, ) { execTestCase(GetParam()); } |
| 362 |
4/14spice::testing::gtest_TypeCheckerTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_TypeCheckerTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 202 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 202 times.
✗ Branch 12 → 24 not taken.
|
406 | INSTANTIATE_TEST_SUITE_P(, TypeCheckerTests, ::testing::ValuesIn(TestUtil::collectTestCases("typechecker", true)), |
| 363 | TestUtil::NameResolver()); | ||
| 364 | |||
| 365 | class IRGeneratorTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 366 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
353 | TEST_P(IRGeneratorTests, ) { execTestCase(GetParam()); } |
| 367 |
4/14spice::testing::gtest_IRGeneratorTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_IRGeneratorTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 173 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 173 times.
✗ Branch 12 → 24 not taken.
|
348 | INSTANTIATE_TEST_SUITE_P(, IRGeneratorTests, ::testing::ValuesIn(TestUtil::collectTestCases("irgenerator", true)), |
| 368 | TestUtil::NameResolver()); | ||
| 369 | |||
| 370 | class StdTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 371 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
217 | TEST_P(StdTests, ) { execTestCase(GetParam()); } |
| 372 |
4/14spice::testing::gtest_StdTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_StdTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 105 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 105 times.
✗ Branch 12 → 24 not taken.
|
212 | INSTANTIATE_TEST_SUITE_P(, StdTests, ::testing::ValuesIn(TestUtil::collectTestCases("std", true)), TestUtil::NameResolver()); |
| 373 | |||
| 374 | class BenchmarkTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 375 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
21 | TEST_P(BenchmarkTests, ) { execTestCase(GetParam()); } |
| 376 |
4/14spice::testing::gtest_BenchmarkTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_BenchmarkTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 7 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 7 times.
✗ Branch 12 → 24 not taken.
|
16 | INSTANTIATE_TEST_SUITE_P(, BenchmarkTests, ::testing::ValuesIn(TestUtil::collectTestCases("benchmark", false)), |
| 377 | TestUtil::NameResolver()); | ||
| 378 | |||
| 379 | class ExampleTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 380 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
17 | TEST_P(ExampleTests, ) { execTestCase(GetParam()); } |
| 381 |
4/14spice::testing::gtest_ExampleTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_ExampleTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 5 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 5 times.
✗ Branch 12 → 24 not taken.
|
12 | INSTANTIATE_TEST_SUITE_P(, ExampleTests, ::testing::ValuesIn(TestUtil::collectTestCases("examples", false)), |
| 382 | TestUtil::NameResolver()); | ||
| 383 | |||
| 384 | class BootstrapCompilerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 385 |
7/16✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 53 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 45 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 43 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 38 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 34 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 31 not taken.
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1 time.
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
|
69 | TEST_P(BootstrapCompilerTests, ) { execTestCase(GetParam()); } |
| 386 |
4/14spice::testing::gtest_BootstrapCompilerTests_EvalGenerator_():
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 10 not taken.
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
spice::testing::gtest_BootstrapCompilerTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 31 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 20 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 18 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 16 not taken.
✓ Branch 12 → 13 taken 31 times.
✗ Branch 12 → 24 not taken.
|
64 | INSTANTIATE_TEST_SUITE_P(, BootstrapCompilerTests, ::testing::ValuesIn(TestUtil::collectTestCases("bootstrap-compiler", false)), |
| 387 | TestUtil::NameResolver()); | ||
| 388 | |||
| 389 | } // namespace spice::testing | ||
| 390 |