Permalink
Browse files

[testing] processing subtests output

  • Loading branch information...
1 parent f2893c8 commit 25b8b037273f179b3f5b78f8b7ecb5cdb75156cb @zolotov zolotov committed Sep 21, 2016
@@ -27,10 +27,10 @@
import java.util.regex.Pattern;
public class GotestEventsConverter extends GoTestEventsConverterBaseImpl {
- private static final Pattern RUN = Pattern.compile("^=== RUN\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
- private static final Pattern PASSED = Pattern.compile("--- PASS:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
- private static final Pattern SKIP = Pattern.compile("--- SKIP:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
- private static final Pattern FAILED = Pattern.compile("--- FAIL:\\s+(" + GoConstants.IDENTIFIER_REGEX + ")");
+ private static final Pattern RUN = Pattern.compile("^=== RUN\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
+ private static final Pattern PASSED = Pattern.compile("--- PASS:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
+ private static final Pattern SKIP = Pattern.compile("--- SKIP:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
+ private static final Pattern FAILED = Pattern.compile("--- FAIL:\\s+(" + GoConstants.TEST_NAME_REGEX + ")");
private static final Pattern FINISHED = Pattern.compile("^(PASS)|(FAIL)$");
public GotestEventsConverter(@NotNull TestConsoleProperties consoleProperties) {
@@ -0,0 +1,96 @@
+TestStarted
+ - locationHint=gotest://TestFoo
+ - name=TestFoo
+ TestStarted
+ - locationHint=gotest://TestFoo/k[h]kjh_khk_jh
+ - name=TestFoo/k[h]kjh_khk_jh
+ TestStarted
+ - locationHint=gotest://TestFoo/#00
+ - name=TestFoo/#00
+ TestStarted
+ - locationHint=gotest://TestFoo/#00#01
+ - name=TestFoo/#00#01
+ TestStarted
+ - locationHint=gotest://TestFoo/#01
+ - name=TestFoo/#01
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar
+ - name=TestFoo/Bar
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar/Buzz2
+ - name=TestFoo/Bar/Buzz2
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar/Buzz2#01
+ - name=TestFoo/Bar/Buzz2#01
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar#01
+ - name=TestFoo/Bar#01
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar#01/Buzz2
+ - name=TestFoo/Bar#01/Buzz2
+ TestStarted
+ - locationHint=gotest://TestFoo/Bar#01/Buzz2#01
+ - name=TestFoo/Bar#01/Buzz2#01
+ TestFinished
+ - duration=42
+ - name=TestFoo
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/k[h]kjh_khk_jh
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/#00
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/#00#01
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/#01
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/Bar
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/Bar/Buzz2
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/Bar/Buzz2#01
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/Bar#01
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+ TestFinished
+ - duration=42
+ - name=TestFoo/Bar#01/Buzz2
+ TestStdOut
+ - name=TestFoo/Bar#01/Buzz2#01
+ - out=
+TestFinished
+ - duration=42
+ - name=TestFoo/Bar#01/Buzz2#01
@@ -0,0 +1,24 @@
+=== RUN TestFoo
+=== RUN TestFoo/k[h]kjh_khk_jh
+=== RUN TestFoo/#00
+=== RUN TestFoo/#00#01
+=== RUN TestFoo/#01
+=== RUN TestFoo/Bar
+=== RUN TestFoo/Bar/Buzz2
+=== RUN TestFoo/Bar/Buzz2#01
+=== RUN TestFoo/Bar#01
+=== RUN TestFoo/Bar#01/Buzz2
+=== RUN TestFoo/Bar#01/Buzz2#01
+--- PASS: TestFoo (0.00s)
+ --- PASS: TestFoo/k[h]kjh_khk_jh (0.00s)
+ --- PASS: TestFoo/#00 (0.00s)
+ --- PASS: TestFoo/#00#01 (0.00s)
+ --- PASS: TestFoo/#01 (0.00s)
+ --- PASS: TestFoo/Bar (0.00s)
+ --- PASS: TestFoo/Bar/Buzz2 (0.00s)
+ --- PASS: TestFoo/Bar/Buzz2#01 (0.00s)
+ --- PASS: TestFoo/Bar#01 (0.00s)
+ --- PASS: TestFoo/Bar#01/Buzz2 (0.00s)
+ --- PASS: TestFoo/Bar#01/Buzz2#01 (0.00s)
+PASS
+ok foo 0.010s
@@ -39,15 +39,15 @@ public void testMultipleTestsOk() {
public void testSingleTestLeadingSpaceOk() {
doTest();
}
-
+
public void testSkipTest() {
doTest();
}
-
+
public void testStdOut() {
doTest();
}
-
+
public void testOneLineEvents() {
doTest();
}
@@ -56,12 +56,16 @@ public void testUnicodeTestName() {
doTest();
}
+ public void testSubTests() {
+ doTest();
+ }
+
@NotNull
@Override
protected String getBasePath() {
return "testing/gotest";
}
-
+
@NotNull
@Override
protected GoTestFramework getTestFramework() {
@@ -34,8 +34,8 @@
public static final String GO_LIBRARIES_CONFIG_FILE = "goLibraries.xml";
public static final String GO_MODULE_SESTTINGS_SERVICE_NAME = "Go";
- public static final String IDENTIFIER_REGEX = "[\\p{javaLetter}_][\\p{javaLetterOrDigit}_]*";
-
+ private static final String IDENTIFIER_REGEX = "[\\p{javaLetter}_][\\p{javaLetterOrDigit}_]*";
+ public static final String TEST_NAME_REGEX = IDENTIFIER_REGEX + "(/\\S*)?";
public static final String TESTDATA_NAME = "testdata";
public static final String TEST_SUFFIX = "_test";
public static final String TEST_SUFFIX_WITH_EXTENSION = "_test.go";

0 comments on commit 25b8b03

Please sign in to comment.