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_project_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_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 8cbf989..f636d63 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -341,19 +341,19 @@ def log_text_file(logfile, testdir, stdo, stde): def bold(text): - return mlog.bold(text).get_text(mlog.colorize_console) + return mlog.bold(text).get_text(mlog.colorize_console()) def green(text): - return mlog.green(text).get_text(mlog.colorize_console) + return mlog.green(text).get_text(mlog.colorize_console()) def red(text): - return mlog.red(text).get_text(mlog.colorize_console) + return mlog.red(text).get_text(mlog.colorize_console()) def yellow(text): - return mlog.yellow(text).get_text(mlog.colorize_console) + return mlog.yellow(text).get_text(mlog.colorize_console()) def _run_ci_include(args: T.List[str]) -> str: |