Skip to content

Commit

Permalink
test: Add colouring to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpnock committed Feb 21, 2024
1 parent 7593bfd commit bd4cbb5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ 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,
silent=True,
)

if return_code != 0:
print("Error when cleaning:", error_msg)
print(RED + "Error when cleaning:", error_msg + RESET)
return False
return True

Expand All @@ -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
Expand Down

0 comments on commit bd4cbb5

Please sign in to comment.