forked from qt-creator/qt-creator
AutoTest: Fix gtest detection
If a test name starts with a number the codemodel handles the function-like macro differently and does not generate the arguments as it would do when using normal literals. Work around by explicitly handling the expression tokens. Fixes: QTCREATORBUG-25498 Change-Id: Ibf381af912403cb7b87c1c30b5a8fc7043c16056 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -213,7 +213,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
||||
QVERIFY(parserSpy.wait(20000));
|
||||
QVERIFY(modelUpdateSpy.wait());
|
||||
|
||||
QCOMPARE(m_model->gtestNamesCount(), 7);
|
||||
QCOMPARE(m_model->gtestNamesCount(), 8);
|
||||
|
||||
QMultiMap<QString, int> expectedNamesAndSets;
|
||||
expectedNamesAndSets.insert(QStringLiteral("FactorialTest"), 3);
|
||||
@@ -222,6 +222,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
||||
expectedNamesAndSets.insert(QStringLiteral("QueueTest"), 2);
|
||||
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as parameterized test
|
||||
expectedNamesAndSets.insert(QStringLiteral("DummyTest"), 1); // used as 'normal' test
|
||||
expectedNamesAndSets.insert(QStringLiteral("NumberAsNameStart"), 1);
|
||||
expectedNamesAndSets.insert(QStringLiteral("NamespaceTest"), 1);
|
||||
|
||||
QMultiMap<QString, int> foundNamesAndSets = m_model->gtestNamesAndSets();
|
||||
|
||||
Reference in New Issue
Block a user