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
--- 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),
]
}