From ab36c9760d19366a2f84abe73da21d0dca4bc9b5 Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Fri, 15 Jun 2018 09:57:02 +0200 Subject: [PATCH] TestSuite: Command line option for disabling the summary printout. --- test_suite/testSuite.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test_suite/testSuite.cxx b/test_suite/testSuite.cxx index 61a489e2b..fc13b98b4 100644 --- a/test_suite/testSuite.cxx +++ b/test_suite/testSuite.cxx @@ -83,7 +83,7 @@ int main(int argc, char **argv) // Declarations. int status_gui=-1, status_simgear=-1, status_system=-1, status_unit=-1; bool run_system=false, run_unit=false, run_gui=false, run_simgear=false; - bool verbose=false, ctest_output=false, debug=false, help=false; + bool verbose=false, ctest_output=false, debug=false, printSummary=true, help=false; char *subset_system=NULL, *subset_unit=NULL, *subset_gui=NULL, *subset_simgear=NULL; char firstchar; std::string fgRoot; @@ -130,6 +130,10 @@ int main(int argc, char **argv) } else if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "--debug") == 0) { debug = true; + // No summary output. + } else if (strcmp(argv[i], "--no-summary") == 0) { + printSummary = false; + // Help. } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { help = true; @@ -166,6 +170,7 @@ int main(int argc, char **argv) std::cout << " tests." << std::endl; std::cout << " -c, --ctest simplified output suitable for running via CTest." << std::endl; std::cout << " -d, --debug disable IO capture for debugging (super verbose output)." << std::endl; + std::cout << " --no-summary disable the final summary printout." << std::endl; std::cout << std::endl; std::cout << " FG options:" << std::endl; std::cout << " --fg-root the path to FGData" << std::endl; @@ -205,7 +210,7 @@ int main(int argc, char **argv) status_simgear = testRunner("Simgear unit tests", subset_simgear, verbose, ctest_output, debug); // Summary printout. - if (!ctest_output) + if (printSummary && !ctest_output) summary(cerr, status_system, status_unit, status_gui, status_simgear); // Deactivate the logging.