diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index 0ae4b4ad5ad..d20fcf81490 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -24,8 +24,10 @@ ****************************************************************************/ #include "autotestconstants.h" +#include "autotestplugin.h" #include "autotestunittests.h" #include "testcodeparser.h" +#include "testsettings.h" #include "testtreemodel.h" #include @@ -40,8 +42,6 @@ #include #include -#include - #include using namespace Core; @@ -73,10 +73,17 @@ void AutoTestUnitTests::initTestCase() QSKIP("This test requires that there is a kit with a toolchain."); m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(QLatin1String(":/unit_test")); + + m_originalAlwaysParse = AutotestPlugin::instance()->settings()->alwaysParse; + if (!m_originalAlwaysParse) { + AutotestPlugin::instance()->settings()->alwaysParse = true; + TestTreeModel::instance()->enableParsingFromSettings(); + } } void AutoTestUnitTests::cleanupTestCase() { + AutotestPlugin::instance()->settings()->alwaysParse = m_originalAlwaysParse; delete m_tmpDir; } @@ -88,9 +95,6 @@ void AutoTestUnitTests::testCodeParser() QFETCH(int, expectedUnnamedQuickTestsCount); QFETCH(int, expectedDataTagsCount); - NavigationWidget *navigation = NavigationWidget::instance(); - navigation->activateSubWidget(Constants::AUTOTEST_ID); - CppTools::Tests::ProjectOpenerAndCloser projectManager; const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true); QVERIFY(projectInfo.isValid()); @@ -140,9 +144,6 @@ void AutoTestUnitTests::testCodeParserSwitchStartup() QFETCH(QList, expectedUnnamedQuickTestsCount); QFETCH(QList, expectedDataTagsCount); - NavigationWidget *navigation = NavigationWidget::instance(); - navigation->activateSubWidget(Constants::AUTOTEST_ID); - CppTools::Tests::ProjectOpenerAndCloser projectManager; for (int i = 0; i < projectFilePaths.size(); ++i) { qDebug() << "Opening project" << projectFilePaths.at(i); @@ -193,9 +194,6 @@ void AutoTestUnitTests::testCodeParserGTest() if (qgetenv("GOOGLETEST_DIR").isEmpty()) QSKIP("This test needs googletest - set GOOGLETEST_DIR (point to googletest repository)"); - NavigationWidget *navigation = NavigationWidget::instance(); - navigation->activateSubWidget(Constants::AUTOTEST_ID); - CppTools::Tests::ProjectOpenerAndCloser projectManager; CppTools::ProjectInfo projectInfo = projectManager.open( QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.pro")), true); diff --git a/src/plugins/autotest/autotestunittests.h b/src/plugins/autotest/autotestunittests.h index b5e808d3ce8..6eab3749d45 100644 --- a/src/plugins/autotest/autotestunittests.h +++ b/src/plugins/autotest/autotestunittests.h @@ -57,6 +57,7 @@ private: TestTreeModel *m_model; CppTools::Tests::TemporaryCopiedDir *m_tmpDir; bool m_isQt4; + bool m_originalAlwaysParse; }; } // namespace Internal