Commit 751d2e2b authored by Christian Stenger's avatar Christian Stenger
Browse files

Fix re-parsing of tests...



...for code split up into header and source.

Change-Id: I8f1bf01e6ff6f88afc1e054318cd384b5f231eb6
Reviewed-by: default avatarAndre Poenitz <andre.poenitz@theqtcompany.com>
parent 2ce99680
......@@ -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);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment