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