MCPcopy Create free account
hub / github.com/Snapchat/Valdi / main

Function main

tsn/src/test262/runner/main.cpp:303–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303int main(int argc, const char* argv[]) {
304 fs::path testCaseFile;
305 fs::path harnessDirectory;
306 fs::path outputFile = std::getenv("XML_OUTPUT_FILE");
307 fs::path skipListFile;
308
309 for (auto i = 1; i < argc; i++) {
310 string argument(argv[i]);
311
312 if (argument == "-t") {
313 testCaseFile = argv[++i];
314 } else if (argument == "-h") {
315 harnessDirectory = argv[++i];
316 } else if (argument == "-s") {
317 skipListFile = argv[++i];
318 } else {
319 TEST262_LOG(cerr, "Unrecognized argument: {}", argument);
320 return EXIT_FAILURE;
321 }
322 }
323 harnessDirectory /= "harness";
324
325 if (!fs::exists(skipListFile)) {
326 TEST262_LOG(cerr, "Specified skiplist ({}) does not exist", harnessDirectory);
327 return EXIT_FAILURE;
328 }
329 if (!fs::is_directory(harnessDirectory)) {
330 TEST262_LOG(cerr, "Specified tests directory({}) is not valid.", harnessDirectory);
331 return EXIT_FAILURE;
332 }
333 if ((fs::exists(outputFile) && fs::is_directory(outputFile)) || outputFile == "") {
334 TEST262_LOG(cerr, "Specified output file ({}) exist and is a directory", outputFile);
335 return EXIT_FAILURE;
336 }
337 if (!fs::exists(testCaseFile) || fs::is_directory(testCaseFile)) {
338 TEST262_LOG(cerr, "Specified test case file ({}) does not exist or is a directory", testCaseFile);
339 return EXIT_FAILURE;
340 }
341
342 return runTestCases(harnessDirectory, testCaseFile, outputFile, skipListFile) ? EXIT_SUCCESS : EXIT_FAILURE;
343}

Callers

nothing calls this directly

Calls 2

runTestCasesFunction · 0.85
existsFunction · 0.50

Tested by

no test coverage detected