diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-12-02 14:24:32 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-05 16:07:49 -0500 |
commit | 8280bd8ab7a20a0a78ca53a06279cf8f07864eb5 (patch) | |
tree | 2f1813cf21754fea59f3fdc560ce5ee88c9ec70d /testsuite/driver/testutil.py | |
parent | 58a9c4295b9f457ca465415b7017f8e343d54339 (diff) | |
download | haskell-8280bd8ab7a20a0a78ca53a06279cf8f07864eb5.tar.gz |
testsuite: Factor out terminal coloring
Diffstat (limited to 'testsuite/driver/testutil.py')
-rw-r--r-- | testsuite/driver/testutil.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py index 071b641b7f..19cdbf3625 100644 --- a/testsuite/driver/testutil.py +++ b/testsuite/driver/testutil.py @@ -3,6 +3,7 @@ import platform import subprocess import shutil from pathlib import Path, PurePath +from term_color import Color, colored import threading @@ -37,17 +38,11 @@ def strip_quotes(s: str) -> str: # Don't wrap commands to subprocess.call/Popen in quotes. return s.strip('\'"') -def str_fail(s: str) -> str: - return '\033[1m\033[31m' + s + '\033[0m' - -def str_pass(s: str) -> str: - return '\033[1m\033[32m' + s + '\033[0m' - def str_warn(s: str) -> str: - return '\033[1m\033[33m' + s + '\033[0m' + return colored(Color.YELLOW, s) def str_info(s: str) -> str: - return '\033[1m\033[34m' + s + '\033[0m' + return colored(Color.BLUE, s) def getStdout(cmd_and_args: List[str]): # Can't use subprocess.check_output, since we also verify that |