AutoTest: Redo handling of data tags with spaces

This basically reverts commit 7684571e10 as it broke running
the test inside the debugger.

Change-Id: Iacd46e2b9fb5af813fbf17156fd847375d750480
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-01-13 07:35:56 +01:00
parent 1b6d434c9c
commit 274bb27cf3
2 changed files with 16 additions and 11 deletions

View File

@@ -10,11 +10,22 @@
#include "../itestframework.h"
#include "../testsettings.h"
#include <utils/algorithm.h>
#include <utils/stringutils.h>
namespace Autotest {
namespace Internal {
static QStringList quoteIfNeeded(const QStringList &testCases, bool debugMode)
{
if (debugMode)
return testCases;
return Utils::transform(testCases, [](const QString &testCase){
return testCase.contains(' ') ? '"' + testCase + '"' : testCase;
});
}
TestOutputReader *QtTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
Utils::QtcProcess *app) const
{
@@ -39,7 +50,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
if (qtSettings->useXMLOutput.value())
arguments << "-xml";
if (!testCases().isEmpty())
arguments << testCases();
arguments << quoteIfNeeded(testCases(), isDebugRunMode());
const QString &metricsOption = QtTestSettings::metricsTypeToOption(MetricsType(qtSettings->metrics.value()));
if (!metricsOption.isEmpty())