AutoTests: Aspectify parts of main settings

Change-Id: I407b5102e1f2a6647f6fdca01a61dfa422c5d3ee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-12 11:00:00 +02:00
parent 4c1a161abd
commit 30af7a9503
18 changed files with 205 additions and 262 deletions

View File

@@ -3,18 +3,9 @@
#pragma once
#include <QHash>
#include <utils/aspects.h>
namespace Utils {
class Id;
}
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace Autotest {
namespace Internal {
namespace Autotest::Internal {
enum class RunAfterBuildMode
{
@@ -23,29 +14,39 @@ enum class RunAfterBuildMode
Selected
};
struct TestSettings
class NonAspectSettings
{
TestSettings();
void toSettings(QSettings *s) const;
void fromSettings(QSettings *s);
int timeout;
bool omitInternalMssg = true;
bool omitRunConfigWarn = false;
bool limitResultOutput = true;
bool limitResultDescription = false;
int resultDescriptionMaxSize = 10;
bool autoScroll = true;
bool processArgs = false;
bool displayApplication = false;
bool popupOnStart = true;
bool popupOnFinish = true;
bool popupOnFail = false;
RunAfterBuildMode runAfterBuild = RunAfterBuildMode::None;
public:
QHash<Utils::Id, bool> frameworks;
QHash<Utils::Id, bool> frameworksGrouping;
QHash<Utils::Id, bool> tools;
};
} // namespace Internal
} // namespace Autotest
class TestSettings : public Utils::AspectContainer, public NonAspectSettings
{
public:
TestSettings();
static TestSettings *instance();
void toSettings(QSettings *s) const;
void fromSettings(QSettings *s);
Utils::IntegerAspect timeout;
Utils::BoolAspect omitInternalMsg;
Utils::BoolAspect omitRunConfigWarn;
Utils::BoolAspect limitResultOutput;
Utils::BoolAspect limitResultDescription;
Utils::IntegerAspect resultDescriptionMaxSize;
Utils::BoolAspect autoScroll;
Utils::BoolAspect processArgs;
Utils::BoolAspect displayApplication;
Utils::BoolAspect popupOnStart;
Utils::BoolAspect popupOnFinish;
Utils::BoolAspect popupOnFail;
Utils::SelectionAspect runAfterBuild;
RunAfterBuildMode runAfterBuildMode() const;
};
} // Autotest::Internal