forked from qt-creator/qt-creator
AutoTest: Add optional verbosity for Qt tests
Add options allowing verbose benchmarks and logging of signals and slots inside Qt tests. Beside this fixing a typo (recognition of results of type info) inside the plain text reader. Change-Id: Iaba7112c55bf30213584e56858d096c8f78307d0 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -67,6 +67,12 @@ QStringList QtTestConfiguration::argumentsForTestRunner() const
|
||||
if (!metricsOption.isEmpty())
|
||||
arguments << metricsOption;
|
||||
|
||||
if (qtSettings->verboseBench)
|
||||
arguments << "-vb";
|
||||
|
||||
if (qtSettings->logSignalsSlots)
|
||||
arguments << "-vs";
|
||||
|
||||
if (runMode() == DebuggableTestConfiguration::Debug) {
|
||||
if (qtSettings->noCrashHandler)
|
||||
arguments << "-nocrashhandler";
|
||||
|
@@ -31,6 +31,8 @@ namespace Internal {
|
||||
static const char metricsKey[] = "Metrics";
|
||||
static const char noCrashhandlerKey[] = "NoCrashhandlerOnDebug";
|
||||
static const char useXMLOutputKey[] = "UseXMLOutput";
|
||||
static const char verboseBenchKey[] = "VerboseBench";
|
||||
static const char logSignalsSlotsKey[] = "LogSignalsSlots";
|
||||
|
||||
static MetricsType intToMetrics(int value)
|
||||
{
|
||||
@@ -60,6 +62,8 @@ void QtTestSettings::fromFrameworkSettings(const QSettings *s)
|
||||
metrics = intToMetrics(s->value(metricsKey, Walltime).toInt());
|
||||
noCrashHandler = s->value(noCrashhandlerKey, true).toBool();
|
||||
useXMLOutput = s->value(useXMLOutputKey, true).toBool();
|
||||
verboseBench = s->value(verboseBenchKey, false).toBool();
|
||||
logSignalsSlots = s->value(logSignalsSlotsKey, false).toBool();
|
||||
}
|
||||
|
||||
void QtTestSettings::toFrameworkSettings(QSettings *s) const
|
||||
@@ -67,6 +71,8 @@ void QtTestSettings::toFrameworkSettings(QSettings *s) const
|
||||
s->setValue(metricsKey, metrics);
|
||||
s->setValue(noCrashhandlerKey, noCrashHandler);
|
||||
s->setValue(useXMLOutputKey, useXMLOutput);
|
||||
s->setValue(verboseBenchKey, verboseBench);
|
||||
s->setValue(logSignalsSlotsKey, logSignalsSlots);
|
||||
}
|
||||
|
||||
QString QtTestSettings::metricsTypeToOption(const MetricsType type)
|
||||
|
@@ -49,6 +49,8 @@ public:
|
||||
MetricsType metrics = Walltime;
|
||||
bool noCrashHandler = true;
|
||||
bool useXMLOutput = true;
|
||||
bool verboseBench = false;
|
||||
bool logSignalsSlots = false;
|
||||
|
||||
protected:
|
||||
void fromFrameworkSettings(const QSettings *s) override;
|
||||
|
@@ -47,6 +47,8 @@ void QtTestSettingsWidget::setSettings(const QtTestSettings &settings)
|
||||
{
|
||||
m_ui.disableCrashhandlerCB->setChecked(settings.noCrashHandler);
|
||||
m_ui.useXMLOutputCB->setChecked(settings.useXMLOutput);
|
||||
m_ui.verboseBenchmarksCB->setChecked(settings.verboseBench);
|
||||
m_ui.logSignalsAndSlotsCB->setChecked(settings.logSignalsSlots);
|
||||
switch (settings.metrics) {
|
||||
case MetricsType::Walltime:
|
||||
m_ui.walltimeRB->setChecked(true);
|
||||
@@ -74,6 +76,8 @@ QtTestSettings QtTestSettingsWidget::settings() const
|
||||
|
||||
result.noCrashHandler = m_ui.disableCrashhandlerCB->isChecked();
|
||||
result.useXMLOutput = m_ui.useXMLOutputCB->isChecked();
|
||||
result.verboseBench = m_ui.verboseBenchmarksCB->isChecked();
|
||||
result.logSignalsSlots = m_ui.logSignalsAndSlotsCB->isChecked();
|
||||
if (m_ui.walltimeRB->isChecked())
|
||||
result.metrics = MetricsType::Walltime;
|
||||
else if (m_ui.tickcounterRB->isChecked())
|
||||
|
@@ -46,6 +46,23 @@ Warning: Plain text output is missing some information (e.g. duration)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="verboseBenchmarksCB">
|
||||
<property name="text">
|
||||
<string>Verbose benchmarks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="logSignalsAndSlotsCB">
|
||||
<property name="toolTip">
|
||||
<string>Log every signal emission and resulting slot invocations.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log signals and slots</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
|
Reference in New Issue
Block a user