forked from qt-creator/qt-creator
AutoTest: Rename IFrameworkSettings to ITestSettings
...and move and rename frameworkSettings() function from ITestFramework to the new base class. Change-Id: Iedd883d1ffb9a57a4215a24f66f5422a46060a09 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
committed by
Oliver Wolff
parent
5cc7fc6a2d
commit
f9cb699211
@@ -39,10 +39,10 @@ add_qtc_plugin(AutoTest
|
|||||||
gtest/gtestsettingspage.cpp gtest/gtestsettingspage.h gtest/gtestsettingspage.ui
|
gtest/gtestsettingspage.cpp gtest/gtestsettingspage.h gtest/gtestsettingspage.ui
|
||||||
gtest/gtesttreeitem.cpp gtest/gtesttreeitem.h
|
gtest/gtesttreeitem.cpp gtest/gtesttreeitem.h
|
||||||
gtest/gtestvisitors.cpp gtest/gtestvisitors.h
|
gtest/gtestvisitors.cpp gtest/gtestvisitors.h
|
||||||
iframeworksettings.h
|
|
||||||
itemdatacache.h
|
itemdatacache.h
|
||||||
itestframework.cpp itestframework.h
|
itestframework.cpp itestframework.h
|
||||||
itestparser.cpp itestparser.h
|
itestparser.cpp itestparser.h
|
||||||
|
itestsettings.h
|
||||||
projectsettingswidget.cpp projectsettingswidget.h
|
projectsettingswidget.cpp projectsettingswidget.h
|
||||||
qtest/qttest_utils.cpp qtest/qttest_utils.h
|
qtest/qttest_utils.cpp qtest/qttest_utils.h
|
||||||
qtest/qttestconfiguration.cpp qtest/qttestconfiguration.h
|
qtest/qttestconfiguration.cpp qtest/qttestconfiguration.h
|
||||||
|
@@ -78,10 +78,10 @@ HEADERS += \
|
|||||||
autotestconstants.h \
|
autotestconstants.h \
|
||||||
autotesticons.h \
|
autotesticons.h \
|
||||||
autotestplugin.h \
|
autotestplugin.h \
|
||||||
iframeworksettings.h \
|
|
||||||
itemdatacache.h \
|
itemdatacache.h \
|
||||||
itestframework.h \
|
itestframework.h \
|
||||||
itestparser.h \
|
itestparser.h \
|
||||||
|
itestsettings.h \
|
||||||
projectsettingswidget.h \
|
projectsettingswidget.h \
|
||||||
testcodeparser.h \
|
testcodeparser.h \
|
||||||
testconfiguration.h \
|
testconfiguration.h \
|
||||||
|
@@ -79,7 +79,7 @@ QtcPlugin {
|
|||||||
"itestparser.h",
|
"itestparser.h",
|
||||||
"itestframework.cpp",
|
"itestframework.cpp",
|
||||||
"itestframework.h",
|
"itestframework.h",
|
||||||
"iframeworksettings.h",
|
"itestsettings.h",
|
||||||
"testframeworkmanager.cpp",
|
"testframeworkmanager.cpp",
|
||||||
"testframeworkmanager.h",
|
"testframeworkmanager.h",
|
||||||
"testrunconfiguration.h"
|
"testrunconfiguration.h"
|
||||||
|
@@ -40,7 +40,7 @@ namespace Internal {
|
|||||||
TestOutputReader *BoostTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *BoostTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const
|
QProcess *app) const
|
||||||
{
|
{
|
||||||
auto settings = dynamic_cast<BoostTestSettings *>(framework()->frameworkSettings());
|
auto settings = dynamic_cast<BoostTestSettings *>(framework()->testSettings());
|
||||||
return new BoostTestOutputReader(fi, app, buildDirectory(), projectFile(),
|
return new BoostTestOutputReader(fi, app, buildDirectory(), projectFile(),
|
||||||
settings->logLevel, settings->reportLevel);
|
settings->logLevel, settings->reportLevel);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ static QStringList filterInterfering(const QStringList &provided, QStringList *o
|
|||||||
|
|
||||||
QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) const
|
QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted) const
|
||||||
{
|
{
|
||||||
auto boostSettings = dynamic_cast<BoostTestSettings *>(framework()->frameworkSettings());
|
auto boostSettings = dynamic_cast<BoostTestSettings *>(framework()->testSettings());
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << "-l" << BoostTestSettings::logLevelToOption(boostSettings->logLevel);
|
arguments << "-l" << BoostTestSettings::logLevelToOption(boostSettings->logLevel);
|
||||||
arguments << "-r" << BoostTestSettings::reportLevelToOption(boostSettings->reportLevel);
|
arguments << "-r" << BoostTestSettings::reportLevelToOption(boostSettings->reportLevel);
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
IFrameworkSettings *frameworkSettings() override { return &m_settings; }
|
ITestSettings *testSettings() override { return &m_settings; }
|
||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
TestTreeItem *createRootNode() override;
|
TestTreeItem *createRootNode() override;
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ QString BoostTestSettings::name() const
|
|||||||
return QString("BoostTest");
|
return QString("BoostTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoostTestSettings::fromFrameworkSettings(const QSettings *s)
|
void BoostTestSettings::fromTestSettings(const QSettings *s)
|
||||||
|
|
||||||
{
|
{
|
||||||
logLevel = LogLevel((s->value(logLevelKey, int(LogLevel::All)).toInt()));
|
logLevel = LogLevel((s->value(logLevelKey, int(LogLevel::All)).toInt()));
|
||||||
@@ -53,7 +53,7 @@ void BoostTestSettings::fromFrameworkSettings(const QSettings *s)
|
|||||||
seed = s->value(seedKey, 0).toInt();
|
seed = s->value(seedKey, 0).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoostTestSettings::toFrameworkSettings(QSettings *s) const
|
void BoostTestSettings::toTestSettings(QSettings *s) const
|
||||||
{
|
{
|
||||||
s->setValue(logLevelKey, int(logLevel));
|
s->setValue(logLevelKey, int(logLevel));
|
||||||
s->setValue(reportLevelKey, int(reportLevel));
|
s->setValue(reportLevelKey, int(reportLevel));
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../iframeworksettings.h"
|
#include "../itestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -53,7 +53,7 @@ enum class ReportLevel
|
|||||||
No
|
No
|
||||||
};
|
};
|
||||||
|
|
||||||
class BoostTestSettings : public IFrameworkSettings
|
class BoostTestSettings : public ITestSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BoostTestSettings() = default;
|
BoostTestSettings() = default;
|
||||||
@@ -70,8 +70,8 @@ public:
|
|||||||
bool memLeaks = true;
|
bool memLeaks = true;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void fromFrameworkSettings(const QSettings *s) override;
|
void fromTestSettings(const QSettings *s) override;
|
||||||
void toFrameworkSettings(QSettings *s) const override;
|
void toTestSettings(QSettings *s) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -104,7 +104,7 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con
|
|||||||
' ', Qt::SkipEmptyParts), omitted);
|
' ', Qt::SkipEmptyParts), omitted);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto settings = dynamic_cast<CatchTestSettings *>(framework()->frameworkSettings());
|
auto settings = dynamic_cast<CatchTestSettings *>(framework()->testSettings());
|
||||||
if (!settings)
|
if (!settings)
|
||||||
return arguments;
|
return arguments;
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ protected:
|
|||||||
TestTreeItem *createRootNode() override;
|
TestTreeItem *createRootNode() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IFrameworkSettings * frameworkSettings() override { return &m_settings; }
|
ITestSettings * testSettings() override { return &m_settings; }
|
||||||
CatchTestSettings m_settings;
|
CatchTestSettings m_settings;
|
||||||
CatchTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
CatchTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
||||||
};
|
};
|
||||||
|
@@ -50,7 +50,7 @@ QString CatchTestSettings::name() const
|
|||||||
return QString("Catch2");
|
return QString("Catch2");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatchTestSettings::toFrameworkSettings(QSettings *s) const
|
void CatchTestSettings::toTestSettings(QSettings *s) const
|
||||||
{
|
{
|
||||||
s->setValue(abortAfterCheckedKey, abortAfterChecked);
|
s->setValue(abortAfterCheckedKey, abortAfterChecked);
|
||||||
s->setValue(abortAfterKey, abortAfter);
|
s->setValue(abortAfterKey, abortAfter);
|
||||||
@@ -70,7 +70,7 @@ void CatchTestSettings::toFrameworkSettings(QSettings *s) const
|
|||||||
s->setValue(warnOnEmptyKey, warnOnEmpty);
|
s->setValue(warnOnEmptyKey, warnOnEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatchTestSettings::fromFrameworkSettings(const QSettings *s)
|
void CatchTestSettings::fromTestSettings(const QSettings *s)
|
||||||
{
|
{
|
||||||
abortAfterChecked = s->value(abortAfterCheckedKey, false).toBool();
|
abortAfterChecked = s->value(abortAfterCheckedKey, false).toBool();
|
||||||
abortAfter = s->value(abortAfterKey, 0).toInt();
|
abortAfter = s->value(abortAfterKey, 0).toInt();
|
||||||
|
@@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../iframeworksettings.h"
|
#include "../itestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CatchTestSettings : public IFrameworkSettings
|
class CatchTestSettings : public ITestSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CatchTestSettings() = default;
|
CatchTestSettings() = default;
|
||||||
@@ -54,8 +54,8 @@ public:
|
|||||||
bool warnOnEmpty = false;
|
bool warnOnEmpty = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void toFrameworkSettings(QSettings *s) const override;
|
void toTestSettings(QSettings *s) const override;
|
||||||
void fromFrameworkSettings(const QSettings *s) override;
|
void fromTestSettings(const QSettings *s) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -84,7 +84,7 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con
|
|||||||
if (!testSets.isEmpty())
|
if (!testSets.isEmpty())
|
||||||
arguments << "--gtest_filter=" + testSets.join(':');
|
arguments << "--gtest_filter=" + testSets.join(':');
|
||||||
|
|
||||||
auto gSettings = dynamic_cast<GTestSettings *>(framework()->frameworkSettings());
|
auto gSettings = dynamic_cast<GTestSettings *>(framework()->testSettings());
|
||||||
if (!gSettings)
|
if (!gSettings)
|
||||||
return arguments;
|
return arguments;
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ private:
|
|||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
QString groupingToolTip() const override;
|
QString groupingToolTip() const override;
|
||||||
IFrameworkSettings *frameworkSettings() override { return &m_settings; }
|
ITestSettings *testSettings() override { return &m_settings; }
|
||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
TestTreeItem *createRootNode() override;
|
TestTreeItem *createRootNode() override;
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ QString GTestSettings::name() const
|
|||||||
return QString("GTest");
|
return QString("GTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTestSettings::fromFrameworkSettings(const QSettings *s)
|
void GTestSettings::fromTestSettings(const QSettings *s)
|
||||||
{
|
{
|
||||||
runDisabled = s->value(runDisabledKey, false).toBool();
|
runDisabled = s->value(runDisabledKey, false).toBool();
|
||||||
repeat = s->value(repeatKey, false).toBool();
|
repeat = s->value(repeatKey, false).toBool();
|
||||||
@@ -62,7 +62,7 @@ void GTestSettings::fromFrameworkSettings(const QSettings *s)
|
|||||||
gtestFilter = GTest::Constants::DEFAULT_FILTER;
|
gtestFilter = GTest::Constants::DEFAULT_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTestSettings::toFrameworkSettings(QSettings *s) const
|
void GTestSettings::toTestSettings(QSettings *s) const
|
||||||
{
|
{
|
||||||
s->setValue(runDisabledKey, runDisabled);
|
s->setValue(runDisabledKey, runDisabled);
|
||||||
s->setValue(repeatKey, repeat);
|
s->setValue(repeatKey, repeat);
|
||||||
|
@@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../iframeworksettings.h"
|
#include "../itestsettings.h"
|
||||||
#include "gtestconstants.h"
|
#include "gtestconstants.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GTestSettings : public IFrameworkSettings
|
class GTestSettings : public ITestSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GTestSettings() {}
|
GTestSettings() {}
|
||||||
@@ -48,8 +48,8 @@ public:
|
|||||||
QString gtestFilter{GTest::Constants::DEFAULT_FILTER};
|
QString gtestFilter{GTest::Constants::DEFAULT_FILTER};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void fromFrameworkSettings(const QSettings *s) override;
|
void fromTestSettings(const QSettings *s) override;
|
||||||
void toFrameworkSettings(QSettings *s) const override;
|
void toTestSettings(QSettings *s) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
|
|
||||||
class IFrameworkSettings;
|
class ITestSettings;
|
||||||
|
|
||||||
class ITestBase
|
class ITestBase
|
||||||
{
|
{
|
||||||
@@ -41,6 +41,8 @@ public:
|
|||||||
virtual const char *name() const = 0;
|
virtual const char *name() const = 0;
|
||||||
virtual unsigned priority() const = 0; // should this be modifyable?
|
virtual unsigned priority() const = 0; // should this be modifyable?
|
||||||
|
|
||||||
|
virtual ITestSettings *testSettings() { return nullptr; }
|
||||||
|
|
||||||
TestTreeItem *rootNode();
|
TestTreeItem *rootNode();
|
||||||
|
|
||||||
Utils::Id settingsId() const;
|
Utils::Id settingsId() const;
|
||||||
@@ -65,8 +67,6 @@ public:
|
|||||||
explicit ITestFramework(bool activeByDefault);
|
explicit ITestFramework(bool activeByDefault);
|
||||||
~ITestFramework() override;
|
~ITestFramework() override;
|
||||||
|
|
||||||
virtual IFrameworkSettings *frameworkSettings() { return nullptr; }
|
|
||||||
|
|
||||||
ITestParser *testParser();
|
ITestParser *testParser();
|
||||||
|
|
||||||
bool grouping() const { return m_grouping; }
|
bool grouping() const { return m_grouping; }
|
||||||
|
@@ -31,11 +31,11 @@
|
|||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
|
|
||||||
class IFrameworkSettings
|
class ITestSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IFrameworkSettings() {}
|
ITestSettings() {}
|
||||||
virtual ~IFrameworkSettings() {}
|
virtual ~ITestSettings() {}
|
||||||
|
|
||||||
virtual QString name() const = 0;
|
virtual QString name() const = 0;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
{
|
{
|
||||||
s->beginGroup(Constants::SETTINGSGROUP);
|
s->beginGroup(Constants::SETTINGSGROUP);
|
||||||
s->beginGroup(name());
|
s->beginGroup(name());
|
||||||
toFrameworkSettings(s);
|
toTestSettings(s);
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
@@ -52,14 +52,14 @@ public:
|
|||||||
{
|
{
|
||||||
s->beginGroup(Constants::SETTINGSGROUP);
|
s->beginGroup(Constants::SETTINGSGROUP);
|
||||||
s->beginGroup(name());
|
s->beginGroup(name());
|
||||||
fromFrameworkSettings(s);
|
fromTestSettings(s);
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void toFrameworkSettings(QSettings *s) const = 0;
|
virtual void toTestSettings(QSettings *s) const = 0;
|
||||||
virtual void fromFrameworkSettings(const QSettings *s) = 0;
|
virtual void fromTestSettings(const QSettings *s) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Autotest
|
} // namespace Autotest
|
@@ -40,7 +40,7 @@ namespace Internal {
|
|||||||
TestOutputReader *QtTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *QtTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const
|
QProcess *app) const
|
||||||
{
|
{
|
||||||
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->testSettings());
|
||||||
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput
|
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput
|
||||||
? QtTestOutputReader::XML
|
? QtTestOutputReader::XML
|
||||||
: QtTestOutputReader::PlainText;
|
: QtTestOutputReader::PlainText;
|
||||||
@@ -55,7 +55,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
|
|||||||
runnable().commandLineArguments.split(' ', Qt::SkipEmptyParts),
|
runnable().commandLineArguments.split(' ', Qt::SkipEmptyParts),
|
||||||
omitted, false));
|
omitted, false));
|
||||||
}
|
}
|
||||||
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->testSettings());
|
||||||
if (!qtSettings)
|
if (!qtSettings)
|
||||||
return arguments;
|
return arguments;
|
||||||
if (qtSettings->useXMLOutput)
|
if (qtSettings->useXMLOutput)
|
||||||
|
@@ -43,7 +43,7 @@ private:
|
|||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
TestTreeItem *createRootNode() override;
|
TestTreeItem *createRootNode() override;
|
||||||
IFrameworkSettings *frameworkSettings() override { return &m_settings; }
|
ITestSettings *testSettings() override { return &m_settings; }
|
||||||
|
|
||||||
QtTestSettings m_settings;
|
QtTestSettings m_settings;
|
||||||
QtTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
QtTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
||||||
|
@@ -57,7 +57,7 @@ QString QtTestSettings::name() const
|
|||||||
return QString("QtTest");
|
return QString("QtTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtTestSettings::fromFrameworkSettings(const QSettings *s)
|
void QtTestSettings::fromTestSettings(const QSettings *s)
|
||||||
{
|
{
|
||||||
metrics = intToMetrics(s->value(metricsKey, Walltime).toInt());
|
metrics = intToMetrics(s->value(metricsKey, Walltime).toInt());
|
||||||
noCrashHandler = s->value(noCrashhandlerKey, true).toBool();
|
noCrashHandler = s->value(noCrashhandlerKey, true).toBool();
|
||||||
@@ -66,7 +66,7 @@ void QtTestSettings::fromFrameworkSettings(const QSettings *s)
|
|||||||
logSignalsSlots = s->value(logSignalsSlotsKey, false).toBool();
|
logSignalsSlots = s->value(logSignalsSlotsKey, false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtTestSettings::toFrameworkSettings(QSettings *s) const
|
void QtTestSettings::toTestSettings(QSettings *s) const
|
||||||
{
|
{
|
||||||
s->setValue(metricsKey, metrics);
|
s->setValue(metricsKey, metrics);
|
||||||
s->setValue(noCrashhandlerKey, noCrashHandler);
|
s->setValue(noCrashhandlerKey, noCrashHandler);
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../iframeworksettings.h"
|
#include "../itestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -39,7 +39,7 @@ enum MetricsType
|
|||||||
Perf
|
Perf
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtTestSettings : public IFrameworkSettings
|
class QtTestSettings : public ITestSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtTestSettings() {}
|
QtTestSettings() {}
|
||||||
@@ -53,8 +53,8 @@ public:
|
|||||||
bool logSignalsSlots = false;
|
bool logSignalsSlots = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void fromFrameworkSettings(const QSettings *s) override;
|
void fromTestSettings(const QSettings *s) override;
|
||||||
void toFrameworkSettings(QSettings *s) const override;
|
void toTestSettings(QSettings *s) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -46,7 +46,7 @@ QuickTestConfiguration::QuickTestConfiguration(ITestFramework *framework)
|
|||||||
TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const
|
QProcess *app) const
|
||||||
{
|
{
|
||||||
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->testSettings());
|
||||||
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput
|
const QtTestOutputReader::OutputMode mode = qtSettings && qtSettings->useXMLOutput
|
||||||
? QtTestOutputReader::XML
|
? QtTestOutputReader::XML
|
||||||
: QtTestOutputReader::PlainText;
|
: QtTestOutputReader::PlainText;
|
||||||
@@ -63,7 +63,7 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted)
|
|||||||
omitted, true));
|
omitted, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());
|
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->testSettings());
|
||||||
if (!qtSettings)
|
if (!qtSettings)
|
||||||
return arguments;
|
return arguments;
|
||||||
if (qtSettings->useXMLOutput)
|
if (qtSettings->useXMLOutput)
|
||||||
|
@@ -54,12 +54,12 @@ unsigned QuickTestFramework::priority() const
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
IFrameworkSettings *QuickTestFramework::frameworkSettings()
|
ITestSettings *QuickTestFramework::testSettings()
|
||||||
{
|
{
|
||||||
static const Utils::Id id
|
static const Utils::Id id
|
||||||
= Utils::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);
|
= Utils::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);
|
||||||
ITestFramework *qtTestFramework = TestFrameworkManager::frameworkForId(id);
|
ITestFramework *qtTestFramework = TestFrameworkManager::frameworkForId(id);
|
||||||
return qtTestFramework->frameworkSettings();
|
return qtTestFramework->testSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -44,7 +44,7 @@ public:
|
|||||||
QuickTestFramework() : ITestFramework(true) {}
|
QuickTestFramework() : ITestFramework(true) {}
|
||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
IFrameworkSettings *frameworkSettings() override;
|
ITestSettings *testSettings() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include "testframeworkmanager.h"
|
#include "testframeworkmanager.h"
|
||||||
#include "autotestconstants.h"
|
#include "autotestconstants.h"
|
||||||
#include "autotestplugin.h"
|
#include "autotestplugin.h"
|
||||||
#include "iframeworksettings.h"
|
#include "itestsettings.h"
|
||||||
#include "testsettings.h"
|
#include "testsettings.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -87,7 +87,7 @@ void TestFrameworkManager::synchronizeSettings(QSettings *s)
|
|||||||
{
|
{
|
||||||
Internal::AutotestPlugin::settings()->fromSettings(s);
|
Internal::AutotestPlugin::settings()->fromSettings(s);
|
||||||
for (ITestFramework *framework : qAsConst(m_registeredFrameworks)) {
|
for (ITestFramework *framework : qAsConst(m_registeredFrameworks)) {
|
||||||
if (IFrameworkSettings *fSettings = framework->frameworkSettings())
|
if (ITestSettings *fSettings = framework->testSettings())
|
||||||
fSettings->fromSettings(s);
|
fSettings->fromSettings(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ TestSettings TestSettingsWidget::settings() const
|
|||||||
result.popupOnFinish = m_ui.openResultsOnFinishCB->isChecked();
|
result.popupOnFinish = m_ui.openResultsOnFinishCB->isChecked();
|
||||||
result.popupOnFail = m_ui.openResultsOnFailCB->isChecked();
|
result.popupOnFail = m_ui.openResultsOnFailCB->isChecked();
|
||||||
result.runAfterBuild = RunAfterBuildMode(m_ui.runAfterBuildCB->currentIndex());
|
result.runAfterBuild = RunAfterBuildMode(m_ui.runAfterBuildCB->currentIndex());
|
||||||
frameworkSettings(result);
|
testSettings(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHash<Utils::Id, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestSettingsWidget::frameworkSettings(TestSettings &settings) const
|
void TestSettingsWidget::testSettings(TestSettings &settings) const
|
||||||
{
|
{
|
||||||
const QAbstractItemModel *model = m_ui.frameworkTreeWidget->model();
|
const QAbstractItemModel *model = m_ui.frameworkTreeWidget->model();
|
||||||
QTC_ASSERT(model, return);
|
QTC_ASSERT(model, return);
|
||||||
|
@@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void populateFrameworksListWidget(const QHash<Utils::Id, bool> &frameworks);
|
void populateFrameworksListWidget(const QHash<Utils::Id, bool> &frameworks);
|
||||||
void frameworkSettings(TestSettings &settings) const;
|
void testSettings(TestSettings &settings) const;
|
||||||
void onFrameworkItemChanged();
|
void onFrameworkItemChanged();
|
||||||
Ui::TestSettingsPage m_ui;
|
Ui::TestSettingsPage m_ui;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user