forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/9.0'"
This commit is contained in:
@@ -10,11 +10,22 @@
|
|||||||
#include "../itestframework.h"
|
#include "../itestframework.h"
|
||||||
#include "../testsettings.h"
|
#include "../testsettings.h"
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
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,
|
TestOutputReader *QtTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
Utils::QtcProcess *app) const
|
Utils::QtcProcess *app) const
|
||||||
{
|
{
|
||||||
@@ -39,7 +50,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
|
|||||||
if (qtSettings->useXMLOutput.value())
|
if (qtSettings->useXMLOutput.value())
|
||||||
arguments << "-xml";
|
arguments << "-xml";
|
||||||
if (!testCases().isEmpty())
|
if (!testCases().isEmpty())
|
||||||
arguments << testCases();
|
arguments << quoteIfNeeded(testCases(), isDebugRunMode());
|
||||||
|
|
||||||
const QString &metricsOption = QtTestSettings::metricsTypeToOption(MetricsType(qtSettings->metrics.value()));
|
const QString &metricsOption = QtTestSettings::metricsTypeToOption(MetricsType(qtSettings->metrics.value()));
|
||||||
if (!metricsOption.isEmpty())
|
if (!metricsOption.isEmpty())
|
||||||
|
@@ -15,13 +15,6 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
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,
|
QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name,
|
||||||
const Utils::FilePath &filePath, TestTreeItem::Type type)
|
const Utils::FilePath &filePath, TestTreeItem::Type type)
|
||||||
: TestTreeItem(testFramework, name, filePath, type)
|
: TestTreeItem(testFramework, name, filePath, type)
|
||||||
@@ -147,8 +140,9 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const
|
|||||||
const TestTreeItem *parent = function ? function->parentItem() : nullptr;
|
const TestTreeItem *parent = function ? function->parentItem() : nullptr;
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
const QString functionWithTag = function->name() + ':' + name();
|
||||||
config = new QtTestConfiguration(framework());
|
config = new QtTestConfiguration(framework());
|
||||||
config->setTestCases(QStringList(functionWithDataTagAsArg(function->name(), name())));
|
config->setTestCases(QStringList(functionWithTag));
|
||||||
config->setProjectFile(parent->proFile());
|
config->setProjectFile(parent->proFile());
|
||||||
config->setProject(project);
|
config->setProject(project);
|
||||||
break;
|
break;
|
||||||
@@ -191,7 +185,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
|
|||||||
const QString funcName = grandChild->name();
|
const QString funcName = grandChild->name();
|
||||||
grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) {
|
grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) {
|
||||||
if (dataTag->checked() == Qt::Checked)
|
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 {
|
} else {
|
||||||
func->forFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) {
|
func->forFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) {
|
||||||
if (dataTag->data(0, FailedRole).toBool())
|
if (dataTag->data(0, FailedRole).toBool())
|
||||||
testCases << functionWithDataTagAsArg(func->name(), dataTag->name());
|
testCases << func->name() + ':' + dataTag->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -2177,8 +2177,8 @@ Environment CMakeBuildConfiguration::baseConfigureEnvironment() const
|
|||||||
ProjectExplorer::IDevice::ConstPtr devicePtr = BuildDeviceKitAspect::device(kit());
|
ProjectExplorer::IDevice::ConstPtr devicePtr = BuildDeviceKitAspect::device(kit());
|
||||||
result = devicePtr ? devicePtr->systemEnvironment() : Environment::systemEnvironment();
|
result = devicePtr ? devicePtr->systemEnvironment() : Environment::systemEnvironment();
|
||||||
}
|
}
|
||||||
addToEnvironment(result);
|
|
||||||
kit()->addToBuildEnvironment(result);
|
kit()->addToBuildEnvironment(result);
|
||||||
|
addToEnvironment(result);
|
||||||
result.modify(project()->additionalEnvironment());
|
result.modify(project()->additionalEnvironment());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user