diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-12 00:03:51 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-04-30 20:11:31 +0100 |
commit | f107f9b3962167e1ff5014951aa89fdc176ea683 (patch) | |
tree | 91cb0b8387e26e1c9a507681031ea4f425390341 /run_tests.py | |
parent | cd566d2bd5f2f1faa3576b51b6b47c74a7ed0392 (diff) | |
download | meson-f107f9b3962167e1ff5014951aa89fdc176ea683.zip meson-f107f9b3962167e1ff5014951aa89fdc176ea683.tar.gz meson-f107f9b3962167e1ff5014951aa89fdc176ea683.tar.bz2 |
Make colourize_console() a function
Currently, colourize_console is a constant, set at process
initialization.
To allow the actual stdout to be easily compared with the expected when
running tests, we want to allow colourization to be on for the test
driver, but not for the in-process configure done by run_configure,
which has stdout redirected from a tty to a pipe.
v2:
Cache _colorize_console per file object
v3:
Reset cache on setup_console()
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/run_tests.py b/run_tests.py index 005d9a0..44dcf82 100755 --- a/run_tests.py +++ b/run_tests.py @@ -303,7 +303,7 @@ def run_configure(commandlist, env=None): return run_configure_inprocess(commandlist, env=env) def print_system_info(): - print(mlog.bold('System information.').get_text(mlog.colorize_console)) + print(mlog.bold('System information.').get_text(mlog.colorize_console())) print('Architecture:', platform.architecture()) print('Machine:', platform.machine()) print('Platform:', platform.system()) @@ -377,7 +377,7 @@ def main(): print(flush=True) returncode = 0 else: - print(mlog.bold('Running unittests.').get_text(mlog.colorize_console)) + print(mlog.bold('Running unittests.').get_text(mlog.colorize_console())) print(flush=True) cmd = mesonlib.python_command + ['run_unittests.py', '-v'] if options.failfast: @@ -390,7 +390,7 @@ def main(): else: cross_test_args = mesonlib.python_command + ['run_cross_test.py'] for cf in options.cross: - print(mlog.bold('Running {} cross tests.'.format(cf)).get_text(mlog.colorize_console)) + print(mlog.bold('Running {} cross tests.'.format(cf)).get_text(mlog.colorize_console())) print(flush=True) cmd = cross_test_args + ['cross/' + cf] if options.failfast: |