summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2015-02-16 12:18:02 +0100
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-02-16 15:49:58 +0200
commit751d2e2bb1f0f2829fff8dac15b534fbadc25b3c (patch)
tree2cf36040b4b1b4c8c67c25127ec5570b0ce1495d
parent2ce99680b20802a370e6d20a1467a1d41fbee690 (diff)
downloadqt-creator-751d2e2bb1f0f2829fff8dac15b534fbadc25b3c.tar.gz
Fix re-parsing of tests...
...for code split up into header and source. Change-Id: I8f1bf01e6ff6f88afc1e054318cd384b5f231eb6 Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
-rw-r--r--plugins/autotest/testcodeparser.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp
index 510ce09de2..a33a6cac9b 100644
--- a/plugins/autotest/testcodeparser.cpp
+++ b/plugins/autotest/testcodeparser.cpp
@@ -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);
}
}
}