summaryrefslogtreecommitdiff
path: root/testsuite/driver/testutil.py
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-12-02 14:24:32 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-05 16:07:49 -0500
commit8280bd8ab7a20a0a78ca53a06279cf8f07864eb5 (patch)
tree2f1813cf21754fea59f3fdc560ce5ee88c9ec70d /testsuite/driver/testutil.py
parent58a9c4295b9f457ca465415b7017f8e343d54339 (diff)
downloadhaskell-8280bd8ab7a20a0a78ca53a06279cf8f07864eb5.tar.gz
testsuite: Factor out terminal coloring
Diffstat (limited to 'testsuite/driver/testutil.py')
-rw-r--r--testsuite/driver/testutil.py11
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