Change in osmo-ttcn3-hacks[master]: compare_results.py: use ansi colors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue May 19 19:25:36 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18368 )

Change subject: compare_results.py: use ansi colors
......................................................................

compare_results.py: use ansi colors

Change-Id: I2cfabc1364c53e6ee18b9471dcd7c681407d0473
---
M compare-results.py
1 file changed, 16 insertions(+), 7 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/compare-results.py b/compare-results.py
index 556a063..ff5004e 100755
--- a/compare-results.py
+++ b/compare-results.py
@@ -22,13 +22,22 @@
 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,

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18368
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2cfabc1364c53e6ee18b9471dcd7c681407d0473
Gerrit-Change-Number: 18368
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200519/20ea6528/attachment.htm>


More information about the gerrit-log mailing list