summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shubham Ajmera <shubhamajmera@google.com> 2017-03-24 15:16:20 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-03-24 15:16:21 +0000
commitfc01c0ff87170ac2da9fe981bacabdce078f563e (patch)
treeca1135c0b95e7ef10dd84a733f72c06769349c6d
parent0bbb750f6ff9a52bc4649995fc78ebea87e31dd1 (diff)
parent22499e227306852854e19dad3f4bcbc05acbfcdf (diff)
Merge "Testrunner: Print colored text only when printing on terminal"
-rwxr-xr-xtest/testrunner/testrunner.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py
index 9b9997004b..3203f7ad84 100755
--- a/test/testrunner/testrunner.py
+++ b/test/testrunner/testrunner.py
@@ -268,6 +268,16 @@ def setup_test_env():
global semaphore
semaphore = threading.Semaphore(n_thread)
+ if not sys.stdout.isatty():
+ global COLOR_ERROR
+ global COLOR_PASS
+ global COLOR_SKIP
+ global COLOR_NORMAL
+ COLOR_ERROR = ''
+ COLOR_PASS = ''
+ COLOR_SKIP = ''
+ COLOR_NORMAL = ''
+
def run_tests(tests):
"""Creates thread workers to run the tests.
@@ -912,6 +922,7 @@ def parse_option():
if options['gdb_arg']:
gdb_arg = options['gdb_arg']
timeout = options['timeout']
+
return test
def main():