Add a command line option to keep application open after running tests

This commit is contained in:
bgbsww
2024-07-31 15:29:37 -04:00
committed by Chris Hennes
parent abb362f83a
commit 441fbdd064
2 changed files with 11 additions and 5 deletions

View File

@@ -2217,6 +2217,7 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v
("user-cfg,u", value<string>(),"User config file to load/save user settings")
("system-cfg,s", value<string>(),"System config file to load/save system settings")
("run-test,t", value<string>()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.")
("run-open,r", value<string>()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.")
("module-path,M", value< vector<string> >()->composing(),"Additional module paths")
("python-path,P", value< vector<string> >()->composing(),"Additional python paths")
("single-instance", "Allow to run a single instance of the application")
@@ -2441,8 +2442,9 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
mConfig["SystemParameter"] = vm["system-cfg"].as<string>();
}
if (vm.count("run-test")) {
string testCase = vm["run-test"].as<string>();
if (vm.count("run-test") || vm.count("run-open")) {
string testCase = vm.count("run-open") ? vm["run-open"].as<string>() : vm["run-test"].as<string>();
if ( "0" == testCase) {
testCase = "TestApp.All";
}
@@ -2452,6 +2454,7 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
mConfig["TestCase"] = testCase;
mConfig["RunMode"] = "Internal";
mConfig["ScriptFileName"] = "FreeCADTest";
mConfig["ExitTests"] = vm.count("run-open") == 0 ? "yes" : "no";
}
if (vm.count("single-instance")) {