GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 92.6% 113 / 22 / 144
Functions: 100.0% 13 / 1 / 14
Branches: 51.0% 151 / 48 / 344

test/util/TestUtil.cpp
Line Branch Exec Source
1 // Copyright (c) 2021-2026 ChilliBits. All rights reserved.
2
3 #include "TestUtil.h"
4
5 #include <dirent.h>
6 #if OS_UNIX
7 #include <cstring> // Required by builds on Unix
8 #endif
9
10 #include <gtest/gtest.h>
11
12 #include <util/CommonUtil.h>
13 #include <util/FileUtil.h>
14
15 #include "../driver/TestDriver.h"
16
17 namespace spice::testing {
18
19 using namespace spice::compiler;
20
21 extern TestDriverCliOptions testDriverCliOptions;
22
23 468 void TestUtil::parseTestArgs(const std::filesystem::path &sourceCodePath, std::vector<std::string> &args) {
24
3/4
✓ Branch 2 → 3 taken 468 times.
✗ Branch 2 → 79 not taken.
✓ Branch 3 → 4 taken 1 time.
✓ Branch 3 → 5 taken 467 times.
468 if (!exists(sourceCodePath))
25 444 return;
26
27
1/2
✓ Branch 5 → 6 taken 467 times.
✗ Branch 5 → 79 not taken.
467 std::ifstream file(sourceCodePath);
28
1/2
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 467 times.
467 assert(file.is_open());
29
30 467 std::string firstLine;
31
4/6
✓ Branch 10 → 11 taken 467 times.
✗ Branch 10 → 75 not taken.
✓ Branch 11 → 12 taken 467 times.
✗ Branch 11 → 75 not taken.
✓ Branch 12 → 13 taken 1 time.
✓ Branch 12 → 14 taken 466 times.
467 if (!std::getline(file, firstLine))
32 1 return;
33
1/2
✓ Branch 14 → 15 taken 466 times.
✗ Branch 14 → 63 not taken.
466 firstLine = CommonUtil::trim(firstLine);
34
35 // Only allow "// TEST: " as prefix
36
2/4
✓ Branch 17 → 18 taken 466 times.
✗ Branch 17 → 75 not taken.
✗ Branch 18 → 19 not taken.
✓ Branch 18 → 20 taken 466 times.
466 assert(firstLine.rfind("//TEST:", 0) != 0);
37 if (firstLine.rfind("// TEST: ", 0) != 0) // GCOV_EXCL_LINE
38 return; // GCOV_EXCL_LINE
39
40 24 const size_t colonPos = firstLine.find(':');
41
1/2
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 26 taken 24 times.
24 if (colonPos == std::string::npos)
42 return;
43
44
2/4
✓ Branch 26 → 27 taken 24 times.
✗ Branch 26 → 66 not taken.
✓ Branch 27 → 28 taken 24 times.
✗ Branch 27 → 64 not taken.
24 const std::string argString = CommonUtil::trim(firstLine.substr(colonPos + 1));
45
3/4
✓ Branch 29 → 30 taken 24 times.
✗ Branch 29 → 72 not taken.
✓ Branch 48 → 32 taken 58 times.
✓ Branch 48 → 49 taken 24 times.
106 for (const std::string &arg : CommonUtil::split(argString)) {
46
1/2
✓ Branch 34 → 35 taken 58 times.
✗ Branch 34 → 69 not taken.
58 const std::string trimmedArg = CommonUtil::trim(arg);
47
1/2
✓ Branch 36 → 37 taken 58 times.
✗ Branch 36 → 38 not taken.
58 if (!trimmedArg.empty())
48
1/2
✓ Branch 37 → 38 taken 58 times.
✗ Branch 37 → 67 not taken.
58 args.push_back(trimmedArg);
49 58 }
50
4/4
✓ Branch 53 → 54 taken 24 times.
✓ Branch 53 → 55 taken 443 times.
✓ Branch 58 → 59 taken 24 times.
✓ Branch 58 → 61 taken 443 times.
934 }
51
52 /**
53 * Collect the test cases in a particular test suite
54 *
55 * @param suiteName Name of the test suite
56 * @param useSubDirs Use subdirectories as test cases
57 * @return Vector of tests cases
58 */
59 10 std::vector<TestCase> TestUtil::collectTestCases(const char *suiteName, bool useSubDirs) {
60
3/6
✓ Branch 2 → 3 taken 10 times.
✗ Branch 2 → 111 not taken.
✓ Branch 3 → 4 taken 10 times.
✗ Branch 3 → 108 not taken.
✓ Branch 4 → 5 taken 10 times.
✗ Branch 4 → 106 not taken.
10 const std::filesystem::path suitePath = std::filesystem::path(PATH_TEST_FILES) / suiteName;
61
62 10 std::vector<TestCase> testCases;
63
1/2
✓ Branch 7 → 8 taken 10 times.
✗ Branch 7 → 171 not taken.
10 testCases.reserve(EXPECTED_NUMBER_OF_TESTS);
64
65
2/2
✓ Branch 8 → 9 taken 4 times.
✓ Branch 8 → 63 taken 6 times.
10 if (useSubDirs) {
66 // Collect subdirectories of the given suite
67
1/2
✓ Branch 9 → 10 taken 4 times.
✗ Branch 9 → 144 not taken.
4 const std::vector<std::string> testGroupDirs = getSubdirs(suitePath);
68
69 // Convert them to test cases
70
2/2
✓ Branch 60 → 12 taken 85 times.
✓ Branch 60 → 61 taken 4 times.
93 for (const std::string &groupDirName : testGroupDirs) {
71
2/4
✓ Branch 14 → 15 taken 85 times.
✗ Branch 14 → 114 not taken.
✓ Branch 15 → 16 taken 85 times.
✗ Branch 15 → 112 not taken.
85 const std::filesystem::path groupPath = suitePath / groupDirName;
72
3/4
✓ Branch 17 → 18 taken 85 times.
✗ Branch 17 → 137 not taken.
✓ Branch 48 → 20 taken 433 times.
✓ Branch 48 → 49 taken 85 times.
603 for (const std::string &caseDirName : getSubdirs(groupPath)) {
73
2/4
✓ Branch 22 → 23 taken 433 times.
✗ Branch 22 → 117 not taken.
✓ Branch 23 → 24 taken 433 times.
✗ Branch 23 → 115 not taken.
433 const std::filesystem::path testPath = groupPath / caseDirName;
74
7/18
✓ Branch 25 → 26 taken 433 times.
✗ Branch 25 → 129 not taken.
✓ Branch 26 → 27 taken 433 times.
✗ Branch 26 → 127 not taken.
✓ Branch 27 → 28 taken 433 times.
✗ Branch 27 → 123 not taken.
✓ Branch 28 → 29 taken 433 times.
✗ Branch 28 → 121 not taken.
✓ Branch 29 → 30 taken 433 times.
✗ Branch 29 → 118 not taken.
✗ Branch 30 → 31 not taken.
✓ Branch 30 → 32 taken 433 times.
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 35 taken 433 times.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 126 not taken.
433 const TestCase tc = {toCamelCase(groupDirName), toCamelCase(caseDirName), testPath};
75
1/2
✓ Branch 36 → 37 taken 433 times.
✗ Branch 36 → 130 not taken.
433 testCases.push_back(tc);
76 433 }
77 85 }
78 4 } else {
79 // Collect test cases
80
3/4
✓ Branch 63 → 64 taken 6 times.
✗ Branch 63 → 170 not taken.
✓ Branch 97 → 66 taken 38 times.
✓ Branch 97 → 98 taken 6 times.
50 for (const std::string &caseDirName : getSubdirs(suitePath)) {
81
2/4
✓ Branch 68 → 69 taken 38 times.
✗ Branch 68 → 147 not taken.
✓ Branch 69 → 70 taken 38 times.
✗ Branch 69 → 145 not taken.
38 const std::filesystem::path testPath = suitePath / caseDirName;
82
7/18
✓ Branch 73 → 74 taken 38 times.
✗ Branch 73 → 159 not taken.
✓ Branch 74 → 75 taken 38 times.
✗ Branch 74 → 157 not taken.
✓ Branch 75 → 76 taken 38 times.
✗ Branch 75 → 153 not taken.
✓ Branch 76 → 77 taken 38 times.
✗ Branch 76 → 151 not taken.
✓ Branch 77 → 78 taken 38 times.
✗ Branch 77 → 148 not taken.
✗ Branch 78 → 79 not taken.
✓ Branch 78 → 80 taken 38 times.
✗ Branch 81 → 82 not taken.
✓ Branch 81 → 83 taken 38 times.
✗ Branch 148 → 149 not taken.
✗ Branch 148 → 150 not taken.
✗ Branch 154 → 155 not taken.
✗ Branch 154 → 156 not taken.
76 const TestCase tc = {toCamelCase(suiteName), toCamelCase(caseDirName), testPath};
83
1/2
✓ Branch 85 → 86 taken 38 times.
✗ Branch 85 → 163 not taken.
38 testCases.push_back(tc);
84 38 }
85 }
86
87
1/2
✗ Branch 101 → 102 not taken.
✓ Branch 101 → 103 taken 10 times.
10 assert(testCases.size() <= EXPECTED_NUMBER_OF_TESTS);
88 10 return testCases;
89 10 }
90
91 /**
92 * Check if the expected output matches the actual output
93 *
94 * @param originalRefPath Path to the reference file
95 * @param getActualOutput Callback to execute the required steps to get the actual test output
96 * @param modifyOutputFct Callback to modify the output before comparing it with the reference
97 * @param x86Only Only compare/update ref file on x86_64
98 *
99 * @return True, if the ref file was found
100 */
101 4632 bool TestUtil::checkRefMatch(const std::filesystem::path &originalRefPath, GetOutputFct getActualOutput,
102 ModifyOutputFct modifyOutputFct, [[maybe_unused]] bool x86Only) {
103
3/4
✓ Branch 2 → 3 taken 4632 times.
✗ Branch 2 → 64 not taken.
✓ Branch 40 → 4 taken 13881 times.
✓ Branch 40 → 41 taken 3952 times.
17833 for (const std::filesystem::path &refPath : expandRefPaths(originalRefPath)) {
104 if (testDriverCliOptions.isVerbose) // GCOV_EXCL_LINE
105 std::cout << "Checking for ref file: " << refPath << " - "; // GCOV_EXCL_LINE
106
3/4
✓ Branch 8 → 9 taken 13881 times.
✗ Branch 8 → 61 not taken.
✓ Branch 9 → 10 taken 13201 times.
✓ Branch 9 → 14 taken 680 times.
13881 if (!exists(refPath)) {
107 if (testDriverCliOptions.isVerbose) // GCOV_EXCL_LINE
108 std::cout << "not found" << std::endl; // GCOV_EXCL_LINE
109 13201 continue;
110 }
111 if (testDriverCliOptions.isVerbose) // GCOV_EXCL_LINE
112 std::cout << "ok" << std::endl; // GCOV_EXCL_LINE
113
114 // Get actual output
115
1/2
✓ Branch 17 → 18 taken 680 times.
✗ Branch 17 → 61 not taken.
680 std::string actualOutput = getActualOutput();
116
117 #ifndef ARCH_X86_64
118 // Cancel early, before comparing or updating the refs
119 if (x86Only && refPath == originalRefPath)
120 return true;
121 #endif
122
123 if (testDriverCliOptions.updateRefs) { // GCOV_EXCL_LINE
124 FileUtil::writeToFile(refPath, actualOutput); // GCOV_EXCL_LINE
125 } else {
126
1/2
✓ Branch 20 → 21 taken 680 times.
✗ Branch 20 → 58 not taken.
680 std::string expectedOutput = FileUtil::getFileContent(refPath);
127
1/2
✓ Branch 21 → 22 taken 680 times.
✗ Branch 21 → 56 not taken.
680 modifyOutputFct(expectedOutput, actualOutput);
128
2/14
✓ Branch 22 → 23 taken 680 times.
✗ Branch 22 → 55 not taken.
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 34 taken 680 times.
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 52 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 50 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 50 not taken.
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 49 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 47 not taken.
680 EXPECT_EQ(expectedOutput, actualOutput) << "Output does not match the reference file: " << refPath;
129 680 }
130 680 return true;
131 680 }
132 3952 return false;
133 }
134
135 /**
136 * Check if a variant of the requested ref file was found
137 *
138 * @param originalRefPath Path to the reference file
139 * @return True, if the ref file was found
140 */
141 1858 bool TestUtil::doesRefExist(const std::filesystem::path &originalRefPath) {
142
1/2
✓ Branch 2 → 3 taken 1858 times.
✗ Branch 2 → 10 not taken.
1858 const std::array<std::filesystem::path, 3> refPaths = expandRefPaths(originalRefPath);
143
1/2
✓ Branch 3 → 4 taken 1858 times.
✗ Branch 3 → 8 not taken.
9274 return std::ranges::any_of(refPaths, [](const std::filesystem::path &refPath) { return exists(refPath); });
144 1858 }
145
146 /**
147 * Handle a test error
148 *
149 * @param testCase Testcase which has produced the error
150 * @param error Exception with error message
151 */
152 190 void TestUtil::handleError(const TestCase &testCase, const std::exception &error) {
153
1/2
✓ Branch 5 → 6 taken 190 times.
✗ Branch 5 → 49 not taken.
570 std::string errorWhat = error.what();
154
3/6
✓ Branch 9 → 10 taken 190 times.
✗ Branch 9 → 60 not taken.
✓ Branch 12 → 13 taken 190 times.
✗ Branch 12 → 54 not taken.
✓ Branch 13 → 14 taken 190 times.
✗ Branch 13 → 52 not taken.
570 CommonUtil::replaceAll(errorWhat, "\\", "/");
155
156 // Fail if no ref file exists
157
2/4
✓ Branch 18 → 19 taken 190 times.
✗ Branch 18 → 66 not taken.
✓ Branch 19 → 20 taken 190 times.
✗ Branch 19 → 64 not taken.
190 const std::filesystem::path refPath = testCase.testPath / REF_NAME_ERROR_OUTPUT;
158 if (!doesRefExist(refPath)) // LCOV_EXCL_LINE
159 FAIL() << "Expected no error, but got: " + errorWhat; // LCOV_EXCL_LINE
160
161 // Check if the exception message matches the expected output
162
1/2
✓ Branch 34 → 35 taken 190 times.
✗ Branch 34 → 76 not taken.
380 checkRefMatch(refPath, [&] { return errorWhat; });
163
2/4
✓ Branch 39 → 40 taken 190 times.
✗ Branch 39 → 41 not taken.
✓ Branch 44 → 45 taken 190 times.
✗ Branch 44 → 47 not taken.
380 }
164
165 /**
166 * Get subdirectories of the given path
167 *
168 * @param basePath Path to a directory
169 * @return Vector of subdirs
170 */
171 95 std::vector<std::string> TestUtil::getSubdirs(const std::filesystem::path &basePath) {
172 95 std::vector<std::string> subdirs;
173
3/6
✓ Branch 2 → 3 taken 95 times.
✗ Branch 2 → 19 not taken.
✓ Branch 4 → 5 taken 95 times.
✗ Branch 4 → 17 not taken.
✓ Branch 6 → 7 taken 95 times.
✗ Branch 6 → 15 not taken.
95 if (DIR *dir = opendir(basePath.string().c_str()); dir != nullptr) {
174 dirent *ent;
175
3/4
✓ Branch 12 → 13 taken 841 times.
✗ Branch 12 → 20 not taken.
✓ Branch 13 → 8 taken 746 times.
✓ Branch 13 → 14 taken 95 times.
841 while ((ent = readdir(dir)) != nullptr) {
176
4/4
✓ Branch 8 → 9 taken 651 times.
✓ Branch 8 → 11 taken 95 times.
✓ Branch 9 → 10 taken 556 times.
✓ Branch 9 → 11 taken 95 times.
746 if (strcmp(ent->d_name, ".") != 0 && strcmp(ent->d_name, "..") != 0)
177
1/2
✓ Branch 10 → 11 taken 556 times.
✗ Branch 10 → 20 not taken.
556 subdirs.emplace_back(ent->d_name);
178 }
179
1/2
✓ Branch 14 → 15 taken 95 times.
✗ Branch 14 → 20 not taken.
95 closedir(dir);
180 }
181 95 return subdirs;
182 } // LCOV_EXCL_LINE - false positive
183
184 /**
185 * Retrieve the contents of a file as a vector of line strings. Empty lines are omitted
186 *
187 * @param filePath File path
188 * @return Vector of strings which are the lines of the file
189 */
190 2 std::vector<std::string> TestUtil::getFileContentLinesVector(const std::filesystem::path &filePath) {
191 2 std::vector<std::string> lines;
192
1/2
✓ Branch 2 → 3 taken 2 times.
✗ Branch 2 → 23 not taken.
2 std::ifstream inputFileStream;
193
1/2
✓ Branch 3 → 4 taken 2 times.
✗ Branch 3 → 21 not taken.
2 inputFileStream.open(filePath);
194
4/6
✓ Branch 11 → 12 taken 4 times.
✗ Branch 11 → 18 not taken.
✓ Branch 12 → 13 taken 4 times.
✗ Branch 12 → 18 not taken.
✓ Branch 13 → 5 taken 2 times.
✓ Branch 13 → 14 taken 2 times.
6 for (std::string line; std::getline(inputFileStream, line);) {
195
1/2
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 8 taken 2 times.
2 if (!line.empty())
196
1/2
✓ Branch 8 → 9 taken 2 times.
✗ Branch 8 → 18 not taken.
2 lines.push_back(line);
197 2 }
198 2 return lines;
199 2 }
200
201 /**
202 * Convert a string to camel case
203 *
204 * @param input Input string
205 * @return Camel-cased string
206 */
207 1884 std::string TestUtil::toCamelCase(std::string input) {
208
2/2
✓ Branch 31 → 3 taken 28602 times.
✓ Branch 31 → 32 taken 1884 times.
60972 for (auto it = input.begin(); it != input.end(); ++it) {
209
5/6
✓ Branch 5 → 6 taken 27229 times.
✓ Branch 5 → 9 taken 1373 times.
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 27229 times.
✓ Branch 11 → 12 taken 1373 times.
✓ Branch 11 → 21 taken 27229 times.
55831 if (*it == '-' || *it == '_') {
210
1/2
✓ Branch 15 → 16 taken 1373 times.
✗ Branch 15 → 34 not taken.
1373 it = input.erase(it);
211 2746 *it = static_cast<char>(toupper(*it));
212 }
213 }
214 1884 return input;
215 }
216
217 /**
218 * Check if the provided test case is disabled
219 *
220 * @param testCase Test case to check
221 * @return Disabled or not
222 */
223 471 bool TestUtil::isDisabled(const TestCase &testCase) {
224
5/8
✓ Branch 2 → 3 taken 471 times.
✗ Branch 2 → 57 not taken.
✓ Branch 3 → 4 taken 471 times.
✗ Branch 3 → 55 not taken.
✓ Branch 4 → 5 taken 471 times.
✗ Branch 4 → 53 not taken.
✓ Branch 7 → 8 taken 2 times.
✓ Branch 7 → 9 taken 469 times.
471 if (exists(testCase.testPath / CTL_SKIP_DISABLED))
225 2 return true;
226
10/20
✓ Branch 9 → 10 taken 469 times.
✗ Branch 9 → 15 not taken.
✓ Branch 10 → 11 taken 469 times.
✗ Branch 10 → 59 not taken.
✓ Branch 11 → 12 taken 469 times.
✗ Branch 11 → 59 not taken.
✓ Branch 12 → 13 taken 469 times.
✗ Branch 12 → 59 not taken.
✓ Branch 13 → 14 taken 1 time.
✓ Branch 13 → 15 taken 468 times.
✓ Branch 16 → 17 taken 469 times.
✗ Branch 16 → 18 not taken.
✓ Branch 18 → 19 taken 469 times.
✗ Branch 18 → 20 not taken.
✓ Branch 20 → 21 taken 1 time.
✓ Branch 20 → 22 taken 468 times.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 65 not taken.
469 if (testDriverCliOptions.isGitHubActions && exists(testCase.testPath / CTL_SKIP_GH))
227 1 return true;
228
1/2
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 51 taken 468 times.
468 if (testDriverCliOptions.skipSanitizerTests) {
229 std::vector<std::string> testArgs;
230 parseTestArgs(testCase.testPath / REF_NAME_SOURCE, testArgs);
231 for (const std::string &arg : testArgs)
232 if (arg.starts_with("--sanitizer"))
233 return true;
234 }
235 #ifdef OS_WINDOWS
236 if (exists(testCase.testPath / CTL_SKIP_WINDOWS))
237 return true;
238 #elifdef OS_MACOS
239 if (exists(testCase.testPath / CTL_SKIP_MACOS))
240 return true;
241 #endif
242 468 return false;
243 }
244
245 // LCOV_EXCL_START
246 /**
247 * Removes the first n lines of the GDB output to not compare target dependent code
248 *
249 * @param gdbOutput GDB output to modify
250 */
251 void TestUtil::eraseGDBHeader(std::string &gdbOutput) {
252 // Remove header
253 size_t pos = gdbOutput.find(GDB_READING_SYMBOLS_MESSAGE);
254 if (pos != std::string::npos) {
255 if (const size_t lineStart = gdbOutput.rfind('\n', pos); lineStart != std::string::npos)
256 gdbOutput.erase(0, lineStart + 1);
257 }
258
259 // Remove inferior message
260 pos = gdbOutput.find(GDB_INFERIOR_MESSAGE);
261 if (pos != std::string::npos)
262 gdbOutput.erase(pos);
263 }
264 // LCOV_EXCL_STOP
265
266 /**
267 * Remove lines, containing a certain substring to make the IR string comparable
268 *
269 * @param irCode IR code to modify
270 * @param needle Substring to search for
271 */
272 12 void TestUtil::eraseLinesBySubstring(std::string &irCode, const char *const needle) {
273 12 std::string::size_type pos = 0;
274
2/2
✓ Branch 12 → 3 taken 24 times.
✓ Branch 12 → 13 taken 12 times.
36 while ((pos = irCode.find(needle, pos)) != std::string::npos) {
275 // Find the start of the line that contains the substring
276 24 std::string::size_type lineStart = irCode.rfind('\n', pos);
277
1/2
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 24 times.
24 if (lineStart == std::string::npos)
278 lineStart = 0;
279 else
280 24 lineStart++; // move past the '\n'
281
282 // Find the end of the line that contains the substring
283 24 std::string::size_type lineEnd = irCode.find('\n', pos);
284
1/2
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 24 times.
24 if (lineEnd == std::string::npos)
285 lineEnd = irCode.length();
286
287 // Erase the line
288 24 irCode.erase(lineStart, lineEnd - lineStart);
289 }
290 12 }
291
292 6490 std::array<std::filesystem::path, 3> TestUtil::expandRefPaths(const std::filesystem::path &refPath) {
293
1/2
✓ Branch 2 → 3 taken 6490 times.
✗ Branch 2 → 83 not taken.
6490 const std::filesystem::path parent = refPath.parent_path();
294
2/4
✓ Branch 3 → 4 taken 6490 times.
✗ Branch 3 → 40 not taken.
✓ Branch 4 → 5 taken 6490 times.
✗ Branch 4 → 38 not taken.
6490 const std::string stem = refPath.stem().string();
295
2/4
✓ Branch 6 → 7 taken 6490 times.
✗ Branch 6 → 43 not taken.
✓ Branch 7 → 8 taken 6490 times.
✗ Branch 7 → 41 not taken.
6490 const std::string ext = refPath.extension().string();
296 // Construct array of files to search for
297
3/6
✓ Branch 9 → 10 taken 6490 times.
✗ Branch 9 → 48 not taken.
✓ Branch 10 → 11 taken 6490 times.
✗ Branch 10 → 46 not taken.
✓ Branch 11 → 12 taken 6490 times.
✗ Branch 11 → 44 not taken.
6490 const std::string osFileName = stem + "-" + SPICE_TARGET_OS + ext;
298
5/10
✓ Branch 14 → 15 taken 6490 times.
✗ Branch 14 → 58 not taken.
✓ Branch 15 → 16 taken 6490 times.
✗ Branch 15 → 56 not taken.
✓ Branch 16 → 17 taken 6490 times.
✗ Branch 16 → 54 not taken.
✓ Branch 17 → 18 taken 6490 times.
✗ Branch 17 → 52 not taken.
✓ Branch 18 → 19 taken 6490 times.
✗ Branch 18 → 50 not taken.
6490 const std::string osArchFileName = stem + "-" + SPICE_TARGET_OS + "-" + SPICE_TARGET_ARCH + ext;
299 12980 return {parent / osArchFileName, parent / osFileName, refPath};
300
5/14
✓ Branch 23 → 24 taken 6490 times.
✗ Branch 23 → 67 not taken.
✓ Branch 24 → 25 taken 6490 times.
✗ Branch 24 → 65 not taken.
✓ Branch 25 → 26 taken 6490 times.
✗ Branch 25 → 64 not taken.
✓ Branch 26 → 27 taken 6490 times.
✗ Branch 26 → 62 not taken.
✓ Branch 27 → 28 taken 6490 times.
✗ Branch 27 → 62 not taken.
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 72 not taken.
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 72 not taken.
12980 }
301
302 } // namespace spice::testing
303