From bd4cbb545d25d17c1db128ff5e677e5ad7b3f6ed Mon Sep 17 00:00:00 2001 From: James Nock Date: Wed, 21 Feb 2024 03:39:58 +0000 Subject: [PATCH] test: Add colouring to logs --- scripts/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/test.py b/scripts/test.py index 61b9df1..294c019 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -309,7 +309,7 @@ def clean() -> bool: Return True if successful, False otherwise """ - print("Cleaning project...") + print(GREEN + "Cleaning project..." + RESET) return_code, error_msg, _ = run_subprocess( cmd=["make", "-C", PROJECT_LOCATION, "clean"], timeout=BUILD_TIMEOUT_SECONDS, @@ -317,7 +317,7 @@ def clean() -> bool: ) if return_code != 0: - print("Error when cleaning:", error_msg) + print(RED + "Error when cleaning:", error_msg + RESET) return False return True @@ -327,19 +327,19 @@ def make(with_coverage: bool, silent: bool) -> bool: Return True if successful, False otherwise """ - print("Running make...") + print(GREEN + "Running make..." + RESET) cmd = ["make", "-C", PROJECT_LOCATION, "bin/c_compiler"] if with_coverage: # Run coverage if needed - print("Making with coverage...") + print(GREEN + "Making with coverage..." + RESET) shutil.rmtree(COVERAGE_FOLDER, ignore_errors=True) cmd = ["make", "-C", PROJECT_LOCATION, "with_coverage"] return_code, error_msg, _ = run_subprocess(cmd=cmd, timeout=BUILD_TIMEOUT_SECONDS, silent=silent) if return_code != 0: - print("Error when making:", error_msg) + print(RED + "Error when making:", error_msg + RESET) return False return True