summaryrefslogtreecommitdiff
path: root/tools/util.py
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-05 06:52:31 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-04 11:52:31 -0800
commit4e07783663d51877e7d41465cf5ef10d1540c4b3 (patch)
treef02336f4f46e8330362f1409d1c298db50dcc98a /tools/util.py
parente93d686e9d5e797f7e4e02bda56a8b6d535326ca (diff)
Improve integration test harness (#1142)
Diffstat (limited to 'tools/util.py')
-rw-r--r--tools/util.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/util.py b/tools/util.py
index 306f2109f..dd80ab4bd 100644
--- a/tools/util.py
+++ b/tools/util.py
@@ -6,6 +6,10 @@ import stat
import sys
import subprocess
+RESET = "\x1b[0m"
+FG_RED = "\x1b[31m"
+FG_GREEN = "\x1b[32m"
+
executable_suffix = ".exe" if os.name == "nt" else ""
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
@@ -73,6 +77,14 @@ def shell_quote(arg):
return quote(arg)
+def red_failed():
+ return "%sFAILED%s" % (FG_RED, RESET)
+
+
+def green_ok():
+ return "%sok%s" % (FG_GREEN, RESET)
+
+
def remove_and_symlink(target, name, target_is_dir=False):
try:
# On Windows, directory symlink can only be removed with rmdir().