forked from qt-creator/qt-creator
AutoTest: Reindent properly runTestsHelper() [part 1]
Otherwise the parent diff looks giant. Change-Id: I998f08d271bf231ad33154aeab5b349b1c1e83ad Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -347,22 +347,22 @@ void TestRunner::runTestsHelper()
|
|||||||
std::unique_ptr<TestOutputReader> m_outputReader;
|
std::unique_ptr<TestOutputReader> m_outputReader;
|
||||||
};
|
};
|
||||||
|
|
||||||
const QList<ITestConfiguration *> selectedTests = m_selectedTests;
|
const QList<ITestConfiguration *> selectedTests = m_selectedTests;
|
||||||
const LoopRepeat repeater(selectedTests.size());
|
const LoopRepeat repeater(selectedTests.size());
|
||||||
const Storage<TestStorage> storage;
|
const Storage<TestStorage> storage;
|
||||||
|
|
||||||
const auto onSetup = [this, selectedTests, repeater] {
|
const auto onSetup = [this, selectedTests, repeater] {
|
||||||
ITestConfiguration *config = selectedTests.at(repeater.iteration());
|
ITestConfiguration *config = selectedTests.at(repeater.iteration());
|
||||||
QTC_ASSERT(config, return SetupResult::StopWithError);
|
QTC_ASSERT(config, return SetupResult::StopWithError);
|
||||||
if (!config->project())
|
if (!config->project())
|
||||||
return SetupResult::StopWithSuccess;
|
return SetupResult::StopWithSuccess;
|
||||||
if (config->testExecutable().isEmpty()) {
|
if (config->testExecutable().isEmpty()) {
|
||||||
reportResult(ResultType::MessageFatal,
|
reportResult(ResultType::MessageFatal,
|
||||||
Tr::tr("Executable path is empty. (%1)").arg(config->displayName()));
|
Tr::tr("Executable path is empty. (%1)").arg(config->displayName()));
|
||||||
return SetupResult::StopWithSuccess;
|
return SetupResult::StopWithSuccess;
|
||||||
}
|
}
|
||||||
return SetupResult::Continue;
|
return SetupResult::Continue;
|
||||||
};
|
};
|
||||||
const auto onProcessSetup = [this, selectedTests, repeater, storage](Process &process) {
|
const auto onProcessSetup = [this, selectedTests, repeater, storage](Process &process) {
|
||||||
ITestConfiguration *config = selectedTests.at(repeater.iteration());
|
ITestConfiguration *config = selectedTests.at(repeater.iteration());
|
||||||
TestStorage *testStorage = storage.activeStorage();
|
TestStorage *testStorage = storage.activeStorage();
|
||||||
@@ -424,28 +424,28 @@ void TestRunner::runTestsHelper()
|
|||||||
if (testStorage->m_outputReader)
|
if (testStorage->m_outputReader)
|
||||||
testStorage->m_outputReader->onDone(process.exitCode());
|
testStorage->m_outputReader->onDone(process.exitCode());
|
||||||
|
|
||||||
if (process.exitStatus() == QProcess::CrashExit) {
|
if (process.exitStatus() == QProcess::CrashExit) {
|
||||||
if (testStorage->m_outputReader)
|
if (testStorage->m_outputReader)
|
||||||
testStorage->m_outputReader->reportCrash();
|
testStorage->m_outputReader->reportCrash();
|
||||||
reportResult(ResultType::MessageFatal,
|
reportResult(ResultType::MessageFatal,
|
||||||
Tr::tr("Test for project \"%1\" crashed.").arg(config->displayName())
|
Tr::tr("Test for project \"%1\" crashed.").arg(config->displayName())
|
||||||
+ processInformation(&process) + rcInfo(config));
|
+ processInformation(&process) + rcInfo(config));
|
||||||
} else if (testStorage->m_outputReader && !testStorage->m_outputReader->hadValidOutput()) {
|
} else if (testStorage->m_outputReader && !testStorage->m_outputReader->hadValidOutput()) {
|
||||||
reportResult(ResultType::MessageFatal,
|
reportResult(ResultType::MessageFatal,
|
||||||
Tr::tr("Test for project \"%1\" did not produce any expected output.")
|
Tr::tr("Test for project \"%1\" did not produce any expected output.")
|
||||||
.arg(config->displayName()) + processInformation(&process)
|
.arg(config->displayName()) + processInformation(&process)
|
||||||
+ rcInfo(config));
|
+ rcInfo(config));
|
||||||
}
|
}
|
||||||
if (testStorage->m_outputReader) {
|
if (testStorage->m_outputReader) {
|
||||||
const int disabled = testStorage->m_outputReader->disabledTests();
|
const int disabled = testStorage->m_outputReader->disabledTests();
|
||||||
if (disabled > 0)
|
if (disabled > 0)
|
||||||
emit hadDisabledTests(disabled);
|
emit hadDisabledTests(disabled);
|
||||||
if (testStorage->m_outputReader->hasSummary())
|
if (testStorage->m_outputReader->hasSummary())
|
||||||
emit reportSummary(testStorage->m_outputReader->id(), testStorage->m_outputReader->summary());
|
emit reportSummary(testStorage->m_outputReader->id(), testStorage->m_outputReader->summary());
|
||||||
|
|
||||||
testStorage->m_outputReader->resetCommandlineColor();
|
testStorage->m_outputReader->resetCommandlineColor();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const Group root {
|
const Group root {
|
||||||
finishAllAndSuccess,
|
finishAllAndSuccess,
|
||||||
|
|||||||
Reference in New Issue
Block a user