Skip to content

Commit d8591c1

Browse files
committed
Improve test result output syntax
1 parent 4238294 commit d8591c1

1 file changed

Lines changed: 55 additions & 35 deletions

File tree

res/unit-testing-test-result.sublime-syntax

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,78 @@
44
name: UnitTesting Test Result
55
scope: text.test-result
66
hidden: true
7+
78
contexts:
89
main:
9-
10-
# verbosity <= 1
11-
- match: '(?=^[\\.sEF]+$)'
10+
# test progress (verbosity <= 1)
11+
- match: ^(?=[\\.sxEF]+$)
1212
push:
1313
- match: $
1414
pop: true
15-
- match: s
16-
scope: markup.changed
15+
- match: s|x
16+
scope: markup.changed.test-result
1717
- match: E|F
18-
scope: markup.deleted
18+
scope: markup.deleted.test-result
1919

20-
# verbosity >= 2
21-
- match: .+(\.\.\.)
20+
# test progress (verbosity >= 2)
21+
- match: ^(.+) (\()(.+)(\.)(.+)(\)) (\.\.\.)
2222
captures:
23-
1: markup.ignored
23+
1: variable.function.test.test-result
24+
2: punctuation.section.parens.begin.test-result
25+
3: variable.namespace.test-result
26+
4: punctuation.accessor.dot.test-result
27+
5: support.class.testcase.test-result
28+
6: punctuation.section.parens.end.test-result
29+
7: punctuation.separator.test-result
2430
push:
2531
- match: $
2632
pop: true
27-
- match: ok
28-
scope: markup.inserted
29-
- match: ERROR|FAIL
30-
scope: markup.deleted
31-
- match: "skipped.*"
32-
scope: markup.changed
33-
34-
- match: ^OK.*
35-
scope: markup.inserted
33+
- match: \b(?:ok|expected failure)\b
34+
scope: markup.inserted.test-result
35+
- match: \b(?:ERROR|FAIL)\b
36+
scope: markup.deleted.test-result
37+
- match: \bskipped\b(.*)
38+
scope: markup.changed.test-result
39+
captures:
40+
1: comment.skip-reason.test-result
3641

37-
- match: ^FAILED.*
38-
scope: markup.deleted
42+
- match: ^(?=={70,}|-{70,})
43+
set: test-results
3944

40-
- match: '======================================================================'
41-
scope: markup.ignored
45+
test-results:
46+
# traceback headers
47+
- match: ^={70,}
48+
scope: punctuation.separator.test-result
4249
push:
43-
- match: '----------------------------------------------------------------------'
44-
scope: markup.ignored
50+
- match: -{70,}
51+
scope: punctuation.separator.test-result
4552
pop: true
46-
- match: ^ERROR|FAIL
53+
- match: ^(?:ERROR|FAIL)\b
4754
scope: markup.deleted
4855

49-
- match: ^----------------------------------------------------------------------$
50-
scope: markup.ignored
56+
# traceback route
57+
- match: File "(.*)"(?:, line ([0-9]+)(?:, in (.*))?)?
58+
captures:
59+
1: markup.underline.link.test-result
60+
2: constant.numeric.test-result
61+
3: variable.function.test-result
5162

52-
- include: scope:source.diff
63+
# separators
64+
- match: ^-{10,}$
65+
scope: punctuation.separator.test-result
5366

54-
- match: 'File "(.*)"(?:, line ([0-9]+)(?:, in (.*))?)?'
55-
captures:
56-
1: markup.underline.link
57-
2: constant.numeric
58-
3: entity.name
67+
# testrun results
68+
- match: ^OK\b.*
69+
scope: markup.inserted.test-result
70+
- match: ^FAILED\b.*
71+
scope: markup.deleted.test-result
72+
- match: ^UnitTesting\b.*
73+
scope: markup.ignored.test-result
5974

60-
- match: ^UnitTesting.*
61-
scope: markup.ignored
75+
# coverage report
76+
- match: ^Name {3,}Stmts +Miss +Cover$
77+
scope: keyword.other.header.coverage.test-result
78+
- match: ^TOTAL {3,}\d+ +\d+ +\d+%$
79+
scope: keyword.other.footer.coverage.test-result
80+
81+
- include: scope:source.diff

0 commit comments

Comments
 (0)