|
4 | 4 | name: UnitTesting Test Result |
5 | 5 | scope: text.test-result |
6 | 6 | hidden: true |
| 7 | + |
7 | 8 | contexts: |
8 | 9 | main: |
9 | | - |
10 | | - # verbosity <= 1 |
11 | | - - match: '(?=^[\\.sEF]+$)' |
| 10 | + # test progress (verbosity <= 1) |
| 11 | + - match: ^(?=[\\.sxEF]+$) |
12 | 12 | push: |
13 | 13 | - match: $ |
14 | 14 | pop: true |
15 | | - - match: s |
16 | | - scope: markup.changed |
| 15 | + - match: s|x |
| 16 | + scope: markup.changed.test-result |
17 | 17 | - match: E|F |
18 | | - scope: markup.deleted |
| 18 | + scope: markup.deleted.test-result |
19 | 19 |
|
20 | | - # verbosity >= 2 |
21 | | - - match: .+(\.\.\.) |
| 20 | + # test progress (verbosity >= 2) |
| 21 | + - match: ^(.+) (\()(.+)(\.)(.+)(\)) (\.\.\.) |
22 | 22 | 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 |
24 | 30 | push: |
25 | 31 | - match: $ |
26 | 32 | 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 |
36 | 41 |
|
37 | | - - match: ^FAILED.* |
38 | | - scope: markup.deleted |
| 42 | + - match: ^(?=={70,}|-{70,}) |
| 43 | + set: test-results |
39 | 44 |
|
40 | | - - match: '======================================================================' |
41 | | - scope: markup.ignored |
| 45 | + test-results: |
| 46 | + # traceback headers |
| 47 | + - match: ^={70,} |
| 48 | + scope: punctuation.separator.test-result |
42 | 49 | push: |
43 | | - - match: '----------------------------------------------------------------------' |
44 | | - scope: markup.ignored |
| 50 | + - match: -{70,} |
| 51 | + scope: punctuation.separator.test-result |
45 | 52 | pop: true |
46 | | - - match: ^ERROR|FAIL |
| 53 | + - match: ^(?:ERROR|FAIL)\b |
47 | 54 | scope: markup.deleted |
48 | 55 |
|
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 |
51 | 62 |
|
52 | | - - include: scope:source.diff |
| 63 | + # separators |
| 64 | + - match: ^-{10,}$ |
| 65 | + scope: punctuation.separator.test-result |
53 | 66 |
|
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 |
59 | 74 |
|
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