aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-09 11:02:38 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-09 13:25:36 +0200
commite987a88c196e6d7026bdaedd53f284ea6a4e5720 (patch)
treee32faabb444515b4a335dc9e7c3cd4d00c58e1cd /run_project_tests.py
parent7fac515acf9515c60a60254ec3344a5a48461489 (diff)
downloadmeson-e987a88c196e6d7026bdaedd53f284ea6a4e5720.zip
meson-e987a88c196e6d7026bdaedd53f284ea6a4e5720.tar.gz
meson-e987a88c196e6d7026bdaedd53f284ea6a4e5720.tar.bz2
tests: Force colorize CI output
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 07431d4..af04f0a 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -273,6 +273,14 @@ backend: 'Backend'
backend_flags: T.List[str]
stop: bool = False
+is_worker_process: bool = False
+
+# Let's have colors in our CI output
+if under_ci:
+ def _ci_colorize_console() -> bool:
+ return not is_worker_process
+
+ mlog.colorize_console = _ci_colorize_console
class StopException(Exception):
def __init__(self) -> None:
@@ -574,6 +582,9 @@ def run_test(test: TestDef,
global compile_commands, clean_commands, test_commands, install_commands, uninstall_commands, backend, backend_flags, host_c_compiler
if state is not None:
compile_commands, clean_commands, test_commands, install_commands, uninstall_commands, backend, backend_flags, host_c_compiler = state
+ # Store that this is a worker process
+ global is_worker_process
+ is_worker_process = True
# Setup the test environment
assert not test.skip, 'Skipped thest should not be run'
build_dir = create_deterministic_builddir(test, use_tmp)
@@ -1210,6 +1221,7 @@ def _run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]],
# Ensure we only cancel once
tests_canceled = False
+ # Optionally enable the tqdm progress bar
global safe_print
futures_iter: T.Iterable[RunFutureUnion] = futures
try: