| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2025 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/SymbolTable.h> | ||
| 19 | #include <util/SystemUtil.h> | ||
| 20 | |||
| 21 | #include "driver/TestDriver.h" | ||
| 22 | #include "util/TestUtil.h" | ||
| 23 | |||
| 24 | using namespace spice::compiler; | ||
| 25 | |||
| 26 | namespace spice::testing { | ||
| 27 | |||
| 28 | extern TestDriverCliOptions testDriverCliOptions; | ||
| 29 | |||
| 30 | 440 | void execTestCase(const TestCase &testCase) { | |
| 31 | // Check if test is disabled | ||
| 32 |
3/4✓ Branch 2 → 3 taken 440 times.
✗ Branch 2 → 576 not taken.
✓ Branch 3 → 4 taken 2 times.
✓ Branch 3 → 10 taken 438 times.
|
440 | if (TestUtil::isDisabled(testCase)) |
| 33 |
3/6✓ Branch 4 → 5 taken 2 times.
✗ Branch 4 → 275 not taken.
✓ Branch 5 → 6 taken 2 times.
✗ Branch 5 → 272 not taken.
✓ Branch 6 → 7 taken 2 times.
✗ Branch 6 → 270 not taken.
|
2 | GTEST_SKIP(); |
| 34 | |||
| 35 | // Create fake cli options | ||
| 36 |
2/4✓ Branch 10 → 11 taken 438 times.
✗ Branch 10 → 278 not taken.
✓ Branch 11 → 12 taken 438 times.
✗ Branch 11 → 276 not taken.
|
438 | const std::filesystem::path mainSourceFilePath = testCase.testPath / REF_NAME_SOURCE; |
| 37 | 438 | CliOptions cliOptions = { | |
| 38 | /* mainSourceFile= */ mainSourceFilePath, | ||
| 39 | /* targetTriple= */ {}, | ||
| 40 | − | /* targetArch= */ TARGET_UNKNOWN, // GCOV_EXCL_LINE - coverage tool bug | |
| 41 | 438 | /* targetVendor= */ TARGET_UNKNOWN, | |
| 42 | 438 | /* targetOs= */ TARGET_UNKNOWN, | |
| 43 | /* isNativeTarget= */ true, | ||
| 44 | /* useCPUFeatures*/ false, // Disabled because it makes the refs differ on different machines | ||
| 45 | /* execute= */ false, // If we set this to 'true', the compiler will not emit object files | ||
| 46 | /* cacheDir= */ "./cache", | ||
| 47 | /* outputDir= */ "./", | ||
| 48 | /* outputPath= */ "", | ||
| 49 | /* buildMode= */ BuildMode::DEBUG, | ||
| 50 | /* compileJobCount= */ 0, | ||
| 51 | /* ignoreCache */ true, | ||
| 52 | 438 | /* llvmArgs= */ "", | |
| 53 | /* printDebugOutput= */ false, | ||
| 54 | CliOptions::DumpSettings{ | ||
| 55 | /* dumpCST= */ false, | ||
| 56 | /* dumpAST= */ false, | ||
| 57 | /* dumpSymbolTables= */ false, | ||
| 58 | /* dumpTypes= */ false, | ||
| 59 | /* dumpCacheStats= */ false, | ||
| 60 | /* dumpDependencyGraph= */ false, | ||
| 61 | /* dumpIR= */ false, | ||
| 62 | /* dumpAssembly= */ false, | ||
| 63 | /* dumpObjectFile= */ false, | ||
| 64 | /* dumpToFiles= */ false, | ||
| 65 | /* abortAfterDump */ false, | ||
| 66 | }, | ||
| 67 | /* namesForIRValues= */ true, | ||
| 68 | /* useLifetimeMarkers= */ false, | ||
| 69 | /* useTBAAMetadata */ false, | ||
| 70 | /* optLevel= */ OptLevel::O0, | ||
| 71 | /* useLTO= */ false, | ||
| 72 |
2/4✓ Branch 31 → 32 taken 438 times.
✗ Branch 31 → 287 not taken.
✓ Branch 32 → 33 taken 438 times.
✗ Branch 32 → 285 not taken.
|
876 | /* noEntryFct= */ exists(testCase.testPath / CTL_RUN_BUILTIN_TESTS), |
| 73 |
2/4✓ Branch 34 → 35 taken 438 times.
✗ Branch 34 → 281 not taken.
✓ Branch 35 → 36 taken 438 times.
✗ Branch 35 → 279 not taken.
|
876 | /* generateTestMain= */ exists(testCase.testPath / CTL_RUN_BUILTIN_TESTS), |
| 74 | /* staticLinking= */ false, | ||
| 75 | CliOptions::InstrumentationSettings{ | ||
| 76 | /* generateDebugInfo= */ false, | ||
| 77 | /* sanitizer= */ Sanitizer::NONE, | ||
| 78 | }, | ||
| 79 | /* disableVerifier= */ false, | ||
| 80 | /* testMode= */ true, | ||
| 81 | /* comparableOutput= */ true, | ||
| 82 |
10/38✓ Branch 13 → 14 taken 438 times.
✗ Branch 13 → 574 not taken.
✓ Branch 17 → 18 taken 438 times.
✗ Branch 17 → 321 not taken.
✓ Branch 20 → 21 taken 438 times.
✗ Branch 20 → 315 not taken.
✓ Branch 23 → 24 taken 438 times.
✗ Branch 23 → 309 not taken.
✓ Branch 24 → 25 taken 438 times.
✗ Branch 24 → 306 not taken.
✓ Branch 25 → 26 taken 438 times.
✗ Branch 25 → 303 not taken.
✓ Branch 26 → 27 taken 438 times.
✗ Branch 26 → 300 not taken.
✓ Branch 29 → 30 taken 438 times.
✗ Branch 29 → 294 not taken.
✓ Branch 30 → 31 taken 438 times.
✗ Branch 30 → 289 not taken.
✓ Branch 33 → 34 taken 438 times.
✗ Branch 33 → 283 not taken.
✗ Branch 291 → 292 not taken.
✗ Branch 291 → 293 not taken.
✗ Branch 297 → 298 not taken.
✗ Branch 297 → 299 not taken.
✗ Branch 300 → 301 not taken.
✗ Branch 300 → 302 not taken.
✗ Branch 303 → 304 not taken.
✗ Branch 303 → 305 not taken.
✗ Branch 306 → 307 not taken.
✗ Branch 306 → 308 not taken.
✗ Branch 312 → 313 not taken.
✗ Branch 312 → 314 not taken.
✗ Branch 318 → 319 not taken.
✗ Branch 318 → 320 not taken.
✗ Branch 324 → 325 not taken.
✗ Branch 324 → 326 not taken.
✗ Branch 327 → 328 not taken.
✗ Branch 327 → 329 not taken.
|
3066 | }; |
| 83 | static_assert(sizeof(CliOptions::DumpSettings) == 11, "CliOptions::DumpSettings struct size changed"); | ||
| 84 | static_assert(sizeof(CliOptions::InstrumentationSettings) == 2, "CliOptions::InstrumentationSettings struct size changed"); | ||
| 85 | #if defined(__clang__) && defined(__apple_build_version__) | ||
| 86 | // some std types for Apple Clang are smaller than for GCC and Clang | ||
| 87 | static_assert(sizeof(CliOptions) == 288, "CliOptions struct size changed"); | ||
| 88 | #else | ||
| 89 | static_assert(sizeof(CliOptions) == 392, "CliOptions struct size changed"); | ||
| 90 | #endif | ||
| 91 | |||
| 92 | // Parse test args | ||
| 93 |
1/2✓ Branch 46 → 47 taken 438 times.
✗ Branch 46 → 330 not taken.
|
876 | std::vector<std::string> args = {"spice", "build"}; |
| 94 |
1/2✓ Branch 48 → 49 taken 438 times.
✗ Branch 48 → 570 not taken.
|
438 | TestUtil::parseTestArgs(cliOptions.mainSourceFile, args); |
| 95 |
2/4✓ Branch 49 → 50 taken 438 times.
✗ Branch 49 → 335 not taken.
✓ Branch 50 → 51 taken 438 times.
✗ Branch 50 → 333 not taken.
|
438 | args.push_back(mainSourceFilePath.string()); |
| 96 | |||
| 97 | 438 | bool explicitlySelectedTarget = false; | |
| 98 | 438 | std::vector<const char *> argv; | |
| 99 |
1/2✓ Branch 53 → 54 taken 438 times.
✗ Branch 53 → 568 not taken.
|
438 | argv.reserve(args.size()); |
| 100 |
2/2✓ Branch 64 → 56 taken 1338 times.
✓ Branch 64 → 65 taken 438 times.
|
1776 | for (const std::string &arg : args) { |
| 101 |
2/2✓ Branch 58 → 59 taken 5 times.
✓ Branch 58 → 60 taken 1333 times.
|
1338 | if (arg.starts_with("--target")) |
| 102 | 5 | explicitlySelectedTarget = true; | |
| 103 |
1/2✓ Branch 61 → 62 taken 1338 times.
✗ Branch 61 → 336 not taken.
|
1338 | argv.push_back(arg.c_str()); |
| 104 | } | ||
| 105 |
1/2✓ Branch 65 → 66 taken 438 times.
✗ Branch 65 → 568 not taken.
|
438 | Driver driver(cliOptions, true); |
| 106 |
1/2✓ Branch 68 → 69 taken 438 times.
✗ Branch 68 → 566 not taken.
|
438 | driver.parse(static_cast<int>(argv.size()), argv.data()); |
| 107 |
1/2✓ Branch 69 → 70 taken 438 times.
✗ Branch 69 → 566 not taken.
|
438 | driver.enrich(); |
| 108 | |||
| 109 | // 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 | ||
| 110 |
2/2✓ Branch 70 → 71 taken 5 times.
✓ Branch 70 → 72 taken 433 times.
|
438 | if (explicitlySelectedTarget) |
| 111 | 5 | cliOptions.isNativeTarget = false; | |
| 112 | |||
| 113 | // Instantiate GlobalResourceManager | ||
| 114 |
1/2✓ Branch 72 → 73 taken 438 times.
✗ Branch 72 → 566 not taken.
|
438 | GlobalResourceManager resourceManager(cliOptions); |
| 115 | |||
| 116 | try { | ||
| 117 | // Create source file instance for main source file | ||
| 118 |
2/4✓ Branch 75 → 76 taken 438 times.
✗ Branch 75 → 340 not taken.
✓ Branch 76 → 77 taken 438 times.
✗ Branch 76 → 338 not taken.
|
438 | SourceFile *mainSourceFile = resourceManager.createSourceFile(nullptr, MAIN_FILE_NAME, cliOptions.mainSourceFile, false); |
| 119 | |||
| 120 | // Run Lexer and Parser | ||
| 121 |
2/2✓ Branch 79 → 80 taken 436 times.
✓ Branch 79 → 525 taken 2 times.
|
438 | mainSourceFile->runLexer(); |
| 122 |
1/2✓ Branch 80 → 81 taken 436 times.
✗ Branch 80 → 525 not taken.
|
436 | mainSourceFile->runParser(); |
| 123 | |||
| 124 | // Check CST | ||
| 125 |
3/6✓ Branch 83 → 84 taken 436 times.
✗ Branch 83 → 348 not taken.
✓ Branch 84 → 85 taken 436 times.
✗ Branch 84 → 346 not taken.
✓ Branch 85 → 86 taken 436 times.
✗ Branch 85 → 344 not taken.
|
436 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_PARSE_TREE, [&] { |
| 126 | 8 | mainSourceFile->runCSTVisualizer(); | |
| 127 | 8 | return mainSourceFile->compilerOutput.cstString; | |
| 128 | }); | ||
| 129 | |||
| 130 | // Build and optimize AST | ||
| 131 |
2/2✓ Branch 90 → 91 taken 428 times.
✓ Branch 90 → 525 taken 8 times.
|
436 | mainSourceFile->runASTBuilder(); |
| 132 | |||
| 133 | // Check AST | ||
| 134 |
3/6✓ Branch 93 → 94 taken 428 times.
✗ Branch 93 → 362 not taken.
✓ Branch 94 → 95 taken 428 times.
✗ Branch 94 → 360 not taken.
✓ Branch 95 → 96 taken 428 times.
✗ Branch 95 → 358 not taken.
|
428 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYNTAX_TREE, [&] { |
| 135 | 8 | mainSourceFile->runASTVisualizer(); | |
| 136 | 8 | return mainSourceFile->compilerOutput.astString; | |
| 137 | }); | ||
| 138 | |||
| 139 | // Execute import collector and semantic analysis stages | ||
| 140 |
2/2✓ Branch 100 → 101 taken 423 times.
✓ Branch 100 → 525 taken 5 times.
|
428 | mainSourceFile->runImportCollector(); |
| 141 |
2/2✓ Branch 101 → 102 taken 405 times.
✓ Branch 101 → 525 taken 18 times.
|
423 | mainSourceFile->runSymbolTableBuilder(); |
| 142 |
2/2✓ Branch 102 → 103 taken 256 times.
✓ Branch 102 → 525 taken 149 times.
|
405 | mainSourceFile->runMiddleEnd(); // TypeChecker pre + post |
| 143 | |||
| 144 | // Check symbol table output (check happens here to include updates from type checker) | ||
| 145 |
3/6✓ Branch 105 → 106 taken 256 times.
✗ Branch 105 → 376 not taken.
✓ Branch 106 → 107 taken 256 times.
✗ Branch 106 → 374 not taken.
✓ Branch 107 → 108 taken 256 times.
✗ Branch 107 → 372 not taken.
|
512 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_SYMBOL_TABLE, |
| 146 |
2/4✓ Branch 3 → 4 taken 9 times.
✗ Branch 3 → 11 not taken.
✓ Branch 4 → 5 taken 9 times.
✗ Branch 4 → 9 not taken.
|
521 | [&] { return mainSourceFile->globalScope->getSymbolTableJSON().dump(/*indent=*/2); }); |
| 147 | |||
| 148 | // Fail if an error was expected | ||
| 149 | − | if (TestUtil::doesRefExist(testCase.testPath / REF_NAME_ERROR_OUTPUT)) // GCOV_EXCL_LINE | |
| 150 | − | FAIL() << "Expected error, but got no error"; // GCOV_EXCL_LINE | |
| 151 | |||
| 152 | // Check dependency graph | ||
| 153 |
3/6✓ Branch 127 → 128 taken 256 times.
✗ Branch 127 → 402 not taken.
✓ Branch 128 → 129 taken 256 times.
✗ Branch 128 → 400 not taken.
✓ Branch 129 → 130 taken 256 times.
✗ Branch 129 → 398 not taken.
|
256 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_DEP_GRAPH, [&] { |
| 154 | 2 | mainSourceFile->runDependencyGraphVisualizer(); | |
| 155 | 2 | return mainSourceFile->compilerOutput.depGraphString; | |
| 156 | }); | ||
| 157 | |||
| 158 | // Run backend for all dependencies | ||
| 159 |
5/8✓ Branch 134 → 135 taken 256 times.
✗ Branch 134 → 412 not taken.
✓ Branch 135 → 136 taken 256 times.
✗ Branch 135 → 412 not taken.
✓ Branch 136 → 137 taken 256 times.
✗ Branch 136 → 412 not taken.
✓ Branch 142 → 138 taken 194 times.
✓ Branch 142 → 143 taken 256 times.
|
450 | for (SourceFile *sourceFile : mainSourceFile->dependencies | std::views::values) |
| 160 |
1/2✓ Branch 139 → 140 taken 194 times.
✗ Branch 139 → 412 not taken.
|
194 | sourceFile->runBackEnd(); |
| 161 | |||
| 162 | // Execute IR generator in normal or debug mode | ||
| 163 |
1/2✓ Branch 143 → 144 taken 256 times.
✗ Branch 143 → 525 not taken.
|
256 | mainSourceFile->runIRGenerator(); |
| 164 | |||
| 165 | // Check IR code | ||
| 166 |
2/2✓ Branch 155 → 145 taken 1536 times.
✓ Branch 155 → 156 taken 256 times.
|
1792 | for (uint8_t i = 0; i <= 5; i++) { |
| 167 |
1/2✓ Branch 149 → 150 taken 1536 times.
✗ Branch 149 → 413 not taken.
|
1536 | TestUtil::checkRefMatch( |
| 168 |
2/4✓ Branch 147 → 148 taken 1536 times.
✗ Branch 147 → 417 not taken.
✓ Branch 148 → 149 taken 1536 times.
✗ Branch 148 → 415 not taken.
|
3072 | testCase.testPath / REF_NAME_OPT_IR[i], |
| 169 |
1/2✓ Branch 146 → 147 taken 1536 times.
✗ Branch 146 → 421 not taken.
|
3072 | [&] { |
| 170 | 178 | cliOptions.optLevel = static_cast<OptLevel>(i); | |
| 171 | |||
| 172 |
2/2✓ Branch 2 → 3 taken 1 time.
✓ Branch 2 → 6 taken 177 times.
|
178 | if (cliOptions.useLTO) { |
| 173 | 1 | mainSourceFile->runPreLinkIROptimizer(); | |
| 174 | 1 | mainSourceFile->runBitcodeLinker(); | |
| 175 | 1 | mainSourceFile->runPostLinkIROptimizer(); | |
| 176 | } else { | ||
| 177 | 177 | mainSourceFile->runDefaultIROptimizer(); | |
| 178 | } | ||
| 179 | |||
| 180 | 178 | return mainSourceFile->compilerOutput.irOptString; | |
| 181 | }, | ||
| 182 | 3072 | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 183 |
2/2✓ Branch 2 → 3 taken 6 times.
✓ Branch 2 → 5 taken 172 times.
|
178 | if (cliOptions.instrumentation.generateDebugInfo) { |
| 184 | // Remove the lines, containing paths on the local file system | ||
| 185 | 6 | TestUtil::eraseLinesBySubstring(expectedOutput, " = !DIFile(filename:"); | |
| 186 | 6 | TestUtil::eraseLinesBySubstring(actualOutput, " = !DIFile(filename:"); | |
| 187 | } | ||
| 188 | 178 | }, | |
| 189 | true); | ||
| 190 | } | ||
| 191 | |||
| 192 | // Link the bitcode if not happened yet | ||
| 193 |
3/4✓ Branch 156 → 157 taken 1 time.
✓ Branch 156 → 159 taken 255 times.
✗ Branch 157 → 158 not taken.
✓ Branch 157 → 159 taken 1 time.
|
256 | if (cliOptions.useLTO && cliOptions.optLevel == OptLevel::O0) |
| 194 | ✗ | mainSourceFile->runBitcodeLinker(); | |
| 195 | |||
| 196 | // Check assembly code (only when not running test on GitHub Actions) | ||
| 197 | 256 | bool objectFilesEmitted = false; | |
| 198 | // GCOV_EXCL_START | ||
| 199 | − | if (!testDriverCliOptions.isGitHubActions) { | |
| 200 | − | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_ASM, [&] { | |
| 201 | − | mainSourceFile->runObjectEmitter(); | |
| 202 | − | objectFilesEmitted = true; | |
| 203 | |||
| 204 | − | return mainSourceFile->compilerOutput.asmString; | |
| 205 | }); | ||
| 206 | } | ||
| 207 | // GCOV_EXCL_STOP | ||
| 208 | |||
| 209 | // Check warnings | ||
| 210 |
1/2✓ Branch 170 → 171 taken 256 times.
✗ Branch 170 → 525 not taken.
|
256 | mainSourceFile->collectAndPrintWarnings(); |
| 211 |
3/6✓ Branch 173 → 174 taken 256 times.
✗ Branch 173 → 446 not taken.
✓ Branch 174 → 175 taken 256 times.
✗ Branch 174 → 444 not taken.
✓ Branch 175 → 176 taken 256 times.
✗ Branch 175 → 442 not taken.
|
256 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_WARNING_OUTPUT, [&] { |
| 212 |
1/2✓ Branch 2 → 3 taken 22 times.
✗ Branch 2 → 19 not taken.
|
22 | std::stringstream actualWarningString; |
| 213 |
2/2✓ Branch 10 → 5 taken 23 times.
✓ Branch 10 → 11 taken 22 times.
|
45 | for (const CompilerWarning &warning : mainSourceFile->compilerOutput.warnings) |
| 214 |
2/4✓ Branch 6 → 7 taken 23 times.
✗ Branch 6 → 16 not taken.
✓ Branch 7 → 8 taken 23 times.
✗ Branch 7 → 16 not taken.
|
23 | actualWarningString << warning.warningMessage << "\n"; |
| 215 |
1/2✓ Branch 11 → 12 taken 22 times.
✗ Branch 11 → 17 not taken.
|
44 | return actualWarningString.str(); |
| 216 | 22 | }); | |
| 217 | |||
| 218 | // Do linking and conclude compilation | ||
| 219 |
3/6✓ Branch 180 → 181 taken 256 times.
✗ Branch 180 → 460 not taken.
✓ Branch 181 → 182 taken 256 times.
✗ Branch 181 → 458 not taken.
✓ Branch 182 → 183 taken 256 times.
✗ Branch 182 → 456 not taken.
|
256 | const bool needsNormalRun = TestUtil::doesRefExist(testCase.testPath / REF_NAME_EXECUTION_OUTPUT); |
| 220 |
3/6✓ Branch 185 → 186 taken 256 times.
✗ Branch 185 → 466 not taken.
✓ Branch 186 → 187 taken 256 times.
✗ Branch 186 → 464 not taken.
✓ Branch 187 → 188 taken 256 times.
✗ Branch 187 → 462 not taken.
|
256 | const bool needsDebuggerRun = TestUtil::doesRefExist(testCase.testPath / REF_NAME_GDB_OUTPUT); |
| 221 |
3/4✓ Branch 190 → 191 taken 54 times.
✓ Branch 190 → 192 taken 202 times.
✗ Branch 191 → 192 not taken.
✓ Branch 191 → 198 taken 54 times.
|
256 | if (needsNormalRun || needsDebuggerRun) { |
| 222 | // Emit main source file object if not done already | ||
| 223 |
1/2✓ Branch 192 → 193 taken 202 times.
✗ Branch 192 → 194 not taken.
|
202 | if (!objectFilesEmitted) |
| 224 |
1/2✓ Branch 193 → 194 taken 202 times.
✗ Branch 193 → 525 not taken.
|
202 | mainSourceFile->runObjectEmitter(); |
| 225 | |||
| 226 | // Conclude the compilation | ||
| 227 |
1/2✓ Branch 194 → 195 taken 202 times.
✗ Branch 194 → 525 not taken.
|
202 | mainSourceFile->concludeCompilation(); |
| 228 | |||
| 229 | // Prepare linker | ||
| 230 |
1/2✓ Branch 195 → 196 taken 202 times.
✗ Branch 195 → 468 not taken.
|
202 | resourceManager.linker.outputPath = TestUtil::getDefaultExecutableName(); |
| 231 | |||
| 232 | // Prepare and run linker | ||
| 233 |
1/2✓ Branch 196 → 197 taken 202 times.
✗ Branch 196 → 525 not taken.
|
202 | resourceManager.linker.prepare(); |
| 234 |
1/2✓ Branch 197 → 198 taken 202 times.
✗ Branch 197 → 525 not taken.
|
202 | resourceManager.linker.link(); |
| 235 | } | ||
| 236 | |||
| 237 | // Check type registry output | ||
| 238 |
3/6✓ Branch 200 → 201 taken 256 times.
✗ Branch 200 → 473 not taken.
✓ Branch 201 → 202 taken 256 times.
✗ Branch 201 → 471 not taken.
✓ Branch 202 → 203 taken 256 times.
✗ Branch 202 → 469 not taken.
|
263 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_TYPE_REGISTRY, [&] { return TypeRegistry::dump(); }); |
| 239 | |||
| 240 | // Check cache stats output | ||
| 241 |
3/6✓ Branch 209 → 210 taken 256 times.
✗ Branch 209 → 487 not taken.
✓ Branch 210 → 211 taken 256 times.
✗ Branch 210 → 485 not taken.
✓ Branch 211 → 212 taken 256 times.
✗ Branch 211 → 483 not taken.
|
256 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_CACHE_STATS, [&] { |
| 242 |
1/2✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 31 not taken.
|
1 | std::stringstream cacheStats; |
| 243 |
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; |
| 244 |
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; |
| 245 |
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; |
| 246 |
1/2✓ Branch 15 → 16 taken 1 time.
✗ Branch 15 → 29 not taken.
|
2 | return cacheStats.str(); |
| 247 | 1 | }); | |
| 248 | |||
| 249 | // Check if the execution output matches the expected output | ||
| 250 |
3/6✓ Branch 218 → 219 taken 256 times.
✗ Branch 218 → 501 not taken.
✓ Branch 219 → 220 taken 256 times.
✗ Branch 219 → 499 not taken.
✓ Branch 220 → 221 taken 256 times.
✗ Branch 220 → 497 not taken.
|
256 | TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXECUTION_OUTPUT, [&] { |
| 251 |
2/4✓ Branch 2 → 3 taken 202 times.
✗ Branch 2 → 65 not taken.
✓ Branch 3 → 4 taken 202 times.
✗ Branch 3 → 63 not taken.
|
202 | const std::filesystem::path cliFlagsFile = testCase.testPath / INPUT_NAME_CLI_FLAGS; |
| 252 | // Execute binary | ||
| 253 |
1/2✓ Branch 5 → 6 taken 202 times.
✗ Branch 5 → 110 not taken.
|
202 | std::stringstream cmd; |
| 254 |
1/2✗ Branch 6 → 7 not taken.
✓ Branch 6 → 8 taken 202 times.
|
202 | if (testDriverCliOptions.enableLeakDetection) |
| 255 | ✗ | cmd << "valgrind -q --leak-check=full --num-callers=100 --error-exitcode=1 "; | |
| 256 |
1/2✓ Branch 8 → 9 taken 202 times.
✗ Branch 8 → 108 not taken.
|
202 | cmd << TestUtil::getDefaultExecutableName(); |
| 257 |
3/4✓ Branch 9 → 10 taken 202 times.
✗ Branch 9 → 108 not taken.
✓ Branch 10 → 11 taken 2 times.
✓ Branch 10 → 17 taken 200 times.
|
202 | if (exists(cliFlagsFile)) |
| 258 |
4/8✓ Branch 11 → 12 taken 2 times.
✗ Branch 11 → 108 not taken.
✓ Branch 12 → 13 taken 2 times.
✗ Branch 12 → 68 not taken.
✓ Branch 13 → 14 taken 2 times.
✗ Branch 13 → 66 not taken.
✓ Branch 14 → 15 taken 2 times.
✗ Branch 14 → 66 not taken.
|
2 | cmd << " " << TestUtil::getFileContentLinesVector(cliFlagsFile).at(0); |
| 259 |
2/4✓ Branch 17 → 18 taken 202 times.
✗ Branch 17 → 71 not taken.
✓ Branch 18 → 19 taken 202 times.
✗ Branch 18 → 69 not taken.
|
202 | const auto [output, exitCode] = SystemUtil::exec(cmd.str(), true); |
| 260 | |||
| 261 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 262 | // Check if the exit code matches the expected one | ||
| 263 | // If no exit code ref file exists, check against 0 | ||
| 264 |
5/8✓ Branch 22 → 23 taken 202 times.
✗ Branch 22 → 76 not taken.
✓ Branch 23 → 24 taken 202 times.
✗ Branch 23 → 74 not taken.
✓ Branch 24 → 25 taken 202 times.
✗ Branch 24 → 72 not taken.
✓ Branch 29 → 30 taken 4 times.
✓ Branch 29 → 43 taken 198 times.
|
206 | if (TestUtil::checkRefMatch(testCase.testPath / REF_NAME_EXIT_CODE, [&] { return std::to_string(exitCode); })) { |
| 265 |
2/12✓ Branch 30 → 31 taken 4 times.
✗ Branch 30 → 86 not taken.
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 41 taken 4 times.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 92 not taken.
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 90 not taken.
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 89 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 87 not taken.
|
4 | EXPECT_NE(0, exitCode) << "Program exited with zero exit code, but expected erroneous exit code"; |
| 266 | } else { | ||
| 267 |
2/12✓ Branch 43 → 44 taken 198 times.
✗ Branch 43 → 96 not taken.
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 54 taken 198 times.
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 102 not taken.
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 100 not taken.
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 99 not taken.
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 97 not taken.
|
198 | EXPECT_EQ(0, exitCode) << "Program exited with non-zero exit code"; |
| 268 | } | ||
| 269 | #endif | ||
| 270 | |||
| 271 |
1/2✓ Branch 56 → 57 taken 202 times.
✗ Branch 56 → 106 not taken.
|
404 | return output; |
| 272 | 202 | }); | |
| 273 | |||
| 274 | // Check if the debugger output matches the expected output | ||
| 275 | // GCOV_EXCL_START | ||
| 276 | − | if (!testDriverCliOptions.isGitHubActions) { // GDB tests are currently not support on GH actions | |
| 277 | − | TestUtil::checkRefMatch( | |
| 278 | − | testCase.testPath / REF_NAME_GDB_OUTPUT, | |
| 279 | − | [&] { | |
| 280 | // Execute debugger script | ||
| 281 | − | std::filesystem::path gdbScriptPath = testCase.testPath / CTL_DEBUG_SCRIPT; | |
| 282 | − | EXPECT_TRUE(std::filesystem::exists(gdbScriptPath)) << "Debug output requested, but debug script not found"; | |
| 283 | − | gdbScriptPath.make_preferred(); | |
| 284 | − | const std::string cmd = "gdb -x " + gdbScriptPath.string() + " " + TestUtil::getDefaultExecutableName(); | |
| 285 | − | const auto [output, exitCode] = SystemUtil::exec(cmd); | |
| 286 | |||
| 287 | #if not OS_WINDOWS // Windows does not give us the exit code, so we cannot check it on Windows | ||
| 288 | − | EXPECT_EQ(0, exitCode) << "GDB exited with non-zero exit code when running debug script"; | |
| 289 | #endif | ||
| 290 | |||
| 291 | − | return output; | |
| 292 | − | }, | |
| 293 | − | [&](std::string &expectedOutput, std::string &actualOutput) { | |
| 294 | // Do not compare against the GDB header | ||
| 295 | − | TestUtil::eraseGDBHeader(expectedOutput); | |
| 296 | − | TestUtil::eraseGDBHeader(actualOutput); | |
| 297 | − | }); | |
| 298 | } | ||
| 299 | // GCOV_EXCL_STOP | ||
| 300 |
4/7✗ Branch 526 → 527 not taken.
✓ Branch 526 → 528 taken 1 time.
✓ Branch 526 → 531 taken 8 times.
✓ Branch 526 → 534 taken 68 times.
✓ Branch 526 → 537 taken 105 times.
✗ Branch 526 → 540 not taken.
✗ Branch 526 → 543 not taken.
|
182 | } catch (LexerError &error) { |
| 301 |
1/2✓ Branch 529 → 530 taken 1 time.
✗ Branch 529 → 546 not taken.
|
1 | TestUtil::handleError(testCase, error); |
| 302 |
1/2✓ Branch 530 → 238 taken 1 time.
✗ Branch 530 → 564 not taken.
|
9 | } catch (ParserError &error) { |
| 303 |
1/2✓ Branch 532 → 533 taken 8 times.
✗ Branch 532 → 548 not taken.
|
8 | TestUtil::handleError(testCase, error); |
| 304 |
1/2✓ Branch 533 → 238 taken 8 times.
✗ Branch 533 → 564 not taken.
|
76 | } catch (SemanticError &error) { |
| 305 |
1/2✓ Branch 535 → 536 taken 68 times.
✗ Branch 535 → 550 not taken.
|
68 | TestUtil::handleError(testCase, error); |
| 306 |
1/2✓ Branch 536 → 238 taken 68 times.
✗ Branch 536 → 564 not taken.
|
173 | } catch (CompilerError &error) { |
| 307 |
1/2✓ Branch 538 → 539 taken 105 times.
✗ Branch 538 → 552 not taken.
|
105 | TestUtil::handleError(testCase, error); |
| 308 | 105 | } catch (LinkerError &error) { | |
| 309 | ✗ | TestUtil::handleError(testCase, error); | |
| 310 | − | } catch (std::exception &error) { // GCOV_EXCL_LINE | |
| 311 | − | TestUtil::handleError(testCase, error); // GCOV_EXCL_LINE | |
| 312 | − | } // GCOV_EXCL_LINE | |
| 313 | |||
| 314 |
3/6✓ Branch 238 → 239 taken 438 times.
✗ Branch 238 → 563 not taken.
✓ Branch 239 → 240 taken 438 times.
✗ Branch 239 → 560 not taken.
✓ Branch 240 → 241 taken 438 times.
✗ Branch 240 → 558 not taken.
|
438 | SUCCEED(); |
| 315 |
6/12✓ Branch 245 → 246 taken 438 times.
✗ Branch 245 → 247 not taken.
✓ Branch 249 → 250 taken 438 times.
✗ Branch 249 → 251 not taken.
✓ Branch 253 → 254 taken 438 times.
✗ Branch 253 → 255 not taken.
✓ Branch 257 → 258 taken 438 times.
✗ Branch 257 → 259 not taken.
✓ Branch 261 → 262 taken 438 times.
✗ Branch 261 → 263 not taken.
✓ Branch 265 → 266 taken 438 times.
✗ Branch 265 → 268 not taken.
|
438 | } |
| 316 | |||
| 317 | class CommonTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 318 |
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(CommonTests, ) { execTestCase(GetParam()); } |
| 319 |
4/14spice::testing::gtest_CommonTests_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.
spice::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.
|
8 | INSTANTIATE_TEST_SUITE_P(, CommonTests, ::testing::ValuesIn(TestUtil::collectTestCases("common", false)), |
| 320 | TestUtil::NameResolver()); | ||
| 321 | |||
| 322 | class LexerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 323 |
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()); } |
| 324 |
4/14spice::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.
spice::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.
|
2 | INSTANTIATE_TEST_SUITE_P(, LexerTests, ::testing::ValuesIn(TestUtil::collectTestCases("lexer", false)), TestUtil::NameResolver()); |
| 325 | |||
| 326 | class ParserTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 327 |
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()); } |
| 328 |
4/14spice::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.
spice::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.
|
9 | INSTANTIATE_TEST_SUITE_P(, ParserTests, ::testing::ValuesIn(TestUtil::collectTestCases("parser", false)), |
| 329 | TestUtil::NameResolver()); | ||
| 330 | |||
| 331 | class SymbolTableBuilderTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 332 |
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.
|
49 | TEST_P(SymbolTableBuilderTests, ) { execTestCase(GetParam()); } |
| 333 |
4/14spice::testing::gtest_SymbolTableBuilderTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 21 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 21 times.
✗ Branch 12 → 24 not taken.
spice::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.
|
22 | INSTANTIATE_TEST_SUITE_P(, SymbolTableBuilderTests, ::testing::ValuesIn(TestUtil::collectTestCases("symboltablebuilder", true)), |
| 334 | TestUtil::NameResolver()); | ||
| 335 | |||
| 336 | class TypeCheckerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 337 |
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.
|
371 | TEST_P(TypeCheckerTests, ) { execTestCase(GetParam()); } |
| 338 |
4/14spice::testing::gtest_TypeCheckerTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 182 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 182 times.
✗ Branch 12 → 24 not taken.
spice::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.
|
183 | INSTANTIATE_TEST_SUITE_P(, TypeCheckerTests, ::testing::ValuesIn(TestUtil::collectTestCases("typechecker", true)), |
| 339 | TestUtil::NameResolver()); | ||
| 340 | |||
| 341 | class IRGeneratorTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 342 |
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.
|
289 | TEST_P(IRGeneratorTests, ) { execTestCase(GetParam()); } |
| 343 |
4/14spice::testing::gtest_IRGeneratorTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 141 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 141 times.
✗ Branch 12 → 24 not taken.
spice::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.
|
142 | INSTANTIATE_TEST_SUITE_P(, IRGeneratorTests, ::testing::ValuesIn(TestUtil::collectTestCases("irgenerator", true)), |
| 344 | TestUtil::NameResolver()); | ||
| 345 | |||
| 346 | class StdTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 347 |
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.
|
129 | TEST_P(StdTests, ) { execTestCase(GetParam()); } |
| 348 |
4/14spice::testing::gtest_StdTests_EvalGenerateName_(testing::TestParamInfo<spice::testing::TestCase> const&):
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 12 taken 61 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 61 times.
✗ Branch 12 → 24 not taken.
spice::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.
|
62 | INSTANTIATE_TEST_SUITE_P(, StdTests, ::testing::ValuesIn(TestUtil::collectTestCases("std", true)), TestUtil::NameResolver()); |
| 349 | |||
| 350 | class BenchmarkTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 351 |
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()); } |
| 352 |
4/14spice::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.
spice::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.
|
8 | INSTANTIATE_TEST_SUITE_P(, BenchmarkTests, ::testing::ValuesIn(TestUtil::collectTestCases("benchmark", false)), |
| 353 | TestUtil::NameResolver()); | ||
| 354 | |||
| 355 | class ExampleTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 356 |
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()); } |
| 357 |
4/14spice::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.
spice::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.
|
6 | INSTANTIATE_TEST_SUITE_P(, ExampleTests, ::testing::ValuesIn(TestUtil::collectTestCases("examples", false)), |
| 358 | TestUtil::NameResolver()); | ||
| 359 | |||
| 360 | class BootstrapCompilerTests : public ::testing::TestWithParam<TestCase> {}; | ||
| 361 |
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(BootstrapCompilerTests, ) { execTestCase(GetParam()); } |
| 362 |
4/14spice::testing::gtest_BootstrapCompilerTests_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.
spice::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.
|
8 | INSTANTIATE_TEST_SUITE_P(, BootstrapCompilerTests, ::testing::ValuesIn(TestUtil::collectTestCases("bootstrap-compiler", false)), |
| 363 | TestUtil::NameResolver()); | ||
| 364 | |||
| 365 | } // namespace spice::testing | ||
| 366 |