forked from qt-creator/qt-creator
AutoTest: Add some (debugging-related) options
Task-number: QTCREATORBUG-16694 Change-Id: Ie2c32c7e8fd73ba351d65a510af0d4d3574c9691 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -50,6 +50,13 @@ QStringList GTestConfiguration::argumentsForTestRunner(const TestSettings &setti
|
|||||||
arguments << QLatin1String("--gtest_shuffle")
|
arguments << QLatin1String("--gtest_shuffle")
|
||||||
<< QString::fromLatin1("--gtest_random_seed=%1").arg(settings.gtestSeed);
|
<< QString::fromLatin1("--gtest_random_seed=%1").arg(settings.gtestSeed);
|
||||||
}
|
}
|
||||||
|
if (settings.gtestThrowOnFailure)
|
||||||
|
arguments << "--gtest_throw_on_failure";
|
||||||
|
|
||||||
|
if (runMode() == DebuggableTestConfiguration::Debug) {
|
||||||
|
if (settings.gtestBreakOnFailure)
|
||||||
|
arguments << "--gtest_break_on_failure";
|
||||||
|
}
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ QStringList QtTestConfiguration::argumentsForTestRunner(const TestSettings &sett
|
|||||||
arguments << metricsOption;
|
arguments << metricsOption;
|
||||||
if (testCases().count())
|
if (testCases().count())
|
||||||
arguments << testCases();
|
arguments << testCases();
|
||||||
|
|
||||||
|
if (runMode() == DebuggableTestConfiguration::Debug) {
|
||||||
|
if (settings.qtestNoCrashHandler)
|
||||||
|
arguments << "-nocrashhandler";
|
||||||
|
}
|
||||||
|
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,11 +41,14 @@ static const char omitRunConfigWarnKey[] = "OmitRCWarnings";
|
|||||||
static const char limitResultOutputKey[] = "LimitResultOutput";
|
static const char limitResultOutputKey[] = "LimitResultOutput";
|
||||||
static const char autoScrollKey[] = "AutoScrollResults";
|
static const char autoScrollKey[] = "AutoScrollResults";
|
||||||
static const char alwaysParseKey[] = "AlwaysParse";
|
static const char alwaysParseKey[] = "AlwaysParse";
|
||||||
|
static const char qtestNoCrashhandlerKey[] = "NoCrashhandlerOnDebug";
|
||||||
static const char gtestRunDisabledKey[] = "RunDisabledGTests";
|
static const char gtestRunDisabledKey[] = "RunDisabledGTests";
|
||||||
static const char gtestRepeatKey[] = "RepeatGTests";
|
static const char gtestRepeatKey[] = "RepeatGTests";
|
||||||
static const char gtestShuffleKey[] = "ShuffleGTests";
|
static const char gtestShuffleKey[] = "ShuffleGTests";
|
||||||
static const char gtestIterationsKey[] = "IterationsGTests";
|
static const char gtestIterationsKey[] = "IterationsGTests";
|
||||||
static const char gtestSeedKey[] = "SeedGTests";
|
static const char gtestSeedKey[] = "SeedGTests";
|
||||||
|
static const char gtestThrowOnFailureKey[] = "ThrowOnFailure";
|
||||||
|
static const char gtestBreakOnFailureKey[] = "BreakOnFailure";
|
||||||
|
|
||||||
static const int defaultTimeout = 60000;
|
static const int defaultTimeout = 60000;
|
||||||
|
|
||||||
@@ -65,11 +68,14 @@ void TestSettings::toSettings(QSettings *s) const
|
|||||||
s->setValue(QLatin1String(limitResultOutputKey), limitResultOutput);
|
s->setValue(QLatin1String(limitResultOutputKey), limitResultOutput);
|
||||||
s->setValue(QLatin1String(autoScrollKey), autoScroll);
|
s->setValue(QLatin1String(autoScrollKey), autoScroll);
|
||||||
s->setValue(QLatin1String(alwaysParseKey), alwaysParse);
|
s->setValue(QLatin1String(alwaysParseKey), alwaysParse);
|
||||||
|
s->setValue(QLatin1String(qtestNoCrashhandlerKey), qtestNoCrashHandler);
|
||||||
s->setValue(QLatin1String(gtestRunDisabledKey), gtestRunDisabled);
|
s->setValue(QLatin1String(gtestRunDisabledKey), gtestRunDisabled);
|
||||||
s->setValue(QLatin1String(gtestRepeatKey), gtestRepeat);
|
s->setValue(QLatin1String(gtestRepeatKey), gtestRepeat);
|
||||||
s->setValue(QLatin1String(gtestShuffleKey), gtestShuffle);
|
s->setValue(QLatin1String(gtestShuffleKey), gtestShuffle);
|
||||||
s->setValue(QLatin1String(gtestIterationsKey), gtestIterations);
|
s->setValue(QLatin1String(gtestIterationsKey), gtestIterations);
|
||||||
s->setValue(QLatin1String(gtestSeedKey), gtestSeed);
|
s->setValue(QLatin1String(gtestSeedKey), gtestSeed);
|
||||||
|
s->setValue(QLatin1String(gtestBreakOnFailureKey), gtestBreakOnFailure);
|
||||||
|
s->setValue(QLatin1String(gtestThrowOnFailureKey), gtestThrowOnFailure);
|
||||||
// store frameworks and their current active state
|
// store frameworks and their current active state
|
||||||
for (const Core::Id &id : frameworks.keys())
|
for (const Core::Id &id : frameworks.keys())
|
||||||
s->setValue(QLatin1String(id.name()), frameworks.value(id));
|
s->setValue(QLatin1String(id.name()), frameworks.value(id));
|
||||||
@@ -104,11 +110,14 @@ void TestSettings::fromSettings(const QSettings *s)
|
|||||||
limitResultOutput = s->value(root + QLatin1String(limitResultOutputKey), true).toBool();
|
limitResultOutput = s->value(root + QLatin1String(limitResultOutputKey), true).toBool();
|
||||||
autoScroll = s->value(root + QLatin1String(autoScrollKey), true).toBool();
|
autoScroll = s->value(root + QLatin1String(autoScrollKey), true).toBool();
|
||||||
alwaysParse = s->value(root + QLatin1String(alwaysParseKey), true).toBool();
|
alwaysParse = s->value(root + QLatin1String(alwaysParseKey), true).toBool();
|
||||||
|
qtestNoCrashHandler = s->value(root + QLatin1String(qtestNoCrashhandlerKey), true).toBool();
|
||||||
gtestRunDisabled = s->value(root + QLatin1String(gtestRunDisabledKey), false).toBool();
|
gtestRunDisabled = s->value(root + QLatin1String(gtestRunDisabledKey), false).toBool();
|
||||||
gtestRepeat = s->value(root + QLatin1String(gtestRepeatKey), false).toBool();
|
gtestRepeat = s->value(root + QLatin1String(gtestRepeatKey), false).toBool();
|
||||||
gtestShuffle = s->value(root + QLatin1String(gtestShuffleKey), false).toBool();
|
gtestShuffle = s->value(root + QLatin1String(gtestShuffleKey), false).toBool();
|
||||||
gtestIterations = s->value(root + QLatin1String(gtestIterationsKey), 1).toInt();
|
gtestIterations = s->value(root + QLatin1String(gtestIterationsKey), 1).toInt();
|
||||||
gtestSeed = s->value(root + QLatin1String(gtestSeedKey), 0).toInt();
|
gtestSeed = s->value(root + QLatin1String(gtestSeedKey), 0).toInt();
|
||||||
|
gtestBreakOnFailure = s->value(root + QLatin1String(gtestBreakOnFailureKey), true).toBool();
|
||||||
|
gtestThrowOnFailure = s->value(root + QLatin1String(gtestThrowOnFailureKey), false).toBool();
|
||||||
// try to get settings for registered frameworks
|
// try to get settings for registered frameworks
|
||||||
TestFrameworkManager *frameworkManager = TestFrameworkManager::instance();
|
TestFrameworkManager *frameworkManager = TestFrameworkManager::instance();
|
||||||
const QList<Core::Id> ®istered = frameworkManager->registeredFrameworkIds();
|
const QList<Core::Id> ®istered = frameworkManager->registeredFrameworkIds();
|
||||||
@@ -127,9 +136,12 @@ bool TestSettings::equals(const TestSettings &rhs) const
|
|||||||
&& limitResultOutput == rhs.limitResultOutput
|
&& limitResultOutput == rhs.limitResultOutput
|
||||||
&& autoScroll == rhs.autoScroll
|
&& autoScroll == rhs.autoScroll
|
||||||
&& alwaysParse == rhs.alwaysParse
|
&& alwaysParse == rhs.alwaysParse
|
||||||
|
&& qtestNoCrashHandler == rhs.qtestNoCrashHandler
|
||||||
&& gtestRunDisabled == rhs.gtestRunDisabled
|
&& gtestRunDisabled == rhs.gtestRunDisabled
|
||||||
&& gtestRepeat == rhs.gtestRepeat && gtestIterations == rhs.gtestIterations
|
&& gtestRepeat == rhs.gtestRepeat && gtestIterations == rhs.gtestIterations
|
||||||
&& gtestShuffle == rhs.gtestShuffle && gtestSeed == rhs.gtestSeed
|
&& gtestShuffle == rhs.gtestShuffle && gtestSeed == rhs.gtestSeed
|
||||||
|
&& gtestBreakOnFailure == rhs.gtestBreakOnFailure
|
||||||
|
&& gtestThrowOnFailure == rhs.gtestThrowOnFailure
|
||||||
&& frameworks == rhs.frameworks;
|
&& frameworks == rhs.frameworks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,12 @@ struct TestSettings
|
|||||||
bool limitResultOutput;
|
bool limitResultOutput;
|
||||||
bool autoScroll;
|
bool autoScroll;
|
||||||
bool alwaysParse;
|
bool alwaysParse;
|
||||||
|
bool qtestNoCrashHandler;
|
||||||
bool gtestRunDisabled;
|
bool gtestRunDisabled;
|
||||||
bool gtestShuffle;
|
bool gtestShuffle;
|
||||||
bool gtestRepeat;
|
bool gtestRepeat;
|
||||||
|
bool gtestThrowOnFailure;
|
||||||
|
bool gtestBreakOnFailure;
|
||||||
QHash<Core::Id, bool> frameworks;
|
QHash<Core::Id, bool> frameworks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -64,11 +64,14 @@ void TestSettingsWidget::setSettings(const TestSettings &settings)
|
|||||||
m_ui.limitResultOutputCB->setChecked(settings.limitResultOutput);
|
m_ui.limitResultOutputCB->setChecked(settings.limitResultOutput);
|
||||||
m_ui.autoScrollCB->setChecked(settings.autoScroll);
|
m_ui.autoScrollCB->setChecked(settings.autoScroll);
|
||||||
m_ui.alwaysParseCB->setChecked(settings.alwaysParse);
|
m_ui.alwaysParseCB->setChecked(settings.alwaysParse);
|
||||||
|
m_ui.disableCrashhandlerCB->setChecked(settings.qtestNoCrashHandler);
|
||||||
m_ui.runDisabledGTestsCB->setChecked(settings.gtestRunDisabled);
|
m_ui.runDisabledGTestsCB->setChecked(settings.gtestRunDisabled);
|
||||||
m_ui.repeatGTestsCB->setChecked(settings.gtestRepeat);
|
m_ui.repeatGTestsCB->setChecked(settings.gtestRepeat);
|
||||||
m_ui.shuffleGTestsCB->setChecked(settings.gtestShuffle);
|
m_ui.shuffleGTestsCB->setChecked(settings.gtestShuffle);
|
||||||
m_ui.repetitionSpin->setValue(settings.gtestIterations);
|
m_ui.repetitionSpin->setValue(settings.gtestIterations);
|
||||||
m_ui.seedSpin->setValue(settings.gtestSeed);
|
m_ui.seedSpin->setValue(settings.gtestSeed);
|
||||||
|
m_ui.breakOnFailureCB->setChecked(settings.gtestBreakOnFailure);
|
||||||
|
m_ui.throwOnFailureCB->setChecked(settings.gtestThrowOnFailure);
|
||||||
|
|
||||||
switch (settings.metrics) {
|
switch (settings.metrics) {
|
||||||
case MetricsType::Walltime:
|
case MetricsType::Walltime:
|
||||||
@@ -101,11 +104,14 @@ TestSettings TestSettingsWidget::settings() const
|
|||||||
result.limitResultOutput = m_ui.limitResultOutputCB->isChecked();
|
result.limitResultOutput = m_ui.limitResultOutputCB->isChecked();
|
||||||
result.autoScroll = m_ui.autoScrollCB->isChecked();
|
result.autoScroll = m_ui.autoScrollCB->isChecked();
|
||||||
result.alwaysParse = m_ui.alwaysParseCB->isChecked();
|
result.alwaysParse = m_ui.alwaysParseCB->isChecked();
|
||||||
|
result.qtestNoCrashHandler = m_ui.disableCrashhandlerCB->isChecked();
|
||||||
result.gtestRunDisabled = m_ui.runDisabledGTestsCB->isChecked();
|
result.gtestRunDisabled = m_ui.runDisabledGTestsCB->isChecked();
|
||||||
result.gtestRepeat = m_ui.repeatGTestsCB->isChecked();
|
result.gtestRepeat = m_ui.repeatGTestsCB->isChecked();
|
||||||
result.gtestShuffle = m_ui.shuffleGTestsCB->isChecked();
|
result.gtestShuffle = m_ui.shuffleGTestsCB->isChecked();
|
||||||
result.gtestIterations = m_ui.repetitionSpin->value();
|
result.gtestIterations = m_ui.repetitionSpin->value();
|
||||||
result.gtestSeed = m_ui.seedSpin->value();
|
result.gtestSeed = m_ui.seedSpin->value();
|
||||||
|
result.gtestBreakOnFailure = m_ui.breakOnFailureCB->isChecked();
|
||||||
|
result.gtestThrowOnFailure = m_ui.throwOnFailureCB->isChecked();
|
||||||
|
|
||||||
if (m_ui.walltimeRB->isChecked())
|
if (m_ui.walltimeRB->isChecked())
|
||||||
result.metrics = MetricsType::Walltime;
|
result.metrics = MetricsType::Walltime;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>574</width>
|
<width>655</width>
|
||||||
<height>404</height>
|
<height>427</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -203,11 +203,33 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_5">
|
||||||
|
<property name="title">
|
||||||
|
<string>Qt Test</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableCrashhandlerCB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Enables interrupting tests on assertions.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable crash handler while debugging</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Benchmark Metrics</string>
|
<string>Benchmark Metrics</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="walltimeRB">
|
<widget class="QRadioButton" name="walltimeRB">
|
||||||
@@ -314,6 +336,9 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -439,6 +464,29 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="throwOnFailureCB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Turn assertion failures into C++ exceptions.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Throw on failure</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="breakOnFailureCB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Turn failures into debugger breakpoints.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Break on failure while debugging</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user