1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 479289 - Eclipse fails to parse gtest output for parametrized tests

Change-Id: Ieec10941c76a8ed5e1820ff165b1e673fbc1dd2f
Signed-off-by: xgsa <xgsa@yandex.ru>
This commit is contained in:
xgsa 2017-09-28 14:10:43 +03:00 committed by Nathan Ridge
parent 5228d19300
commit 10eb43465e
2 changed files with 44 additions and 2 deletions

View file

@ -492,8 +492,8 @@ public class OutputHandler {
private static final int DEFAULT_LOCATION_LINE = 1;
// Common regular expression parts
static private String regexTestSuiteName = "([^,]+)"; //$NON-NLS-1$
static private String regexParameterInstantiation = "(\\s*,\\s+where\\s+TypeParam\\s*=([^,(]+))?"; //$NON-NLS-1$
static private String regexTestSuiteName = "([^, ]+)"; //$NON-NLS-1$
static private String regexParameterInstantiation = "(\\s*,\\s+where\\s+TypeParam\\s*=(.+))?"; //$NON-NLS-1$
static private String regexTestName = regexTestSuiteName+"\\.([^,]+)"; //$NON-NLS-1$
static private String regexTestCount = "\\d+\\s+tests?"; //$NON-NLS-1$
static private String regexTestTime = "(\\d+)\\s+ms"; //$NON-NLS-1$

View file

@ -695,4 +695,46 @@ public class GoogleTestCase extends BaseTestCase {
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 2 tests from TestCaseName/0, where TypeParam = TypeStruct<float, true>
//[ RUN ] TestCaseName/0.TestName
//[ OK ] TestCaseName/0.TestName (0 ms)
//[ RUN ] TestCaseName/0.AnotherTestName
//[ OK ] TestCaseName/0.AnotherTestName (1 ms)
//[----------] 2 tests from TestCaseName/0 (1 ms total)
//
//[----------] 2 tests from TestCaseName/1, where TypeParam = UT::(anonymous namespace)::CoreTag
//[ RUN ] TestCaseName/1.TestName
//[ OK ] TestCaseName/1.TestName (1 ms)
//[ RUN ] TestCaseName/1.AnotherTestName
//[ OK ] TestCaseName/1.AnotherTestName (0 ms)
//[----------] 2 tests from TestCaseName/1 (1 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTypeParametrizedTestsWithTemplatesParsing() {
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestSuite("TestCaseName/0(TypeStruct<float, true>)");
mockModelUpdater.enterTestCase("TestName");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("AnotherTestName");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestSuite("TestCaseName/1(UT::(anonymous namespace)::CoreTag)");
mockModelUpdater.enterTestCase("TestName");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("AnotherTestName");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
}