diff options
author | Christian Stenger <[email protected]> | 2016-02-29 16:13:55 +0100 |
---|---|---|
committer | Christian Stenger <[email protected]> | 2016-03-14 07:46:59 +0000 |
commit | bf6f1232f768cfb9124f9bfeb80a4e02db09531e (patch) | |
tree | 0be3b1cb2c23e5a6a042f737bf2e4c644fc790c9 /src/plugins/autotest/autotestunittests.cpp | |
parent | b01879dea8d7c4b83486a40add0564dfd134fe3d (diff) |
AutoTest: Use settings for test run
Change-Id: I3871d15c34f19ea87d9c6ff99a6b0a83dad16fd1
Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/autotest/autotestunittests.cpp')
-rw-r--r-- | src/plugins/autotest/autotestunittests.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
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 <cpptools/cppmodelmanager.h> @@ -40,8 +42,6 @@ #include <QSignalSpy> #include <QTest> -#include <coreplugin/navigationwidget.h> - #include <qtsupport/qtkitinformation.h> 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<int>, expectedUnnamedQuickTestsCount); QFETCH(QList<int>, 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); |