From e9f9a42c7a5346f2f0e77b0dc8a73b4c4b1b2bc5 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 19 Feb 2017 04:44:36 +0530 Subject: mesontest: Don't run tests if no tests were selected The output is very confusing otherwise. Before it said 'No suitable tests defined' and then showed a list of tests that passed/failed. Now it will just say 'No suitable tests defined' and exit. --- mesontest.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mesontest.py') diff --git a/mesontest.py b/mesontest.py index 3545ed8..ff6baa1 100755 --- a/mesontest.py +++ b/mesontest.py @@ -519,6 +519,8 @@ TIMEOUT: %4d if os.path.isfile('build.ninja'): subprocess.check_call([environment.detect_ninja(), 'all']) tests = self.get_tests() + if not tests: + return 0 self.run_tests(tests) return self.fail_count -- cgit v1.1 From 5bf4338913bddebfe29508a796c92da5b4e1249e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 19 Feb 2017 05:44:34 +0530 Subject: mesontest: Use test setup name in logfiles When using a setup, use the setup name as the namebase for the logfile instead of the wrapper. The wrapper may not be set, or it may be shared between test setups. Also don't try to use the wrapper if it's an empty list. Closes https://github.com/mesonbuild/meson/issues/1371 --- mesontest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mesontest.py') diff --git a/mesontest.py b/mesontest.py index ff6baa1..cf8376f 100755 --- a/mesontest.py +++ b/mesontest.py @@ -415,15 +415,18 @@ TIMEOUT: %4d if not self.options.logbase or self.options.verbose: return None, None, None, None + namebase = None logfile_base = os.path.join(self.options.wd, 'meson-logs', self.options.logbase) - if self.options.wrapper is None: - logfilename = logfile_base + '.txt' - jsonlogfilename = logfile_base + '.json' - else: + if self.options.wrapper: namebase = os.path.split(self.get_wrapper()[0])[1] - logfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.txt' - jsonlogfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.json' + elif self.options.setup: + namebase = self.options.setup + + if namebase: + logfile_base += '-' + namebase.replace(' ', '_') + logfilename = logfile_base + '.txt' + jsonlogfilename = logfile_base + '.json' jsonlogfile = open(jsonlogfilename, 'w') logfile = open(logfilename, 'w') -- cgit v1.1 From 06d615611bd21a33363a9a907c31f018bd3e057c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 19 Feb 2017 05:46:36 +0530 Subject: mesontest: Use setup timeout multiplier if not specified The setup's timeout multiplier will always be set, and it will default to 1.0, so just use that. Without this, the setup's timeout multiplier was always ignored. --- mesontest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mesontest.py') diff --git a/mesontest.py b/mesontest.py index cf8376f..57c364b 100755 --- a/mesontest.py +++ b/mesontest.py @@ -83,7 +83,7 @@ parser.add_argument('-v', '--verbose', default=False, action='store_true', help='Do not redirect stdout and stderr') parser.add_argument('-q', '--quiet', default=False, action='store_true', help='Produce less output to the terminal.') -parser.add_argument('-t', '--timeout-multiplier', type=float, default=1.0, +parser.add_argument('-t', '--timeout-multiplier', type=float, default=None, help='Define a multiplier for test timeout, for example ' ' when running tests in particular conditions they might take' ' more time to execute.') @@ -563,6 +563,8 @@ def run(args): global_env = merge_suite_options(options) else: global_env = build.EnvironmentVariables() + if options.timeout_multiplier is None: + options.timeout_multiplier = 1 setattr(options, 'global_env', global_env) -- cgit v1.1