AutoTest: Register more aspects directly

Change-Id: I4dbf9cebb12fecc765aeac8e082061c29496f81a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-26 09:25:44 +02:00
parent d2ed96a055
commit 0e60643430
2 changed files with 13 additions and 26 deletions

View File

@@ -28,7 +28,6 @@ TestSettings::TestSettings()
setSettingsGroup(Constants::SETTINGSGROUP);
registerAspect(&timeout);
timeout.setSettingsKey("Timeout");
timeout.setDefaultValue(defaultTimeout);
timeout.setRange(5000, 36'000'000); // 36 Mio ms = 36'000 s = 10 h
@@ -37,44 +36,37 @@ TestSettings::TestSettings()
timeout.setToolTip(Tr::tr("Timeout used when executing test cases. This will apply "
"for each test case on its own, not the whole project."));
registerAspect(&omitInternalMsg);
omitInternalMsg.setSettingsKey("OmitInternal");
omitInternalMsg.setDefaultValue(true);
omitInternalMsg.setLabelText(Tr::tr("Omit internal messages"));
omitInternalMsg.setToolTip(Tr::tr("Hides internal messages by default. "
"You can still enable them by using the test results filter."));
registerAspect(&omitRunConfigWarn);
omitRunConfigWarn.setSettingsKey("OmitRCWarnings");
omitRunConfigWarn.setLabelText(Tr::tr("Omit run configuration warnings"));
omitRunConfigWarn.setToolTip(Tr::tr("Hides warnings related to a deduced run configuration."));
registerAspect(&limitResultOutput);
limitResultOutput.setSettingsKey("LimitResultOutput");
limitResultOutput.setDefaultValue(true);
limitResultOutput.setLabelText(Tr::tr("Limit result output"));
limitResultOutput.setToolTip(Tr::tr("Limits result output to 100000 characters."));
registerAspect(&limitResultDescription);
limitResultDescription.setSettingsKey("LimitResultDescription");
limitResultDescription.setLabelText(Tr::tr("Limit result description:"));
limitResultDescription.setToolTip(
Tr::tr("Limit number of lines shown in test result tooltip and description."));
registerAspect(&resultDescriptionMaxSize);
resultDescriptionMaxSize.setSettingsKey("ResultDescriptionMaxSize");
resultDescriptionMaxSize.setDefaultValue(10);
resultDescriptionMaxSize.setRange(1, 100000);
resultDescriptionMaxSize.setEnabler(&limitResultDescription);
registerAspect(&autoScroll);
autoScroll.setSettingsKey("AutoScrollResults");
autoScroll.setDefaultValue(true);
autoScroll.setLabelText(Tr::tr("Automatically scroll results"));
autoScroll.setToolTip(Tr::tr("Automatically scrolls down when new items are added "
"and scrollbar is at bottom."));
registerAspect(&processArgs);
processArgs.setSettingsKey("ProcessArgs");
processArgs.setLabelText(Tr::tr("Process arguments"));
processArgs.setToolTip(
@@ -82,31 +74,26 @@ TestSettings::TestSettings()
"Warning: this is an experimental feature and might lead to failing to "
"execute the test executable."));
registerAspect(&displayApplication);
displayApplication.setSettingsKey("DisplayApp");
displayApplication.setLabelText(Tr::tr("Group results by application"));
registerAspect(&popupOnStart);
popupOnStart.setSettingsKey("PopupOnStart");
popupOnStart.setLabelText(Tr::tr("Open results when tests start"));
popupOnStart.setToolTip(
Tr::tr("Displays test results automatically when tests are started."));
registerAspect(&popupOnFinish);
popupOnFinish.setSettingsKey("PopupOnFinish");
popupOnFinish.setDefaultValue(true);
popupOnFinish.setLabelText(Tr::tr("Open results when tests finish"));
popupOnFinish.setToolTip(
Tr::tr("Displays test results automatically when tests are finished."));
registerAspect(&popupOnFail);
popupOnFail.setSettingsKey("PopupOnFail");
popupOnFail.setLabelText(Tr::tr("Only for unsuccessful test runs"));
popupOnFail.setEnabler(&popupOnFinish);
popupOnFail.setToolTip(Tr::tr("Displays test results only if the test run contains "
"failed, fatal or unexpectedly passed tests."));
registerAspect(&runAfterBuild);
runAfterBuild.setSettingsKey("RunAfterBuild");
runAfterBuild.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox);
runAfterBuild.setToolTip(Tr::tr("Runs chosen tests automatically if a build succeeded."));

View File

@@ -32,19 +32,19 @@ public:
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;
Utils::IntegerAspect timeout{this};
Utils::BoolAspect omitInternalMsg{this};
Utils::BoolAspect omitRunConfigWarn{this};
Utils::BoolAspect limitResultOutput{this};
Utils::BoolAspect limitResultDescription{this};
Utils::IntegerAspect resultDescriptionMaxSize{this};
Utils::BoolAspect autoScroll{this};
Utils::BoolAspect processArgs{this};
Utils::BoolAspect displayApplication{this};
Utils::BoolAspect popupOnStart{this};
Utils::BoolAspect popupOnFinish{this};
Utils::BoolAspect popupOnFail{this};
Utils::SelectionAspect runAfterBuild{this};
RunAfterBuildMode runAfterBuildMode() const;
};