From 441fbdd064796fb412e35287a532d7fa98b6449e Mon Sep 17 00:00:00 2001 From: bgbsww Date: Wed, 31 Jul 2024 15:29:37 -0400 Subject: [PATCH] Add a command line option to keep application open after running tests --- src/App/Application.cpp | 7 +++++-- src/Gui/MainWindow.cpp | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 61291c85bd..f184029e5e 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -2217,6 +2217,7 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v ("user-cfg,u", value(),"User config file to load/save user settings") ("system-cfg,s", value(),"System config file to load/save system settings") ("run-test,t", value()->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()->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 >()->composing(),"Additional module paths") ("python-path,P", value< vector >()->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(); } - if (vm.count("run-test")) { - string testCase = vm["run-test"].as(); + if (vm.count("run-test") || vm.count("run-open")) { + string testCase = vm.count("run-open") ? vm["run-open"].as() : vm["run-test"].as(); + if ( "0" == testCase) { testCase = "TestApp.All"; } @@ -2452,6 +2454,7 @@ void processProgramOptions(const variables_map& vm, std::map