From 751d2e2bb1f0f2829fff8dac15b534fbadc25b3c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 16 Feb 2015 12:18:02 +0100 Subject: [PATCH] Fix re-parsing of tests... ...for code split up into header and source. Change-Id: I8f1bf01e6ff6f88afc1e054318cd384b5f231eb6 Reviewed-by: Andre Poenitz --- plugins/autotest/testcodeparser.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp index 510ce09de29..a33a6cac9bb 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); } } }