From 40d380b2b18eeadbe294fb5ff87f9aff5cc7daba Mon Sep 17 00:00:00 2001 From: Manuel Requena Date: Wed, 15 Aug 2018 14:02:21 -0700 Subject: [PATCH] test: (fixes #2949) Exit test.py if incorrect fullness option used --- src/core/model/test.cc | 10 ++++++++-- test.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/model/test.cc b/src/core/model/test.cc index bf8c4be58..d3550306c 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -955,7 +955,11 @@ TestRunnerImpl::Run (int argc, char *argv[]) fullness = arg + strlen("--fullness="); // Set the maximum test length allowed. - if (fullness == "EXTENSIVE") + if (fullness == "QUICK") + { + maximumTestDuration = TestCase::QUICK; + } + else if (fullness == "EXTENSIVE") { maximumTestDuration = TestCase::EXTENSIVE; } @@ -965,7 +969,9 @@ TestRunnerImpl::Run (int argc, char *argv[]) } else { - maximumTestDuration = TestCase::QUICK; + // Wrong fullness option + PrintHelp (progname); + return 3; } } else diff --git a/test.py b/test.py index 7b66a22a7..28b783278 100755 --- a/test.py +++ b/test.py @@ -1887,8 +1887,8 @@ def main(argv): parser.add_option("-u", "--update-data", action="store_true", dest="update_data", default=False, help="If examples use reference data files, get them to re-generate them") - parser.add_option("-f", "--fullness", action="store", type="string", dest="fullness", default="QUICK", - metavar="FULLNESS", + parser.add_option("-f", "--fullness", action="store", type="choice", dest="fullness", default="QUICK", + metavar="FULLNESS", choices=["QUICK", "EXTENSIVE", "TAKES_FOREVER"], help="choose the duration of tests to run: QUICK, EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE includes QUICK and TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK tests are run by default)") parser.add_option("-g", "--grind", action="store_true", dest="valgrind", default=False,