diff options
author | Hemmo Nieminen <hemmo.nieminen@iki.fi> | 2017-01-26 19:44:56 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-01-28 18:27:58 +0200 |
commit | 85304bd8cf74a958a81f0df74f3b81955ac247b4 (patch) | |
tree | 92de7f5983122b3e7c9d4eccdf972f197f6d7578 | |
parent | 0e078adf5a7d47d5ad168f75e39d4a044032b197 (diff) | |
download | meson-85304bd8cf74a958a81f0df74f3b81955ac247b4.zip meson-85304bd8cf74a958a81f0df74f3b81955ac247b4.tar.gz meson-85304bd8cf74a958a81f0df74f3b81955ac247b4.tar.bz2 |
[mesontest] Implement a quiet option.
Implement a quiet option that can be used to hide OK messages for
successful tests to better highlight the failing ones.
-rwxr-xr-x | mesontest.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesontest.py b/mesontest.py index 1a0c9b1..7d443c7 100755 --- a/mesontest.py +++ b/mesontest.py @@ -80,6 +80,8 @@ parser.add_argument('--num-processes', default=determine_worker_count(), type=in help='How many parallel processes to use.') 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, help='Define a multiplier for test timeout, for example ' ' when running tests in particular conditions they might take' @@ -284,7 +286,8 @@ class TestHarness: padding2 = ' ' * (8 - len(result.res)) result_str = '%s %s %s%s%s%5.2f s' % \ (num, name, padding1, result.res, padding2, result.duration) - print(result_str) + if not self.options.quiet or result.res != 'OK': + print(result_str) result_str += "\n\n" + result.get_log() if (result.returncode != GNU_SKIP_RETURNCODE) \ and (result.returncode != 0) != result.should_fail: @@ -549,6 +552,10 @@ def run(args): setattr(options, 'global_env', global_env) + if options.verbose and options.quiet: + print('Can not be both quiet and verbose at the same time.') + return 1 + if options.gdb: options.verbose = True if options.wrapper: |