testrunner: on error, color the "(case xxx)" part the same as filename
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 01 Feb 2018 08:17:11 -0800
changeset 35888 8a7140ec4c89
parent 35887 fd21b87e59b2
child 35889 5cfdf6137af8
testrunner: on error, color the "(case xxx)" part the same as filename When using #testcases, the lines that read something like ERROR: test-split.t (case obsstore-off) output changed get colored red and the filename gets highlighted with a brighter red. This makes it harder to notice the "case obsstore-off" part, but it does seem important, so let's highlight it. Differential Revision: https://phab.mercurial-scm.org/D1959
tests/run-tests.py
--- a/tests/run-tests.py	Thu Jan 18 10:08:23 2018 -0500
+++ b/tests/run-tests.py	Thu Feb 01 08:17:11 2018 -0800
@@ -120,6 +120,7 @@
         }
 
     class TestRunnerLexer(lexer.RegexLexer):
+        testpattern = r'[\w-]+\.(t|py)( \(case [\w-]+\))?'
         tokens = {
             'root': [
                 (r'^Skipped', token.Generic.Skipped, 'skipped'),
@@ -127,11 +128,11 @@
                 (r'^ERROR: ', token.Generic.Failed, 'failed'),
             ],
             'skipped': [
-                (r'[\w-]+\.(t|py)', token.Generic.SName),
+                (testpattern, token.Generic.SName),
                 (r':.*', token.Generic.Skipped),
             ],
             'failed': [
-                (r'[\w-]+\.(t|py)', token.Generic.FName),
+                (testpattern, token.Generic.FName),
                 (r'(:| ).*', token.Generic.Failed),
             ]
         }