MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / runMain

Function runMain

Source/Tools/FalcorTest/FalcorTest.cpp:40–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38using namespace Falcor;
39
40FALCOR_EXPORT_D3D12_AGILITY_SDK
41
42int runMain(int argc, char** argv)
43{
44 args::ArgumentParser parser("Falcor unit tests.");
45 parser.helpParams.programName = "FalcorTest";
46 args::HelpFlag helpFlag(parser, "help", "Display this help menu.", {'h', "help"});
47 args::ValueFlag<uint32_t> parallelFlag(parser, "N", "EXPERIMENTAL: Number of worker threads (default: 1).", {'p', "parallel"});
48 args::ValueFlag<std::string> deviceTypeFlag(parser, "d3d12|vulkan", "Graphics device type.", {'d', "device-type"});
49 args::Flag listGPUsFlag(parser, "", "List available GPUs", {"list-gpus"});
50 args::ValueFlag<uint32_t> gpuFlag(parser, "index", "Select specific GPU to use", {"gpu"});
51 args::Flag listTestSuites(parser, "", "List test suites", {"list-test-suites"});
52 args::Flag listTestCases(parser, "", "List test cases", {"list-test-cases"});
53 args::Flag listTags(parser, "", "List tags", {"list-tags"});
54 args::ValueFlag<std::string> testSuiteFilterFlag(parser, "regex", "Filter test suites to run.", {'s', "test-suite"});
55 args::ValueFlag<std::string> testCaseFilterFlag(parser, "regex", "Filter test cases to run.", {'f', "test-case"});
56 args::ValueFlag<std::string> tagFilterFlag(parser, "tags", "Filter test cases by tags.", {'t', "tags"});
57 args::ValueFlag<std::string> xmlReportFlag(parser, "path", "XML report output file.", {'x', "xml-report"});
58 args::ValueFlag<uint32_t> repeatFlag(parser, "N", "Number of times to repeat the test.", {'r', "repeat"});
59 args::Flag enableDebugLayerFlag(parser, "", "Enable debug layer (enabled by default in Debug build).", {"enable-debug-layer"});
60 args::Flag enableAftermathFlag(parser, "", "Enable Aftermath GPU crash dump.", {"enable-aftermath"});
61
62 args::CompletionFlag completionFlag(parser, {"complete"});
63
64 try
65 {
66 parser.ParseCLI(argc, argv);
67 }
68 catch (const args::Completion& e)
69 {
70 std::cout << e.what();
71 return 0;
72 }
73 catch (const args::Help&)
74 {
75 std::cout << parser;
76 return 0;
77 }
78 catch (const args::ParseError& e)
79 {
80 std::cerr << e.what() << std::endl;
81 std::cerr << parser;
82 return 1;
83 }
84 catch (const args::RequiredError& e)
85 {
86 std::cerr << e.what() << std::endl;
87 std::cerr << parser;
88 return 1;
89 }
90
91 unittest::RunOptions options;
92
93 if (deviceTypeFlag)
94 {
95 if (args::get(deviceTypeFlag) == "d3d12")
96 options.deviceDesc.type = Device::Type::D3D12;
97 else if (args::get(deviceTypeFlag) == "vulkan")

Callers 1

mainFunction · 0.70

Calls 9

enumerateTestsFunction · 0.85
filterTestsFunction · 0.85
setErrorDiagnosticFlagsFunction · 0.85
getErrorDiagnosticFlagsFunction · 0.85
runTestsFunction · 0.85
whatMethod · 0.80
getFunction · 0.50
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected