Merge remote-tracking branch 'origin/9.0'

Change-Id: I73396bcd07852ff5e01d73b06ebd64ab6af802e5
This commit is contained in:
Eike Ziller
2023-01-18 10:02:35 +01:00
3 changed files with 17 additions and 12 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())

View File

@@ -15,13 +15,6 @@
namespace Autotest {
namespace Internal {
static QString functionWithDataTagAsArg(const QString &func, const QString &dataTag)
{
if (dataTag.contains(' '))
return '"' + func + ':' + dataTag + '"';
return func + ':' + dataTag;
}
QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name,
const Utils::FilePath &filePath, TestTreeItem::Type type)
: TestTreeItem(testFramework, name, filePath, type)
@@ -147,8 +140,9 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const
const TestTreeItem *parent = function ? function->parentItem() : nullptr;
if (!parent)
return nullptr;
const QString functionWithTag = function->name() + ':' + name();
config = new QtTestConfiguration(framework());
config->setTestCases(QStringList(functionWithDataTagAsArg(function->name(), name())));
config->setTestCases(QStringList(functionWithTag));
config->setProjectFile(parent->proFile());
config->setProject(project);
break;
@@ -191,7 +185,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
const QString funcName = grandChild->name();
grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) {
if (dataTag->checked() == Qt::Checked)
testCases << functionWithDataTagAsArg(funcName, dataTag->name());
testCases << funcName + ':' + dataTag->name();
});
}
});
@@ -223,7 +217,7 @@ static void collectFailedTestInfo(TestTreeItem *item, QList<ITestConfiguration *
} else {
func->forFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) {
if (dataTag->data(0, FailedRole).toBool())
testCases << functionWithDataTagAsArg(func->name(), dataTag->name());
testCases << func->name() + ':' + dataTag->name();
});
}
});

View File

@@ -2177,8 +2177,8 @@ Environment CMakeBuildConfiguration::baseConfigureEnvironment() const
ProjectExplorer::IDevice::ConstPtr devicePtr = BuildDeviceKitAspect::device(kit());
result = devicePtr ? devicePtr->systemEnvironment() : Environment::systemEnvironment();
}
addToEnvironment(result);
kit()->addToBuildEnvironment(result);
addToEnvironment(result);
result.modify(project()->additionalEnvironment());
return result;
}