aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-02-12 00:03:51 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2020-04-30 20:11:31 +0100
commitf107f9b3962167e1ff5014951aa89fdc176ea683 (patch)
tree91cb0b8387e26e1c9a507681031ea4f425390341 /run_project_tests.py
parentcd566d2bd5f2f1faa3576b51b6b47c74a7ed0392 (diff)
downloadmeson-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-xrun_project_tests.py8
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: