forked from qt-creator/qt-creator
Fix re-parsing of tests...
...for code split up into header and source. Change-Id: I8f1bf01e6ff6f88afc1e054318cd384b5f231eb6 Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
This commit is contained in:
@@ -372,19 +372,19 @@ void TestCodeParser::checkDocumentForTestCode(CPlusPlus::Document::Ptr document)
|
||||
TestTreeItem item = constructTestTreeItem(declaringDoc->fileName(), QString(),
|
||||
testCaseName, line, column, testFunctions);
|
||||
updateModelAndCppDocMap(document, declaringDoc->fileName(), item);
|
||||
} else {
|
||||
// could not find the class to test, but QTest is included and QT_TESTLIB_LIB defined
|
||||
// maybe file is only a referenced file
|
||||
if (m_cppDocMap.contains(fileName)) {
|
||||
const TestInfo info = m_cppDocMap[fileName];
|
||||
CPlusPlus::Snapshot snapshot = modelManager->snapshot();
|
||||
if (snapshot.contains(info.referencingFile())) {
|
||||
checkDocumentForTestCode(snapshot.find(info.referencingFile()).value());
|
||||
} else { // no referencing file too, so this test case is no more a test case
|
||||
m_cppDocMap.remove(fileName);
|
||||
emit testItemsRemoved(fileName, TestTreeModel::AutoTest);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
// could not find the class to test, or QTest is not included and QT_TESTLIB_LIB defined
|
||||
// maybe file is only a referenced file
|
||||
if (m_cppDocMap.contains(fileName)) {
|
||||
const TestInfo info = m_cppDocMap[fileName];
|
||||
CPlusPlus::Snapshot snapshot = modelManager->snapshot();
|
||||
if (snapshot.contains(info.referencingFile())) {
|
||||
checkDocumentForTestCode(snapshot.find(info.referencingFile()).value());
|
||||
} else { // no referencing file too, so this test case is no more a test case
|
||||
m_cppDocMap.remove(fileName);
|
||||
emit testItemsRemoved(fileName, TestTreeModel::AutoTest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user