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 | 461 | void execTestCase(const TestCase &testCase) { | |
| 35 | // Check if test is disabled | ||
| 36 |
3/4✓ Branch 2 → 3 taken 461 times.
✗ Branch 2 → 697 not taken.
✓ Branch 3 → 4 taken 3 times.
✓ Branch 3 → 10 taken 458 times.
|
461 | if (TestUtil::isDisabled(testCase)) |
| 37 |
3/6✓ Branch 4 → 5 taken 3 times.
✗ Branch 4 → 340 not taken.
✓ Branch 5 → 6 taken 3 times.
✗ Branch 5 → 337 not taken.
✓ Branch 6 → 7 taken 3 times.
✗ Branch 6 → 335 not taken.
|
3 | GTEST_SKIP(); |
| 38 | |||
| 39 | // Create fake cli options | ||
| 40 |
2/4✓ Branch 10 → 11 taken 458 times.
✗ Branch 10 → 343 not taken.
✓ Branch 11 → 12 taken 458 times.
✗ Branch 11 → 341 not taken.
|
458 | const std::filesystem::path mainSourceFilePath = testCase.testPath / REF_NAME_SOURCE; |
| 41 | 458 | CliOptions cliOptions = { | |
| 42 | /* mainSourceFile= */ mainSourceFilePath, | ||
| 43 | /* targetTriple= */ {}, | ||
| 44 | − | /* targetArch= */ TARGET_UNKNOWN, // GCOV_EXCL_LINE - coverage tool bug | |
| 45 | 458 | /* targetVendor= */ TARGET_UNKNOWN, | |
| 46 | 458 | /* 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 | 458 | /* 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 458 times.
✗ Branch 31 → 352 not taken.
✓ Branch 32 → 33 taken 458 times.
✗ Branch 32 → 350 not taken.
|
916 | /* noEntryFct= */ exists(testCase.testPath / CTL_RUN_BUILTIN_TESTS), |
| 78 |
2/4✓ Branch 34 → 35 taken 458 times.
✗ Branch 34 → 346 not taken.
✓ Branch 35 → 36 taken 458 times.
✗ Branch 35 → 344 not taken.
|
916 | /* 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 |
10/38✓ Branch 13 → 14 taken 458 times.
✗ Branch 13 → 695 not taken.
✓ Branch 17 → 18 taken 458 times.
✗ Branch 17 → 386 not taken.
✓ Branch 20 → 21 taken 458 times.
✗ Branch 20 → 380 not taken.
✓ Branch 23 → 24 taken 458 times.
✗ Branch 23 → 374 not taken.
✓ Branch 24 → 25 taken 458 times.
✗ Branch 24 → 371 not taken.
✓ Branch 25 → 26 taken 458 times.
✗ Branch 25 → 368 not taken.
✓ Branch 26 → 27 taken 458 times.
✗ Branch 26 → 365 not taken.
✓ Branch 29 → 30 taken 458 times.
✗ Branch 29 → 359 not taken.
✓ Branch 30 → 31 taken 458 times.
✗ Branch 30 → 354 not taken.
✓ Branch 33 → 34 taken 458 times.
✗ Branch 33 → 348 not taken.
✗ Branch 356 → 357 not taken.
✗ Branch 356 → 358 not taken.
✗ Branch 362 → 363 not taken.
✗ Branch 362 → 364 not taken.
✗ Branch 365 → 366 not taken.
✗ Branch 365 → 367 not taken.
✗ Branch 368 → 369 not taken.
✗ Branch 368 → 370 not taken.
✗ Branch 371 → 372 not taken.
✗ Branch 371 → 373 not taken.
✗ Branch 377 → 378 not taken.
✗ Branch 377 → 379 not taken.
✗ Branch 383 → 384 not taken.
✗ Branch 383 → 385 not taken.
✗ Branch 389 → 390 not taken.
✗ Branch 389 → 391 not taken.
✗ Branch 392 → 393 not taken.
✗ Branch 392 → 394 not taken.
|
3206 | }; |
| 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 47 → 48 taken 458 times.
✗ Branch 47 → 395 not taken.
|
916 | std::vector<std::string> args = {"spice", "build"}; |
| 100 |
1/2✓ Branch 49 → 50 taken 458 times.
✗ Branch 49 → 691 not taken.
|
458 | TestUtil::parseTestArgs(cliOptions.mainSourceFile, args); |
| 101 |
2/4✓ Branch 50 → 51 taken 458 times.
✗ Branch 50 → 400 not taken.
✓ Branch 51 → 52 taken 458 times.
✗ Branch 51 → 398 not taken.
|
458 | args.push_back(mainSourceFilePath.string()); |
| 102 | |||
| 103 | 458 | bool explicitlySelectedTarget = false; | |
| 104 | 458 | std::vector<const char *> argv; | |
| 105 |
1/2✓ Branch 54 → 55 taken 458 times.
✗ Branch 54 → 689 not taken.
|
458 | argv.reserve(args.size()); |
| 106 |
2/2✓ Branch 65 → 57 taken 1432 times.
✓ Branch 65 → 66 taken 458 times.
|
1890 | for (const std::string &arg : args) { |
| 107 |
2/2✓ Branch 59 → 60 taken 5 times.
✓ Branch 59 → 61 taken 1427 times.
|
1432 | if (arg.starts_with("--target")) |
| 108 | 5 | explicitlySelectedTarget = true; | |
| 109 |
1/2✓ Branch 62 → 63 taken 1432 times.
✗ Branch 62 → 401 not taken.
|
1432 | argv.push_back(arg.c_str()); |
| 110 | } | ||
| 111 |
1/2✓ Branch 66 → 67 taken 458 times.
✗ Branch 66 → 689 not taken.
|
458 | Driver driver(cliOptions, true); |
| 112 |
1/2✓ Branch 69 → 70 taken 458 times.
✗ Branch 69 → 687 not taken.
|
458 | driver.parse(static_cast<int>(argv.size()), argv.data()); |
| 113 |
1/2✓ Branch 70 → 71 taken 458 times.
✗ Branch 70 → 687 not taken.
|
458 | 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 71 → 72 taken 5 times.
✓ Branch 71 → 73 taken 453 times.
|
458 | if (explicitlySelectedTarget) |
| 117 | 5 | cliOptions.isNativeTarget = false; | |
| 118 | |||
| 119 | // Instantiate GlobalResourceManager | ||
| 120 |
1/2✓ Branch 73 → 74 taken 458 times.
✗ Branch 73 → 687 not taken.
|
458 | GlobalResourceManager resourceManager(cliOptions); |
| 121 | |||
| 122 | try { | ||
| 123 | // Create source file instance for main source file | ||
| 124 |
2/4✓ Branch 76 → 77 taken 458 times.
✗ Branch 76 → 405 not taken.
✓ Branch 77 → 78 taken 458 times.
✗ Branch 77 → 403 not taken.
|
458 | SourceFile *mainSourceFile = resourceManager.createSourceFile(nullptr, MAIN_FILE_NAME, cliOptions.mainSourceFile, false); |
| 125 | |||
| 126 | // Run Lexer and Parser | ||
| 127 |
2/2✓ Branch 80 → 81 taken 456 times.
✓ Branch 80 → 646 taken 2 times.
|
458 | mainSourceFile->runLexer(); |
| 128 |
1/2✓ Branch 81 → 82 taken 456 times.
✗ Branch 81 → 646 not taken.
|
456 | mainSourceFile->runParser(); |
| 129 | |||
| 130 | // Check CST | ||
| 131 |
3/6✓ Branch 84 → 85 taken 456 times.
✗ Branch 84 → 413 not taken.
✓ Branch 85 → 86 taken 456 times.
✗ Branch 85 → 411 not taken.
✓ Branch 86 → 87 taken 456 times.
✗ Branch 86 → 409 not taken.
|
456 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_PARSE_TREE, [&] { |
| 132 | 8 | mainSourceFile->runCSTVisualizer(); | |
| 133 | 8 | return mainSourceFile->compilerOutput.cstString; | |
| 134 | }); | ||
| 135 | |||
| 136 | // Build and optimize AST | ||
| 137 |
2/2✓ Branch 91 → 92 taken 448 times.
✓ Branch 91 → 646 taken 8 times.
|
456 | mainSourceFile->runASTBuilder(); |
| 138 | |||
| 139 | // Check AST | ||
| 140 |
3/6✓ Branch 94 → 95 taken 448 times.
✗ Branch 94 → 427 not taken.
✓ Branch 95 → 96 taken 448 times.
✗ Branch 95 → 425 not taken.
✓ Branch 96 → 97 taken 448 times.
✗ Branch 96 → 423 not taken.
|
448 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYNTAX_TREE, [&] { |
| 141 | 8 | mainSourceFile->runASTVisualizer(); | |
| 142 | 8 | return mainSourceFile->compilerOutput.astString; | |
| 143 | }); | ||
| 144 | |||
| 145 | // Execute import collector and semantic analysis stages | ||
| 146 |
2/2✓ Branch 101 → 102 taken 443 times.
✓ Branch 101 → 646 taken 5 times.
|
448 | mainSourceFile->runImportCollector(); |
| 147 |
2/2✓ Branch 102 → 103 taken 424 times.
✓ Branch 102 → 646 taken 19 times.
|
443 | mainSourceFile->runSymbolTableBuilder(); |
| 148 |
2/2✓ Branch 103 → 104 taken 270 times.
✓ Branch 103 → 646 taken 154 times.
|
424 | mainSourceFile->runMiddleEnd(); // TypeChecker pre + post |
| 149 | |||
| 150 | // Check symbol table output (check happens here to include updates from type checker) | ||
| 151 |
3/6✓ Branch 106 → 107 taken 270 times.
✗ Branch 106 → 441 not taken.
✓ Branch 107 → 108 taken 270 times.
✗ Branch 107 → 439 not taken.
✓ Branch 108 → 109 taken 270 times.
✗ Branch 108 → 437 not taken.
|
540 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYMBOL_TABLE, |
| 152 |
2/4✓ Branch 3 → 4 taken 9 times.
✗ Branch 3 → 11 not taken.
✓ Branch 4 → 5 taken 9 times.
✗ Branch 4 → 9 not taken.
|
549 | [&] { return mainSourceFile->globalScope->getSymbolTableJSON().dump(/*indent=*/2); }); |
| 153 | |||
| 154 | // Fail if an error was expected | ||
| 155 | − | if (TestUtil::doesRefExist(testCase.testPath / REF_NAME_ERROR_OUTPUT)) // GCOV_EXCL_LINE | |
| 156 | − | FAIL() << "Expected error, but got no error"; // GCOV_EXCL_LINE | |
| 157 | |||
| 158 | // Check dependency graph | ||
| 159 |
3/6✓ Branch 128 → 129 taken 270 times.
✗ Branch 128 → 467 not taken.
✓ Branch 129 → 130 taken 270 times.
✗ Branch 129 → 465 not taken.
✓ Branch 130 → 131 taken 270 times.
✗ Branch 130 → 463 not taken.
|
270 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_DEP_GRAPH, [&] { |
| 160 | 2 | mainSourceFile->runDependencyGraphVisualizer(); | |
| 161 | 2 | return mainSourceFile->compilerOutput.depGraphString; | |
| 162 | }); | ||
| 163 | |||
| 164 | // Run backend for all dependencies | ||
| 165 |
5/8✓ Branch 135 → 136 taken 270 times.
✗ Branch 135 → 477 not taken.
✓ Branch 136 → 137 taken 270 times.
✗ Branch 136 → 477 not taken.
✓ Branch 137 → 138 taken 270 times.
✗ Branch 137 → 477 not taken.
✓ Branch 143 → 139 taken 211 times.
✓ Branch 143 → 144 taken 270 times.
|
481 | for (SourceFile *sourceFile : mainSourceFile->dependencies | std::views::values) |
| 166 |
1/2✓ Branch 140 → 141 taken 211 times.
✗ Branch 140 → 477 not taken.
|
211 | sourceFile->runBackEnd(); |
| 167 | |||
| 168 | // Execute IR generator in normal or debug mode | ||
| 169 |
1/2✓ Branch 144 → 145 taken 270 times.
✗ Branch 144 → 646 not taken.
|
270 | mainSourceFile->runIRGenerator(); |
| 170 | |||
| 171 | // Check IR code | ||
| 172 |
2/2✓ Branch 156 → 146 taken 1620 times.
✓ Branch 156 → 157 taken 270 times.
|
1890 | for (uint8_t i = 0; i <= 5; i++) { |
| 173 |
1/2✓ Branch 150 → 151 taken 1620 times.
✗ Branch 150 → 478 not taken.
|
1620 | TestUtil::checkRefMatch( |
| 174 |
2/4✓ Branch 148 → 149 taken 1620 times.
✗ Branch 148 → 482 not taken.
✓ Branch 149 → 150 taken 1620 times.
✗ Branch 149 → 480 not taken.
|
3240 | testCase.testPath / REF_NAME_OPT_IR[i], |
| 175 |
1/2✓ Branch 147 → 148 taken 1620 times.
✗ Branch 147 → 486 not taken.
|
3240 | [&] { |
| 176 | 192 | cliOptions.optLevel = static_cast<OptLevel>(i); | |
| 177 | |||
| 178 |
2/2✓ Branch 2 → 3 taken 1 time.
✓ Branch 2 → 6 taken 191 times.
|
192 | if (cliOptions.useLTO) { |
| 179 | 1 | mainSourceFile->runPreLinkIROptimizer(); | |
| 180 | 1 | mainSourceFile->runBitcodeLinker(); | |
| 181 | 1 | mainSourceFile->runPostLinkIROptimizer(); | |
| 182 | } else { | ||
| 183 | 191 | mainSourceFile->runDefaultIROptimizer(); | |
| 184 | } | ||
| 185 | |||
| 186 | 192 | return mainSourceFile->compilerOutput.irOptString; | |
| 187 | }, | ||
| 188 | 3240 | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 189 |
2/2✓ Branch 2 → 3 taken 6 times.
✓ Branch 2 → 5 taken 186 times.
|
192 | if (cliOptions.instrumentation.generateDebugInfo) { |
| 190 | // Remove the lines, containing paths on the local file system | ||
| 191 | 6 | TestUtil::eraseLinesBySubstring(expectedOutput, " = !DIFile(filename:"); | |
| 192 | 6 | TestUtil::eraseLinesBySubstring(actualOutput, " = !DIFile(filename:"); | |
| 193 | } | ||
| 194 | 192 | }, | |
| 195 | true); | ||
| 196 | } | ||
| 197 | |||
| 198 | // Link the bitcode if not happened yet | ||
| 199 |
3/4✓ Branch 157 → 158 taken 1 time.
✓ Branch 157 → 160 taken 269 times.
✗ Branch 158 → 159 not taken.
✓ Branch 158 → 160 taken 1 time.
|
270 | if (cliOptions.useLTO && cliOptions.optLevel == OptLevel::O0) |
| 200 | ✗ | mainSourceFile->runBitcodeLinker(); | |
| 201 | |||
| 202 | // Check assembly code (only when not running test on GitHub Actions) | ||
| 203 | 270 | bool objectFilesEmitted = false; | |
| 204 | // GCOV_EXCL_START | ||
| 205 | − | if (!testDriverCliOptions.isGitHubActions) { | |
| 206 | − | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_ASM, [&] { | |
| 207 | − | mainSourceFile->runObjectEmitter(); | |
| 208 | − | objectFilesEmitted = true; | |
| 209 | |||
| 210 | − | return mainSourceFile->compilerOutput.asmString; | |
| 211 | }); | ||
| 212 | } | ||
| 213 | // GCOV_EXCL_STOP | ||
| 214 | |||
| 215 | // Check warnings | ||
| 216 |
1/2✓ Branch 171 → 172 taken 270 times.
✗ Branch 171 → 646 not taken.
|
270 | mainSourceFile->collectAndPrintWarnings(); |
| 217 |
3/6✓ Branch 174 → 175 taken 270 times.
✗ Branch 174 → 511 not taken.
✓ Branch 175 → 176 taken 270 times.
✗ Branch 175 → 509 not taken.
✓ Branch 176 → 177 taken 270 times.
✗ Branch 176 → 507 not taken.
|
270 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_WARNING_OUTPUT, [&] { |
| 218 |
1/2✓ Branch 2 → 3 taken 21 times.
✗ Branch 2 → 19 not taken.
|
21 | std::stringstream actualWarningString; |
| 219 |
2/2✓ Branch 10 → 5 taken 22 times.
✓ Branch 10 → 11 taken 21 times.
|
43 | for (const CompilerWarning &warning : mainSourceFile->compilerOutput.warnings) |
| 220 |
2/4✓ Branch 6 → 7 taken 22 times.
✗ Branch 6 → 16 not taken.
✓ Branch 7 → 8 taken 22 times.
✗ Branch 7 → 16 not taken.
|
22 | actualWarningString << warning.warningMessage << "\n"; |
| 221 |
1/2✓ Branch 11 → 12 taken 21 times.
✗ Branch 11 → 17 not taken.
|
42 | return actualWarningString.str(); |
| 222 | 21 | }); | |
| 223 | |||
| 224 | // Do linking and conclude compilation | ||
| 225 |
3/6✓ Branch 181 → 182 taken 270 times.
✗ Branch 181 → 525 not taken.
✓ Branch 182 → 183 taken 270 times.
✗ Branch 182 → 523 not taken.
✓ Branch 183 → 184 taken 270 times.
✗ Branch 183 → 521 not taken.
|
270 | const bool needsNormalRunForOutput = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXECUTION_OUTPUT); |
| 226 |
3/6✓ Branch 186 → 187 taken 270 times.
✗ Branch 186 → 531 not taken.
✓ Branch 187 → 188 taken 270 times.
✗ Branch 187 → 529 not taken.
✓ Branch 188 → 189 taken 270 times.
✗ Branch 188 → 527 not taken.
|
270 | const bool needsNormalRunForExitCode = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXIT_CODE); |
| 227 |
3/6✓ Branch 191 → 192 taken 270 times.
✗ Branch 191 → 537 not taken.
✓ Branch 192 → 193 taken 270 times.
✗ Branch 192 → 535 not taken.
✓ Branch 193 → 194 taken 270 times.
✗ Branch 193 → 533 not taken.
|
270 | const bool needsDebuggerRun = TestUtil::doesRefExist(testCase.testPath / REF_NAME_GDB_OUTPUT); |
| 228 |
5/6✓ Branch 196 → 197 taken 60 times.
✓ Branch 196 → 199 taken 210 times.
✓ Branch 197 → 198 taken 48 times.
✓ Branch 197 → 199 taken 12 times.
✗ Branch 198 → 199 not taken.
✓ Branch 198 → 206 taken 48 times.
|
270 | if (needsNormalRunForOutput || needsNormalRunForExitCode || needsDebuggerRun) { |
| 229 | // Emit main source file object if not done already | ||
| 230 |
1/2✓ Branch 199 → 200 taken 222 times.
✗ Branch 199 → 201 not taken.
|
222 | if (!objectFilesEmitted) |
| 231 |
1/2✓ Branch 200 → 201 taken 222 times.
✗ Branch 200 → 646 not taken.
|
222 | mainSourceFile->runObjectEmitter(); |
| 232 | |||
| 233 | // Conclude the compilation | ||
| 234 |
1/2✓ Branch 201 → 202 taken 222 times.
✗ Branch 201 → 646 not taken.
|
222 | mainSourceFile->concludeCompilation(); |
| 235 | |||
| 236 | // Prepare linker | ||
| 237 |
1/2✓ Branch 202 → 203 taken 222 times.
✗ Branch 202 → 539 not taken.
|
222 | resourceManager.linker.outputPath = TestUtil::getDefaultExecutableName(); |
| 238 | |||
| 239 | // Prepare and run linker | ||
| 240 |
1/2✓ Branch 203 → 204 taken 222 times.
✗ Branch 203 → 646 not taken.
|
222 | resourceManager.linker.prepare(); |
| 241 |
1/2✓ Branch 204 → 205 taken 222 times.
✗ Branch 204 → 646 not taken.
|
222 | resourceManager.linker.run(); |
| 242 |
1/2✓ Branch 205 → 206 taken 222 times.
✗ Branch 205 → 646 not taken.
|
222 | resourceManager.linker.cleanup(); |
| 243 | } | ||
| 244 | |||
| 245 | // Check type registry output | ||
| 246 |
3/6✓ Branch 208 → 209 taken 270 times.
✗ Branch 208 → 544 not taken.
✓ Branch 209 → 210 taken 270 times.
✗ Branch 209 → 542 not taken.
✓ Branch 210 → 211 taken 270 times.
✗ Branch 210 → 540 not taken.
|
277 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_TYPE_REGISTRY, [&] { return TypeRegistry::dump(); }); |
| 247 | |||
| 248 | // Check cache stats output | ||
| 249 |
3/6✓ Branch 217 → 218 taken 270 times.
✗ Branch 217 → 558 not taken.
✓ Branch 218 → 219 taken 270 times.
✗ Branch 218 → 556 not taken.
✓ Branch 219 → 220 taken 270 times.
✗ Branch 219 → 554 not taken.
|
270 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_CACHE_STATS, [&] { |
| 250 |
1/2✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 31 not taken.
|
1 | std::stringstream cacheStats; |
| 251 |
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; |
| 252 |
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; |
| 253 |
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; |
| 254 |
1/2✓ Branch 15 → 16 taken 1 time.
✗ Branch 15 → 29 not taken.
|
2 | return cacheStats.str(); |
| 255 | 1 | }); | |
| 256 | |||
| 257 |
3/6✓ Branch 224 → 225 taken 270 times.
✗ Branch 224 → 572 not taken.
✓ Branch 225 → 226 taken 270 times.
✗ Branch 225 → 570 not taken.
✓ Branch 226 → 227 taken 270 times.
✗ Branch 226 → 568 not taken.
|
270 | const bool checkExecutionOutput = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXECUTION_OUTPUT); |
| 258 |
3/6✓ Branch 229 → 230 taken 270 times.
✗ Branch 229 → 578 not taken.
✓ Branch 230 → 231 taken 270 times.
✗ Branch 230 → 576 not taken.
✓ Branch 231 → 232 taken 270 times.
✗ Branch 231 → 574 not taken.
|
270 | const bool checkExecutionExitCode = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXIT_CODE); |
| 259 |
4/4✓ Branch 234 → 235 taken 60 times.
✓ Branch 234 → 236 taken 210 times.
✓ Branch 235 → 236 taken 12 times.
✓ Branch 235 → 290 taken 48 times.
|
270 | if (checkExecutionOutput || checkExecutionExitCode) { |
| 260 |
2/4✓ Branch 236 → 237 taken 222 times.
✗ Branch 236 → 582 not taken.
✓ Branch 237 → 238 taken 222 times.
✗ Branch 237 → 580 not taken.
|
222 | const std::filesystem::path cliFlagsFile = testCase.testPath / INPUT_NAME_CLI_FLAGS; |
| 261 | // Execute binary | ||
| 262 |
1/2✓ Branch 239 → 240 taken 222 times.
✗ Branch 239 → 629 not taken.
|
222 | std::stringstream cmd; |
| 263 |
1/2✗ Branch 240 → 241 not taken.
✓ Branch 240 → 242 taken 222 times.
|
222 | if (testDriverCliOptions.enableLeakDetection) |
| 264 | ✗ | cmd << "valgrind -q --leak-check=full --num-callers=100 --error-exitcode=1 "; | |
| 265 |
1/2✓ Branch 242 → 243 taken 222 times.
✗ Branch 242 → 627 not taken.
|
222 | cmd << TestUtil::getDefaultExecutableName(); |
| 266 |
3/4✓ Branch 243 → 244 taken 222 times.
✗ Branch 243 → 627 not taken.
✓ Branch 244 → 245 taken 2 times.
✓ Branch 244 → 251 taken 220 times.
|
222 | if (exists(cliFlagsFile)) |
| 267 |
4/8✓ Branch 245 → 246 taken 2 times.
✗ Branch 245 → 627 not taken.
✓ Branch 246 → 247 taken 2 times.
✗ Branch 246 → 585 not taken.
✓ Branch 247 → 248 taken 2 times.
✗ Branch 247 → 583 not taken.
✓ Branch 248 → 249 taken 2 times.
✗ Branch 248 → 583 not taken.
|
2 | cmd << " " << TestUtil::getFileContentLinesVector(cliFlagsFile).at(0); |
| 268 |
2/4✓ Branch 251 → 252 taken 222 times.
✗ Branch 251 → 588 not taken.
✓ Branch 252 → 253 taken 222 times.
✗ Branch 252 → 586 not taken.
|
222 | const auto [output, exitCode] = SystemUtil::exec(cmd.str(), checkExecutionOutput); |
| 269 | |||
| 270 | // Check if the execution output matches the expected output | ||
| 271 | 210 | const auto getActualOutput = [&] { return output; }; | |
| 272 |
3/6✓ Branch 256 → 257 taken 222 times.
✗ Branch 256 → 593 not taken.
✓ Branch 257 → 258 taken 222 times.
✗ Branch 257 → 591 not taken.
✓ Branch 258 → 259 taken 222 times.
✗ Branch 258 → 589 not taken.
|
222 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXECUTION_OUTPUT, getActualOutput); |
| 273 | |||
| 274 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 275 | // Check if the exit code matches the expected one | ||
| 276 | // If no exit code ref file exists, check against 0 | ||
| 277 | 16 | const auto getActualExitCode = [&] { return std::to_string(exitCode); }; | |
| 278 |
3/6✓ Branch 265 → 266 taken 222 times.
✗ Branch 265 → 606 not taken.
✓ Branch 266 → 267 taken 222 times.
✗ Branch 266 → 604 not taken.
✓ Branch 267 → 268 taken 222 times.
✗ Branch 267 → 602 not taken.
|
222 | const bool refExists = TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXIT_CODE, getActualExitCode); |
| 279 |
2/2✓ Branch 272 → 273 taken 206 times.
✓ Branch 272 → 286 taken 16 times.
|
222 | if (!refExists) { |
| 280 |
2/12✓ Branch 273 → 274 taken 206 times.
✗ Branch 273 → 615 not taken.
✗ Branch 275 → 276 not taken.
✓ Branch 275 → 284 taken 206 times.
✗ Branch 276 → 277 not taken.
✗ Branch 276 → 621 not taken.
✗ Branch 277 → 278 not taken.
✗ Branch 277 → 619 not taken.
✗ Branch 279 → 280 not taken.
✗ Branch 279 → 618 not taken.
✗ Branch 280 → 281 not taken.
✗ Branch 280 → 616 not taken.
|
206 | EXPECT_EQ(0, exitCode) << "Program exited with non-zero exit code"; |
| 281 | } | ||
| 282 | #endif | ||
| 283 | 222 | } | |
| 284 | |||
| 285 | // Check if the debugger output matches the expected output | ||
| 286 | // GCOV_EXCL_START | ||
| 287 | − | if (!testDriverCliOptions.isGitHubActions) { // GDB tests are currently not support on GH actions | |
| 288 | − | TestUtil::checkRefMatch( | |
| 289 | − | testCase.testPath / REF_NAME_GDB_OUTPUT, | |
| 290 | − | [&] { | |
| 291 | // Execute debugger script | ||
| 292 | − | std::filesystem::path gdbScriptPath = testCase.testPath / CTL_DEBUG_SCRIPT; | |
| 293 | − | EXPECT_TRUE(std::filesystem::exists(gdbScriptPath)) << "Debug output requested, but debug script not found"; | |
| 294 | − | gdbScriptPath.make_preferred(); | |
| 295 | − | const std::string cmd = "gdb -x " + gdbScriptPath.string() + " " + TestUtil::getDefaultExecutableName(); | |
| 296 | − | const auto [output, exitCode] = SystemUtil::exec(cmd); | |
| 297 | |||
| 298 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 299 | − | EXPECT_EQ(0, exitCode) << "GDB exited with non-zero exit code when running debug script"; | |
| 300 | #endif | ||
| 301 | |||
| 302 | − | return output; | |
| 303 | − | }, | |
| 304 | − | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 305 | // Do not compare against the GDB header | ||
| 306 | − | TestUtil::eraseGDBHeader(expectedOutput); | |
| 307 | − | TestUtil::eraseGDBHeader(actualOutput); | |
| 308 | − | }); | |
| 309 | } | ||
| 310 | // GCOV_EXCL_STOP | ||
| 311 |
4/7✗ Branch 647 → 648 not taken.
✓ Branch 647 → 649 taken 1 time.
✓ Branch 647 → 652 taken 8 times.
✓ Branch 647 → 655 taken 68 times.
✓ Branch 647 → 658 taken 111 times.
✗ Branch 647 → 661 not taken.
✗ Branch 647 → 664 not taken.
|
188 | } catch (LexerError &error) { |
| 312 |
1/2✓ Branch 650 → 651 taken 1 time.
✗ Branch 650 → 667 not taken.
|
1 | TestUtil::handleError(testCase, error); |
| 313 |
1/2✓ Branch 651 → 303 taken 1 time.
✗ Branch 651 → 685 not taken.
|
9 | } catch (ParserError &error) { |
| 314 |
1/2✓ Branch 653 → 654 taken 8 times.
✗ Branch 653 → 669 not taken.
|
8 | TestUtil::handleError(testCase, error); |
| 315 |
1/2✓ Branch 654 → 303 taken 8 times.
✗ Branch 654 → 685 not taken.
|
76 | } catch (SemanticError &error) { |
| 316 |
1/2✓ Branch 656 → 657 taken 68 times.
✗ Branch 656 → 671 not taken.
|
68 | TestUtil::handleError(testCase, error); |
| 317 |
1/2✓ Branch 657 → 303 taken 68 times.
✗ Branch 657 → 685 not taken.
|
179 | } catch (CompilerError &error) { |
| 318 |
1/2✓ Branch 659 → 660 taken 111 times.
✗ Branch 659 → 673 not taken.
|
111 | TestUtil::handleError(testCase, error); |
| 319 | 111 | } catch (LinkerError &error) { | |
| 320 | ✗ | TestUtil::handleError(testCase, error); | |
| 321 | − | } catch (std::exception &error) { // GCOV_EXCL_LINE | |
| 322 | − | TestUtil::handleError(testCase, error); // GCOV_EXCL_LINE | |
| 323 | − | } // GCOV_EXCL_LINE | |
| 324 | |||
| 325 |
3/6✓ Branch 303 → 304 taken 458 times.
✗ Branch 303 → 684 not taken.
✓ Branch 304 → 305 taken 458 times.
✗ Branch 304 → 681 not taken.
✓ Branch 305 → 306 taken 458 times.
✗ Branch 305 → 679 not taken.
|
458 | SUCCEED(); |
| 326 |
6/12✓ Branch 310 → 311 taken 458 times.
✗ Branch 310 → 312 not taken.
✓ Branch 314 → 315 taken 458 times.
✗ Branch 314 → 316 not taken.
✓ Branch 318 → 319 taken 458 times.
✗ Branch 318 → 320 not taken.
✓ Branch 322 → 323 taken 458 times.
✗ Branch 322 → 324 not taken.
✓ Branch 326 → 327 taken 458 times.
✗ Branch 326 → 328 not taken.
✓ Branch 330 → 331 taken 458 times.
✗ Branch 330 → 333 not taken.
|
458 | } |
| 327 | |||
| 328 | class CommonTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 329 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
29 | TEST_P(CommonTests, ) { execTestCase(GetParam()); } |
| 330 |
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.
|
12 | INSTANTIATE_TEST_SUITE_P(, CommonTests, ::testing::ValuesIn(TestUtil::collectTestCases("common", false)), |
| 331 | TestUtil::NameResolver()); | ||
| 332 | |||
| 333 | class LexerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 334 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
9 | TEST_P(LexerTests, ) { execTestCase(GetParam()); } |
| 335 |
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.
|
2 | INSTANTIATE_TEST_SUITE_P(, LexerTests, ::testing::ValuesIn(TestUtil::collectTestCases("lexer", false)), TestUtil::NameResolver()); |
| 336 | |||
| 337 | class ParserTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 338 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
23 | TEST_P(ParserTests, ) { execTestCase(GetParam()); } |
| 339 |
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.
|
9 | INSTANTIATE_TEST_SUITE_P(, ParserTests, ::testing::ValuesIn(TestUtil::collectTestCases("parser", false)), |
| 340 | TestUtil::NameResolver()); | ||
| 341 | |||
| 342 | class SymbolTableBuilderTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 343 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
51 | TEST_P(SymbolTableBuilderTests, ) { execTestCase(GetParam()); } |
| 344 |
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.
|
23 | INSTANTIATE_TEST_SUITE_P(, SymbolTableBuilderTests, ::testing::ValuesIn(TestUtil::collectTestCases("symboltablebuilder", true)), |
| 345 | TestUtil::NameResolver()); | ||
| 346 | |||
| 347 | class TypeCheckerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 348 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
379 | TEST_P(TypeCheckerTests, ) { execTestCase(GetParam()); } |
| 349 |
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 186 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 186 times.
✗ Branch 12 → 24 not taken.
|
187 | INSTANTIATE_TEST_SUITE_P(, TypeCheckerTests, ::testing::ValuesIn(TestUtil::collectTestCases("typechecker", true)), |
| 350 | TestUtil::NameResolver()); | ||
| 351 | |||
| 352 | class IRGeneratorTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 353 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
307 | TEST_P(IRGeneratorTests, ) { execTestCase(GetParam()); } |
| 354 |
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 150 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 150 times.
✗ Branch 12 → 24 not taken.
|
151 | INSTANTIATE_TEST_SUITE_P(, IRGeneratorTests, ::testing::ValuesIn(TestUtil::collectTestCases("irgenerator", true)), |
| 355 | TestUtil::NameResolver()); | ||
| 356 | |||
| 357 | class StdTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 358 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
137 | TEST_P(StdTests, ) { execTestCase(GetParam()); } |
| 359 |
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 65 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 65 times.
✗ Branch 12 → 24 not taken.
|
66 | INSTANTIATE_TEST_SUITE_P(, StdTests, ::testing::ValuesIn(TestUtil::collectTestCases("std", true)), TestUtil::NameResolver()); |
| 360 | |||
| 361 | class BenchmarkTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 362 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
21 | TEST_P(BenchmarkTests, ) { execTestCase(GetParam()); } |
| 363 |
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.
|
8 | INSTANTIATE_TEST_SUITE_P(, BenchmarkTests, ::testing::ValuesIn(TestUtil::collectTestCases("benchmark", false)), |
| 364 | TestUtil::NameResolver()); | ||
| 365 | |||
| 366 | class ExampleTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 367 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
17 | TEST_P(ExampleTests, ) { execTestCase(GetParam()); } |
| 368 |
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.
|
6 | INSTANTIATE_TEST_SUITE_P(, ExampleTests, ::testing::ValuesIn(TestUtil::collectTestCases("examples", false)), |
| 369 | TestUtil::NameResolver()); | ||
| 370 | |||
| 371 | class BootstrapCompilerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 372 |
6/14✓ Branch 6 → 7 taken 1 time.
✗ Branch 6 → 51 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 43 not taken.
✓ Branch 11 → 12 taken 1 time.
✗ Branch 11 → 41 not taken.
✓ Branch 14 → 15 taken 1 time.
✗ Branch 14 → 36 not taken.
✓ Branch 16 → 17 taken 1 time.
✗ Branch 16 → 32 not taken.
✓ Branch 18 → 19 taken 1 time.
✗ Branch 18 → 29 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
|
19 | TEST_P(BootstrapCompilerTests, ) { execTestCase(GetParam()); } |
| 373 |
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 6 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 6 times.
✗ Branch 12 → 24 not taken.
|
7 | INSTANTIATE_TEST_SUITE_P(, BootstrapCompilerTests, ::testing::ValuesIn(TestUtil::collectTestCases("bootstrap-compiler", false)), |
| 374 | TestUtil::NameResolver()); | ||
| 375 | |||
| 376 | } // namespace spice::testing | ||
| 377 |