| 262 | } |
| 263 | |
| 264 | bool runTestCases(const fs::path& harnessDirectory, |
| 265 | const fs::path& testCaseFile, |
| 266 | const fs::path& outputFile, |
| 267 | const fs::path& skipListFile) { |
| 268 | const auto testCasesResult = deserializeTestCases(testCaseFile); |
| 269 | if (!testCasesResult) { |
| 270 | TEST262_LOG(cerr, "Failed to parse {} with error {}", testCaseFile, testCasesResult.error().getMessage()); |
| 271 | return false; |
| 272 | } |
| 273 | |
| 274 | const auto skipList = decodeSkipList(skipListFile); |
| 275 | const auto testCases = testCasesResult.value(); |
| 276 | |
| 277 | TestReporter reporter; |
| 278 | |
| 279 | for (const auto& testCase : testCases) { |
| 280 | const auto& metadata = testCase.second; |
| 281 | std::string test_contents; |
| 282 | |
| 283 | // NOTE(rjaber): This should be intentionally omitted by the preprocessor |
| 284 | if (metadata.isNegative && metadata.negativeType == "SyntaxError") { |
| 285 | TEST262_LOG(cerr, "Found invalid case in test cases {}", testCase.first); |
| 286 | return false; |
| 287 | } |
| 288 | |
| 289 | if (metadata.noStrict || metadata.raw) { |
| 290 | evaluateTestCase(skipList, harnessDirectory, testCase.first, metadata, false, reporter); |
| 291 | } else if (metadata.onlyStrict) { |
| 292 | evaluateTestCase(skipList, harnessDirectory, testCase.first, metadata, true, reporter); |
| 293 | } else { |
| 294 | evaluateTestCase(skipList, harnessDirectory, testCase.first, metadata, false, reporter); |
| 295 | evaluateTestCase(skipList, harnessDirectory, testCase.first, metadata, true, reporter); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | reporter.saveToFile(outputFile); |
| 300 | return !reporter.hasFailure(); |
| 301 | } |
| 302 | |
| 303 | int main(int argc, const char* argv[]) { |
| 304 | fs::path testCaseFile; |
no test coverage detected