forked from qt-creator/qt-creator
AutoTest: Use settings for test run
Change-Id: I3871d15c34f19ea87d9c6ff99a6b0a83dad16fd1 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user