AutoTest: Fix handling of test cases with comma

Fixes: QTCREATORBUG-27705
Change-Id: I6e22df4e401dc52e8d8599cc8b4de16200093b03
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2022-06-10 10:17:20 +02:00
parent a91043d8ba
commit 3b7029fbdc
2 changed files with 4 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con
{
QStringList arguments;
if (testCaseCount())
arguments << "\"" + testCases().join("\",\"") + "\"";
arguments << "\"" + testCases().join("\", \"") + "\"";
arguments << "--reporter" << "xml";
if (AutotestPlugin::settings()->processArgs) {

View File

@@ -37,7 +37,9 @@ namespace Internal {
QString CatchTreeItem::testCasesString() const
{
return m_state & CatchTreeItem::Parameterized ? QString(name() + " -*") : name();
QString testcase = m_state & CatchTreeItem::Parameterized ? QString(name() + " -*") : name();
// mask comma if it is part of the test case name
return testcase.replace(',', "\\,");
}
static QString nonRootDisplayName(const CatchTreeItem *it)