From 3b7029fbdc8d947c700145752f990ddd8d37e42a Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 10 Jun 2022 10:17:20 +0200 Subject: [PATCH] AutoTest: Fix handling of test cases with comma Fixes: QTCREATORBUG-27705 Change-Id: I6e22df4e401dc52e8d8599cc8b4de16200093b03 Reviewed-by: David Schulz --- src/plugins/autotest/catch/catchconfiguration.cpp | 2 +- src/plugins/autotest/catch/catchtreeitem.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/catch/catchconfiguration.cpp b/src/plugins/autotest/catch/catchconfiguration.cpp index 4a3436d476b..7d374413a51 100644 --- a/src/plugins/autotest/catch/catchconfiguration.cpp +++ b/src/plugins/autotest/catch/catchconfiguration.cpp @@ -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) { diff --git a/src/plugins/autotest/catch/catchtreeitem.cpp b/src/plugins/autotest/catch/catchtreeitem.cpp index 0108811008c..462f03dba84 100644 --- a/src/plugins/autotest/catch/catchtreeitem.cpp +++ b/src/plugins/autotest/catch/catchtreeitem.cpp @@ -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)