diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-14 22:51:30 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-05-19 19:25:35 +0000 |
commit | b05d16fe8ece16d46f8ded2efcf300e9f4eb5a45 (patch) | |
tree | 922c58447bdd6151be367ca97e2570fdd5c22943 | |
parent | 6a99bf175cf4c64792a0cfe6f638b0103d1f040b (diff) |
compare_results.py: use ansi colors
Change-Id: I2cfabc1364c53e6ee18b9471dcd7c681407d0473
-rwxr-xr-x | compare-results.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/compare-results.py b/compare-results.py index 556a0631..ff5004ed 100755 --- a/compare-results.py +++ b/compare-results.py @@ -22,13 +22,22 @@ re_testcase = re.compile(r'''<testcase classname=['"]([^'"]+)['"].* name=['"]([^ re_testcase_end = re.compile(r'''(</testcase>|<testcase [^>]*/>)''') re_failure = re.compile(r'''(<failure\b|<error\b)''') -RESULT_PASS = 'pass' -RESULT_FAIL = 'pass->FAIL' -RESULT_SKIP = 'skip' -RESULT_XFAIL = 'xfail' -RESULT_FIXED = 'xfail->PASS' -RESULT_NEW_PASS = 'NEW: PASS' -RESULT_NEW_FAIL = 'NEW: FAIL' +RED = "\033[1;31m" +GREEN = "\033[1;32m" +YELLOW = "\033[1;33m" +BLUE = "\033[1;34m" +NOCOLOR = "\033[0;m" + +def col(color, text): + return color + text + NOCOLOR + +RESULT_PASS = col(GREEN, 'pass') +RESULT_FAIL = col(RED, 'pass->FAIL') +RESULT_SKIP = col(BLUE, 'skip') +RESULT_XFAIL = col(YELLOW, 'xfail') +RESULT_FIXED = col(GREEN, 'xfail->PASS') +RESULT_NEW_PASS = col(GREEN, 'NEW: PASS') +RESULT_NEW_FAIL = col(RED, 'NEW: FAIL') RESULTS = ( RESULT_FAIL, |