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

Function main

tsn/src/test262/preprocessor/main.cpp:335–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335int main(int argc, const char* argv[]) {
336 fs::path testDirectory;
337 fs::path outputFile;
338
339 for (auto i = 1; i < argc; i++) {
340 string argument(argv[i]);
341
342 if (argument == "-t") {
343 testDirectory = argv[++i];
344 } else if (argument == "-o") {
345 outputFile = argv[++i];
346 } else {
347 TEST262_LOG(cerr, "Unrecognized argument: {}", argument);
348 return EXIT_FAILURE;
349 }
350 }
351
352 if (!fs::is_directory(testDirectory)) {
353 TEST262_LOG(cerr, "Specified tests directory({}) is not valid.", testDirectory);
354 return EXIT_FAILURE;
355 }
356 if (fs::exists(outputFile) && fs::is_directory(outputFile)) {
357 TEST262_LOG(cerr, "Specified output file ({}) exist and is a directory", outputFile);
358 return EXIT_FAILURE;
359 }
360
361 processTestDirectory(testDirectory, outputFile);
362
363 return EXIT_SUCCESS;
364}

Callers

nothing calls this directly

Calls 2

processTestDirectoryFunction · 0.85
existsFunction · 0.50

Tested by

no test coverage detected