AutoTest: Remove confusing information

If there is no information regarding the tests to provide to
the user 'unknown' is not helpful either. Just give no hint if
we do not have any.
While at it ensure to provide only non-empty information.

Change-Id: Ia1667c2cfd35b0456bfd47c2d4a14ed4d0000a4d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2017-11-09 10:06:53 +01:00
parent 95c17c3f0d
commit 5b64c6ea82

View File

@@ -324,11 +324,12 @@ void TestRunner::prepareToRunTests(TestRunMode mode)
static QString firstTestCaseTarget(const TestConfiguration *config) static QString firstTestCaseTarget(const TestConfiguration *config)
{ {
const QSet<QString> &internalTargets = config->internalTargets(); for (const QString &internalTarget : config->internalTargets()) {
int size = internalTargets.size(); const QString buildTarget = internalTarget.split('|').first();
if (size) if (!buildTarget.isEmpty())
return (*internalTargets.begin()).split('|').first(); return buildTarget;
return TestRunner::tr("<unknown>"); }
return QString();
} }
static ProjectExplorer::RunConfiguration *getRunConfiguration(const QString &dialogDetail) static ProjectExplorer::RunConfiguration *getRunConfiguration(const QString &dialogDetail)
@@ -571,8 +572,10 @@ RunConfigurationSelectionDialog::RunConfigurationSelectionDialog(const QString &
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Select Run Configuration")); setWindowTitle(tr("Select Run Configuration"));
m_details = new QLabel(tr("Could not determine which run configuration to choose for running" QString details = tr("Could not determine which run configuration to choose for running tests");
" tests (%1)").arg(testsInfo), this); if (!testsInfo.isEmpty())
details.append(QString(" (%1)").arg(testsInfo));
m_details = new QLabel(details, this);
m_rcCombo = new QComboBox(this); m_rcCombo = new QComboBox(this);
m_executable = new QLabel(this); m_executable = new QLabel(this);
m_arguments = new QLabel(this); m_arguments = new QLabel(this);