Skip to content

Commit 25b8b03

Browse files
committed
[testing] processing subtests output
1 parent f2893c8 commit 25b8b03

File tree

5 files changed

+134
-10
lines changed

5 files changed

+134
-10
lines changed

src/com/goide/runconfig/testing/frameworks/gotest/GotestEventsConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import java.util.regex.Pattern;
2828

2929
public class GotestEventsConverter extends GoTestEventsConverterBaseImpl {
30-
private static final Pattern RUN = Pattern.compile("^=== RUN\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
31-
private static final Pattern PASSED = Pattern.compile("--- PASS:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
32-
private static final Pattern SKIP = Pattern.compile("--- SKIP:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
33-
private static final Pattern FAILED = Pattern.compile("--- FAIL:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
30+
private static final Pattern RUN = Pattern.compile("^=== RUN\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
31+
private static final Pattern PASSED = Pattern.compile("--- PASS:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
32+
private static final Pattern SKIP = Pattern.compile("--- SKIP:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
33+
private static final Pattern FAILED = Pattern.compile("--- FAIL:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
3434
private static final Pattern FINISHED = Pattern.compile("^(PASS)|(FAIL)$");
3535

3636
public GotestEventsConverter(@NotNull TestConsoleProperties consoleProperties) {
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
TestStarted
2+
- locationHint=gotest://TestFoo
3+
- name=TestFoo
4+
TestStarted
5+
- locationHint=gotest://TestFoo/k[h]kjh_khk_jh
6+
- name=TestFoo/k[h]kjh_khk_jh
7+
TestStarted
8+
- locationHint=gotest://TestFoo/#00
9+
- name=TestFoo/#00
10+
TestStarted
11+
- locationHint=gotest://TestFoo/#00#01
12+
- name=TestFoo/#00#01
13+
TestStarted
14+
- locationHint=gotest://TestFoo/#01
15+
- name=TestFoo/#01
16+
TestStarted
17+
- locationHint=gotest://TestFoo/Bar
18+
- name=TestFoo/Bar
19+
TestStarted
20+
- locationHint=gotest://TestFoo/Bar/Buzz2
21+
- name=TestFoo/Bar/Buzz2
22+
TestStarted
23+
- locationHint=gotest://TestFoo/Bar/Buzz2#01
24+
- name=TestFoo/Bar/Buzz2#01
25+
TestStarted
26+
- locationHint=gotest://TestFoo/Bar#01
27+
- name=TestFoo/Bar#01
28+
TestStarted
29+
- locationHint=gotest://TestFoo/Bar#01/Buzz2
30+
- name=TestFoo/Bar#01/Buzz2
31+
TestStarted
32+
- locationHint=gotest://TestFoo/Bar#01/Buzz2#01
33+
- name=TestFoo/Bar#01/Buzz2#01
34+
TestFinished
35+
- duration=42
36+
- name=TestFoo
37+
TestStdOut
38+
- name=TestFoo/Bar#01/Buzz2#01
39+
- out=
40+
TestFinished
41+
- duration=42
42+
- name=TestFoo/k[h]kjh_khk_jh
43+
TestStdOut
44+
- name=TestFoo/Bar#01/Buzz2#01
45+
- out=
46+
TestFinished
47+
- duration=42
48+
- name=TestFoo/#00
49+
TestStdOut
50+
- name=TestFoo/Bar#01/Buzz2#01
51+
- out=
52+
TestFinished
53+
- duration=42
54+
- name=TestFoo/#00#01
55+
TestStdOut
56+
- name=TestFoo/Bar#01/Buzz2#01
57+
- out=
58+
TestFinished
59+
- duration=42
60+
- name=TestFoo/#01
61+
TestStdOut
62+
- name=TestFoo/Bar#01/Buzz2#01
63+
- out=
64+
TestFinished
65+
- duration=42
66+
- name=TestFoo/Bar
67+
TestStdOut
68+
- name=TestFoo/Bar#01/Buzz2#01
69+
- out=
70+
TestFinished
71+
- duration=42
72+
- name=TestFoo/Bar/Buzz2
73+
TestStdOut
74+
- name=TestFoo/Bar#01/Buzz2#01
75+
- out=
76+
TestFinished
77+
- duration=42
78+
- name=TestFoo/Bar/Buzz2#01
79+
TestStdOut
80+
- name=TestFoo/Bar#01/Buzz2#01
81+
- out=
82+
TestFinished
83+
- duration=42
84+
- name=TestFoo/Bar#01
85+
TestStdOut
86+
- name=TestFoo/Bar#01/Buzz2#01
87+
- out=
88+
TestFinished
89+
- duration=42
90+
- name=TestFoo/Bar#01/Buzz2
91+
TestStdOut
92+
- name=TestFoo/Bar#01/Buzz2#01
93+
- out=
94+
TestFinished
95+
- duration=42
96+
- name=TestFoo/Bar#01/Buzz2#01
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
=== RUN TestFoo
2+
=== RUN TestFoo/k[h]kjh_khk_jh
3+
=== RUN TestFoo/#00
4+
=== RUN TestFoo/#00#01
5+
=== RUN TestFoo/#01
6+
=== RUN TestFoo/Bar
7+
=== RUN TestFoo/Bar/Buzz2
8+
=== RUN TestFoo/Bar/Buzz2#01
9+
=== RUN TestFoo/Bar#01
10+
=== RUN TestFoo/Bar#01/Buzz2
11+
=== RUN TestFoo/Bar#01/Buzz2#01
12+
--- PASS: TestFoo (0.00s)
13+
--- PASS: TestFoo/k[h]kjh_khk_jh (0.00s)
14+
--- PASS: TestFoo/#00 (0.00s)
15+
--- PASS: TestFoo/#00#01 (0.00s)
16+
--- PASS: TestFoo/#01 (0.00s)
17+
--- PASS: TestFoo/Bar (0.00s)
18+
--- PASS: TestFoo/Bar/Buzz2 (0.00s)
19+
--- PASS: TestFoo/Bar/Buzz2#01 (0.00s)
20+
--- PASS: TestFoo/Bar#01 (0.00s)
21+
--- PASS: TestFoo/Bar#01/Buzz2 (0.00s)
22+
--- PASS: TestFoo/Bar#01/Buzz2#01 (0.00s)
23+
PASS
24+
ok foo 0.010s

tests/com/goide/runconfig/testing/GotestEventsConverterTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public void testMultipleTestsOk() {
3939
public void testSingleTestLeadingSpaceOk() {
4040
doTest();
4141
}
42-
42+
4343
public void testSkipTest() {
4444
doTest();
4545
}
46-
46+
4747
public void testStdOut() {
4848
doTest();
4949
}
50-
50+
5151
public void testOneLineEvents() {
5252
doTest();
5353
}
@@ -56,12 +56,16 @@ public void testUnicodeTestName() {
5656
doTest();
5757
}
5858

59+
public void testSubTests() {
60+
doTest();
61+
}
62+
5963
@NotNull
6064
@Override
6165
protected String getBasePath() {
6266
return "testing/gotest";
6367
}
64-
68+
6569
@NotNull
6670
@Override
6771
protected GoTestFramework getTestFramework() {

utils/src/com/goide/GoConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public class GoConstants {
3434
public static final String GO_LIBRARIES_CONFIG_FILE = "goLibraries.xml";
3535
public static final String GO_MODULE_SESTTINGS_SERVICE_NAME = "Go";
3636

37-
public static final String IDENTIFIER_REGEX = "[\\p{javaLetter}_][\\p{javaLetterOrDigit}_]*";
38-
37+
private static final String IDENTIFIER_REGEX = "[\\p{javaLetter}_][\\p{javaLetterOrDigit}_]*";
38+
public static final String TEST_NAME_REGEX = IDENTIFIER_REGEX + "(/\\S*)?";
3939
public static final String TESTDATA_NAME = "testdata";
4040
public static final String TEST_SUFFIX = "_test";
4141
public static final String TEST_SUFFIX_WITH_EXTENSION = "_test.go";

0 commit comments

Comments
 (0)