forked from qt-creator/qt-creator
Autotest: Use new PagedSettings
Change-Id: If93494ef9e3f10e1b7bbc95a3930d3b36e83f8fc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
#include "boosttestsettings.h"
|
#include "boosttestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class BoostTestFramework : public ITestFramework
|
class BoostTestFramework : public ITestFramework
|
||||||
{
|
{
|
||||||
@@ -23,9 +22,7 @@ private:
|
|||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
ITestTreeItem *createRootNode() override;
|
ITestTreeItem *createRootNode() override;
|
||||||
|
|
||||||
BoostTestSettings m_settings;
|
BoostTestSettings m_settings{settingsId()};
|
||||||
BoostTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -10,13 +10,29 @@
|
|||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
BoostTestSettings::BoostTestSettings()
|
BoostTestSettings::BoostTestSettings(Id settingsId)
|
||||||
{
|
{
|
||||||
|
setId(settingsId);
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
||||||
|
setSettings(this);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
Row { Form {
|
||||||
|
logLevel, br,
|
||||||
|
reportLevel, br,
|
||||||
|
randomize, Row { seed }, br,
|
||||||
|
systemErrors, br,
|
||||||
|
fpExceptions, br,
|
||||||
|
memLeaks,
|
||||||
|
}, st}.attachTo(widget);
|
||||||
|
});
|
||||||
|
|
||||||
setSettingsGroups("Autotest", "BoostTest");
|
setSettingsGroups("Autotest", "BoostTest");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
|
||||||
@@ -81,30 +97,6 @@ BoostTestSettings::BoostTestSettings()
|
|||||||
memLeaks.setToolTip(Tr::tr("Enable memory leak detection."));
|
memLeaks.setToolTip(Tr::tr("Enable memory leak detection."));
|
||||||
}
|
}
|
||||||
|
|
||||||
BoostTestSettingsPage::BoostTestSettingsPage(BoostTestSettings *settings, Id settingsId)
|
|
||||||
{
|
|
||||||
setId(settingsId);
|
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
|
||||||
setSettings(settings);
|
|
||||||
|
|
||||||
setLayouter([settings](QWidget *widget) {
|
|
||||||
BoostTestSettings &s = *settings;
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Grid grid {
|
|
||||||
s.logLevel, br,
|
|
||||||
s.reportLevel, br,
|
|
||||||
s.randomize, Row { s.seed }, br,
|
|
||||||
s.systemErrors, br,
|
|
||||||
s.fpExceptions, br,
|
|
||||||
s.memLeaks,
|
|
||||||
};
|
|
||||||
|
|
||||||
Column { Row { Column { grid, st }, st } }.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BoostTestSettings::logLevelToOption(const LogLevel logLevel)
|
QString BoostTestSettings::logLevelToOption(const LogLevel logLevel)
|
||||||
{
|
{
|
||||||
switch (logLevel) {
|
switch (logLevel) {
|
||||||
@@ -134,5 +126,4 @@ QString BoostTestSettings::reportLevelToOption(const ReportLevel reportLevel)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
namespace Autotest {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
enum class LogLevel
|
enum class LogLevel
|
||||||
{
|
{
|
||||||
@@ -33,10 +30,10 @@ enum class ReportLevel
|
|||||||
No
|
No
|
||||||
};
|
};
|
||||||
|
|
||||||
class BoostTestSettings : public Utils::AspectContainer
|
class BoostTestSettings : public Core::PagedSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BoostTestSettings();
|
explicit BoostTestSettings(Utils::Id settingsId);
|
||||||
|
|
||||||
static QString logLevelToOption(const LogLevel logLevel);
|
static QString logLevelToOption(const LogLevel logLevel);
|
||||||
static QString reportLevelToOption(const ReportLevel reportLevel);
|
static QString reportLevelToOption(const ReportLevel reportLevel);
|
||||||
@@ -50,15 +47,7 @@ public:
|
|||||||
Utils::BoolAspect memLeaks;
|
Utils::BoolAspect memLeaks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // Autotest::Internal
|
||||||
class BoostTestSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BoostTestSettingsPage(BoostTestSettings *settings, Utils::Id settingsId);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Autotest::Internal::LogLevel)
|
Q_DECLARE_METATYPE(Autotest::Internal::LogLevel)
|
||||||
Q_DECLARE_METATYPE(Autotest::Internal::ReportLevel)
|
Q_DECLARE_METATYPE(Autotest::Internal::ReportLevel)
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
#include "catchtestsettings.h"
|
#include "catchtestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CatchFramework : public ITestFramework
|
class CatchFramework : public ITestFramework
|
||||||
{
|
{
|
||||||
@@ -25,9 +24,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ITestSettings * testSettings() override { return &m_settings; }
|
ITestSettings * testSettings() override { return &m_settings; }
|
||||||
CatchTestSettings m_settings;
|
CatchTestSettings m_settings{settingsId()};
|
||||||
CatchTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -10,13 +10,33 @@
|
|||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
CatchTestSettings::CatchTestSettings()
|
CatchTestSettings::CatchTestSettings(Id settingsId)
|
||||||
{
|
{
|
||||||
|
setId(settingsId);
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayName(Tr::tr("Catch Test"));
|
||||||
|
setSettings(this);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
Column { Row { Grid {
|
||||||
|
showSuccess, br,
|
||||||
|
breakOnFailure, br,
|
||||||
|
noThrow, br,
|
||||||
|
visibleWhitespace, br,
|
||||||
|
abortAfterChecked, abortAfter, br,
|
||||||
|
samplesChecked, benchmarkSamples, br,
|
||||||
|
resamplesChecked, benchmarkResamples, br,
|
||||||
|
confidenceIntervalChecked, confidenceInterval, br,
|
||||||
|
warmupChecked, benchmarkWarmupTime, br,
|
||||||
|
noAnalysis
|
||||||
|
}, st }, st }.attachTo(widget);
|
||||||
|
});
|
||||||
|
|
||||||
setSettingsGroups("Autotest", "Catch2");
|
setSettingsGroups("Autotest", "Catch2");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
|
||||||
@@ -108,33 +128,4 @@ CatchTestSettings::CatchTestSettings()
|
|||||||
warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion."));
|
warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion."));
|
||||||
}
|
}
|
||||||
|
|
||||||
CatchTestSettingsPage::CatchTestSettingsPage(CatchTestSettings *settings, Id settingsId)
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
setId(settingsId);
|
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayName(Tr::tr("Catch Test"));
|
|
||||||
setSettings(settings);
|
|
||||||
|
|
||||||
setLayouter([settings](QWidget *widget) {
|
|
||||||
CatchTestSettings &s = *settings;
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Grid col {
|
|
||||||
s.showSuccess, br,
|
|
||||||
s.breakOnFailure, br,
|
|
||||||
s.noThrow, br,
|
|
||||||
s.visibleWhitespace, br,
|
|
||||||
s.abortAfterChecked, s.abortAfter, br,
|
|
||||||
s.samplesChecked, s.benchmarkSamples, br,
|
|
||||||
s.resamplesChecked, s.benchmarkResamples, br,
|
|
||||||
s.confidenceIntervalChecked, s.confidenceInterval, br,
|
|
||||||
s.warmupChecked, s.benchmarkWarmupTime, br,
|
|
||||||
s.noAnalysis
|
|
||||||
};
|
|
||||||
|
|
||||||
Column { Row { col, st }, st }.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -5,15 +5,12 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
namespace Autotest {
|
class CatchTestSettings : public Core::PagedSettings
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CatchTestSettings : public Utils::AspectContainer
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CatchTestSettings();
|
explicit CatchTestSettings(Utils::Id settingsId);
|
||||||
|
|
||||||
Utils::IntegerAspect abortAfter;
|
Utils::IntegerAspect abortAfter;
|
||||||
Utils::IntegerAspect benchmarkSamples;
|
Utils::IntegerAspect benchmarkSamples;
|
||||||
@@ -33,11 +30,4 @@ public:
|
|||||||
Utils::BoolAspect warnOnEmpty;
|
Utils::BoolAspect warnOnEmpty;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CatchTestSettingsPage : public Core::IOptionsPage
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
public:
|
|
||||||
CatchTestSettingsPage(CatchTestSettings *settings, Utils::Id settingsId);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -8,14 +8,44 @@
|
|||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
namespace Autotest {
|
using namespace Layouting;
|
||||||
namespace Internal {
|
using namespace Utils;
|
||||||
|
|
||||||
CTestSettings::CTestSettings()
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
|
CTestSettings::CTestSettings(Id settingsId)
|
||||||
{
|
{
|
||||||
setSettingsGroups("Autotest", "CTest");
|
setSettingsGroups("Autotest", "CTest");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
|
||||||
|
setId(settingsId);
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayName(Tr::tr("CTest"));
|
||||||
|
|
||||||
|
setSettings(this);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *w) {
|
||||||
|
Column { Row { Form {
|
||||||
|
outputOnFail, br,
|
||||||
|
scheduleRandom, br,
|
||||||
|
stopOnFailure, br,
|
||||||
|
outputMode, br,
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Repeat tests")),
|
||||||
|
repeat.groupChecker(),
|
||||||
|
Row { repetitionMode, repetitionCount},
|
||||||
|
}, br,
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Run in parallel")),
|
||||||
|
parallel.groupChecker(),
|
||||||
|
Column {
|
||||||
|
Row { jobs }, br,
|
||||||
|
Row { testLoad, threshold}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, st }, st }.attachTo(w);
|
||||||
|
});
|
||||||
|
|
||||||
registerAspect(&outputOnFail);
|
registerAspect(&outputOnFail);
|
||||||
outputOnFail.setSettingsKey("OutputOnFail");
|
outputOnFail.setSettingsKey("OutputOnFail");
|
||||||
outputOnFail.setLabelText(Tr::tr("Output on failure"));
|
outputOnFail.setLabelText(Tr::tr("Output on failure"));
|
||||||
@@ -24,7 +54,7 @@ CTestSettings::CTestSettings()
|
|||||||
registerAspect(&outputMode);
|
registerAspect(&outputMode);
|
||||||
outputMode.setSettingsKey("OutputMode");
|
outputMode.setSettingsKey("OutputMode");
|
||||||
outputMode.setLabelText(Tr::tr("Output mode"));
|
outputMode.setLabelText(Tr::tr("Output mode"));
|
||||||
outputMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
|
outputMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
|
||||||
outputMode.addOption({Tr::tr("Default"), {}, 0});
|
outputMode.addOption({Tr::tr("Default"), {}, 0});
|
||||||
outputMode.addOption({Tr::tr("Verbose"), {}, 1});
|
outputMode.addOption({Tr::tr("Verbose"), {}, 1});
|
||||||
outputMode.addOption({Tr::tr("Very Verbose"), {}, 2});
|
outputMode.addOption({Tr::tr("Very Verbose"), {}, 2});
|
||||||
@@ -32,7 +62,7 @@ CTestSettings::CTestSettings()
|
|||||||
registerAspect(&repetitionMode);
|
registerAspect(&repetitionMode);
|
||||||
repetitionMode.setSettingsKey("RepetitionMode");
|
repetitionMode.setSettingsKey("RepetitionMode");
|
||||||
repetitionMode.setLabelText(Tr::tr("Repetition mode"));
|
repetitionMode.setLabelText(Tr::tr("Repetition mode"));
|
||||||
repetitionMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
|
repetitionMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
|
||||||
repetitionMode.addOption({Tr::tr("Until Fail"), {}, 0});
|
repetitionMode.addOption({Tr::tr("Until Fail"), {}, 0});
|
||||||
repetitionMode.addOption({Tr::tr("Until Pass"), {}, 1});
|
repetitionMode.addOption({Tr::tr("Until Pass"), {}, 1});
|
||||||
repetitionMode.addOption({Tr::tr("After Timeout"), {}, 2});
|
repetitionMode.addOption({Tr::tr("After Timeout"), {}, 2});
|
||||||
@@ -115,41 +145,4 @@ QStringList CTestSettings::activeSettingsAsOptions() const
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTestSettingsPage::CTestSettingsPage(CTestSettings *settings, Utils::Id settingsId)
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
setId(settingsId);
|
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayName(Tr::tr("CTest"));
|
|
||||||
|
|
||||||
setSettings(settings);
|
|
||||||
|
|
||||||
setLayouter([settings](QWidget *widget) {
|
|
||||||
CTestSettings &s = *settings;
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Form form {
|
|
||||||
Row {s.outputOnFail}, br,
|
|
||||||
Row {s.scheduleRandom}, br,
|
|
||||||
Row {s.stopOnFailure}, br,
|
|
||||||
Row {s.outputMode}, br,
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Repeat tests")),
|
|
||||||
s.repeat.groupChecker(),
|
|
||||||
Row {s.repetitionMode, s.repetitionCount},
|
|
||||||
}, br,
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Run in parallel")),
|
|
||||||
s.parallel.groupChecker(),
|
|
||||||
Column {
|
|
||||||
Row {s.jobs}, br,
|
|
||||||
Row {s.testLoad, s.threshold}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Column { Row { Column { form , st }, st } }.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -5,15 +5,12 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
namespace Autotest {
|
class CTestSettings : public Core::PagedSettings
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CTestSettings : public Utils::AspectContainer
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTestSettings();
|
explicit CTestSettings(Utils::Id settingsId);
|
||||||
|
|
||||||
QStringList activeSettingsAsOptions() const;
|
QStringList activeSettingsAsOptions() const;
|
||||||
|
|
||||||
@@ -31,12 +28,5 @@ public:
|
|||||||
Utils::IntegerAspect threshold;
|
Utils::IntegerAspect threshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CTestSettingsPage final : public Core::IOptionsPage
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
public:
|
|
||||||
CTestSettingsPage(CTestSettings *settings, Utils::Id settingsId);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
#include "../itestframework.h"
|
#include "../itestframework.h"
|
||||||
#include "ctestsettings.h"
|
#include "ctestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CTestTool final : public Autotest::ITestTool
|
class CTestTool final : public Autotest::ITestTool
|
||||||
{
|
{
|
||||||
@@ -26,9 +25,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
ITestSettings *testSettings() override { return &m_settings; }
|
ITestSettings *testSettings() override { return &m_settings; }
|
||||||
|
|
||||||
CTestSettings m_settings;
|
CTestSettings m_settings{settingsId()};
|
||||||
CTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
#include "gtestconstants.h"
|
#include "gtestconstants.h"
|
||||||
#include "gtestsettings.h"
|
#include "gtestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class GTestFramework : public ITestFramework
|
class GTestFramework : public ITestFramework
|
||||||
{
|
{
|
||||||
@@ -28,9 +27,7 @@ private:
|
|||||||
ITestParser *createTestParser() override;
|
ITestParser *createTestParser() override;
|
||||||
ITestTreeItem *createRootNode() override;
|
ITestTreeItem *createRootNode() override;
|
||||||
|
|
||||||
GTestSettings m_settings;
|
GTestSettings m_settings{settingsId()};
|
||||||
GTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -11,16 +11,36 @@
|
|||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
GTestSettings::GTestSettings()
|
GTestSettings::GTestSettings(Utils::Id settingsId)
|
||||||
{
|
{
|
||||||
setSettingsGroups("Autotest", "GTest");
|
setSettingsGroups("Autotest", "GTest");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
|
||||||
|
setId(settingsId);
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
||||||
|
setSettings(this);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
Column { Row { Column {
|
||||||
|
Grid {
|
||||||
|
runDisabled, br,
|
||||||
|
breakOnFailure, br,
|
||||||
|
repeat, iterations, br,
|
||||||
|
shuffle, seed
|
||||||
|
},
|
||||||
|
Form {
|
||||||
|
groupMode,
|
||||||
|
gtestFilter
|
||||||
|
}
|
||||||
|
}, st }, st }.attachTo(widget);
|
||||||
|
});
|
||||||
|
|
||||||
registerAspect(&iterations);
|
registerAspect(&iterations);
|
||||||
iterations.setSettingsKey("Iterations");
|
iterations.setSettingsKey("Iterations");
|
||||||
iterations.setDefaultValue(1);
|
iterations.setDefaultValue(1);
|
||||||
@@ -111,32 +131,4 @@ GTestSettings::GTestSettings()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
GTestSettingsPage::GTestSettingsPage(GTestSettings *settings, Id settingsId)
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
setId(settingsId);
|
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
|
||||||
setSettings(settings);
|
|
||||||
|
|
||||||
setLayouter([settings](QWidget *widget) {
|
|
||||||
GTestSettings &s = *settings;
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Grid grid {
|
|
||||||
s.runDisabled, br,
|
|
||||||
s.breakOnFailure, br,
|
|
||||||
s.repeat, s.iterations, br,
|
|
||||||
s.shuffle, s.seed
|
|
||||||
};
|
|
||||||
|
|
||||||
Form form {
|
|
||||||
s.groupMode,
|
|
||||||
s.gtestFilter
|
|
||||||
};
|
|
||||||
|
|
||||||
Column { Row { Column { grid, form, st }, st } }.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -5,15 +5,12 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
namespace Autotest {
|
class GTestSettings : public Core::PagedSettings
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class GTestSettings : public Utils::AspectContainer
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GTestSettings();
|
explicit GTestSettings(Utils::Id settingsId);
|
||||||
|
|
||||||
Utils::IntegerAspect iterations;
|
Utils::IntegerAspect iterations;
|
||||||
Utils::IntegerAspect seed;
|
Utils::IntegerAspect seed;
|
||||||
@@ -26,11 +23,4 @@ public:
|
|||||||
Utils::StringAspect gtestFilter;
|
Utils::StringAspect gtestFilter;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GTestSettingsPage final : public Core::IOptionsPage
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
public:
|
|
||||||
GTestSettingsPage(GTestSettings *settings, Utils::Id settingsId);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
#include "qttestsettings.h"
|
#include "qttestsettings.h"
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class QtTestFramework : public ITestFramework
|
class QtTestFramework : public ITestFramework
|
||||||
{
|
{
|
||||||
@@ -24,9 +23,7 @@ private:
|
|||||||
ITestTreeItem *createRootNode() override;
|
ITestTreeItem *createRootNode() override;
|
||||||
ITestSettings *testSettings() override { return &m_settings; }
|
ITestSettings *testSettings() override { return &m_settings; }
|
||||||
|
|
||||||
QtTestSettings m_settings;
|
QtTestSettings m_settings{settingsId()};
|
||||||
QtTestSettingsPage m_settingsPage{&m_settings, settingsId()};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // Autotest::Internal
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -10,15 +10,37 @@
|
|||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
QtTestSettings::QtTestSettings()
|
QtTestSettings::QtTestSettings(Id settingsId)
|
||||||
{
|
{
|
||||||
setSettingsGroups("Autotest", "QtTest");
|
setSettingsGroups("Autotest", "QtTest");
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
|
setId(settingsId);
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
||||||
|
setSettings(this);
|
||||||
|
|
||||||
|
setLayouter([this](QWidget *widget) {
|
||||||
|
Column { Row { Column {
|
||||||
|
noCrashHandler,
|
||||||
|
useXMLOutput,
|
||||||
|
verboseBench,
|
||||||
|
logSignalsSlots,
|
||||||
|
Row {
|
||||||
|
limitWarnings, maxWarnings
|
||||||
|
},
|
||||||
|
Group {
|
||||||
|
title(Tr::tr("Benchmark Metrics")),
|
||||||
|
Column { metrics }
|
||||||
|
},
|
||||||
|
br,
|
||||||
|
quickCheckForDerivedTests,
|
||||||
|
}, st }, st }.attachTo(widget);
|
||||||
|
});
|
||||||
|
|
||||||
registerAspect(&metrics);
|
registerAspect(&metrics);
|
||||||
metrics.setSettingsKey("Metrics");
|
metrics.setSettingsKey("Metrics");
|
||||||
@@ -99,36 +121,4 @@ QString QtTestSettings::metricsTypeToOption(const MetricsType type)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QtTestSettingsPage::QtTestSettingsPage(QtTestSettings *settings, Id settingsId)
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
setId(settingsId);
|
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
|
||||||
setSettings(settings);
|
|
||||||
|
|
||||||
setLayouter([settings](QWidget *widget) {
|
|
||||||
QtTestSettings &s = *settings;
|
|
||||||
using namespace Layouting;
|
|
||||||
|
|
||||||
Column col {
|
|
||||||
s.noCrashHandler,
|
|
||||||
s.useXMLOutput,
|
|
||||||
s.verboseBench,
|
|
||||||
s.logSignalsSlots,
|
|
||||||
Row {
|
|
||||||
s.limitWarnings, s.maxWarnings
|
|
||||||
},
|
|
||||||
Group {
|
|
||||||
title(Tr::tr("Benchmark Metrics")),
|
|
||||||
Column { s.metrics }
|
|
||||||
},
|
|
||||||
br,
|
|
||||||
s.quickCheckForDerivedTests,
|
|
||||||
};
|
|
||||||
|
|
||||||
Column { Row { col, st }, st }.attachTo(widget);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
namespace Autotest::Internal {
|
||||||
|
|
||||||
namespace Autotest {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
enum MetricsType
|
enum MetricsType
|
||||||
{
|
{
|
||||||
@@ -19,10 +16,10 @@ enum MetricsType
|
|||||||
Perf
|
Perf
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtTestSettings : public Utils::AspectContainer
|
class QtTestSettings : public Core::PagedSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtTestSettings();
|
explicit QtTestSettings(Utils::Id settingsId);
|
||||||
|
|
||||||
static QString metricsTypeToOption(const MetricsType type);
|
static QString metricsTypeToOption(const MetricsType type);
|
||||||
|
|
||||||
@@ -36,11 +33,4 @@ public:
|
|||||||
Utils::BoolAspect quickCheckForDerivedTests;
|
Utils::BoolAspect quickCheckForDerivedTests;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtTestSettingsPage final : public Core::IOptionsPage
|
} // Autotest::Internal
|
||||||
{
|
|
||||||
public:
|
|
||||||
QtTestSettingsPage(QtTestSettings *settings, Utils::Id settingsId);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Autotest
|
|
||||||
|
|||||||
Reference in New Issue
Block a user