comparison tests/run-tests.py @ 35848:8a7140ec4c89

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
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 01 Feb 2018 08:17:11 -0800
parents 4be991331a46
children 568917059243
comparison
equal deleted inserted replaced
35847:fd21b87e59b2 35848:8a7140ec4c89
118 failed: '#7f0000', 118 failed: '#7f0000',
119 failedname: '#ff0000', 119 failedname: '#ff0000',
120 } 120 }
121 121
122 class TestRunnerLexer(lexer.RegexLexer): 122 class TestRunnerLexer(lexer.RegexLexer):
123 testpattern = r'[\w-]+\.(t|py)( \(case [\w-]+\))?'
123 tokens = { 124 tokens = {
124 'root': [ 125 'root': [
125 (r'^Skipped', token.Generic.Skipped, 'skipped'), 126 (r'^Skipped', token.Generic.Skipped, 'skipped'),
126 (r'^Failed ', token.Generic.Failed, 'failed'), 127 (r'^Failed ', token.Generic.Failed, 'failed'),
127 (r'^ERROR: ', token.Generic.Failed, 'failed'), 128 (r'^ERROR: ', token.Generic.Failed, 'failed'),
128 ], 129 ],
129 'skipped': [ 130 'skipped': [
130 (r'[\w-]+\.(t|py)', token.Generic.SName), 131 (testpattern, token.Generic.SName),
131 (r':.*', token.Generic.Skipped), 132 (r':.*', token.Generic.Skipped),
132 ], 133 ],
133 'failed': [ 134 'failed': [
134 (r'[\w-]+\.(t|py)', token.Generic.FName), 135 (testpattern, token.Generic.FName),
135 (r'(:| ).*', token.Generic.Failed), 136 (r'(:| ).*', token.Generic.Failed),
136 ] 137 ]
137 } 138 }
138 139
139 runnerformatter = formatters.Terminal256Formatter(style=TestRunnerStyle) 140 runnerformatter = formatters.Terminal256Formatter(style=TestRunnerStyle)