mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Display the demos UI if argv[1] isn't a valid test
This commit is contained in:
committed by
Baldur Karlsson
parent
9b72d79c06
commit
1dc4d5b15e
@@ -328,14 +328,28 @@ Usage: %s Test_Name [test_options]
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string testchoice;
|
||||
// Check if the first arg is a valid test name. If it isn't,
|
||||
// allow the UI to appear, so that flags can be used with the UI
|
||||
bool validTestArg = false;
|
||||
if(argc >= 2)
|
||||
{
|
||||
for(const TestMetadata &test : tests)
|
||||
{
|
||||
if(!strcmp(test.Name, argv[1]))
|
||||
{
|
||||
validTestArg = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string testchoice;
|
||||
if(tests.size() == 1)
|
||||
{
|
||||
// if there's only one test we've probably hardcoded this for a repro. Launch it
|
||||
testchoice = tests[0].Name;
|
||||
}
|
||||
else if(argc >= 2)
|
||||
else if(validTestArg)
|
||||
{
|
||||
testchoice = argv[1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user