Add stop button and minor preparation for progress bar

This commit is contained in:
Christian Stenger
2014-11-03 08:30:22 +01:00
committed by Christian Stenger
parent 345b4de47a
commit 431d15bd0c
9 changed files with 56 additions and 6 deletions

View File

@@ -104,10 +104,16 @@ void TestRunner::runTests()
}
}
int testCaseCount = 0;
foreach (const TestConfiguration *config, m_selectedTests)
testCaseCount += config->testCaseCount();
// clear old log and output pane
m_xmlLog.clear();
TestResultsPane::instance()->clearContents();
emit testRunStarted();
foreach (TestConfiguration *tc, m_selectedTests) {
QString cmd = tc->targetFile();
QString workDir = tc->workingDirectory();
@@ -121,11 +127,18 @@ void TestRunner::runTests()
exec(cmd, args, workDir, env);
}
qDebug("test run finished");
emit testRunFinished();
}
void TestRunner::stopTestRun()
{
if (m_runner.state() != QProcess::NotRunning) {
m_runner.kill();
m_runner.waitForFinished();
TestResultsPane::instance()->addTestResult(
TestResult(QString(), QString(), QString(), ResultType::MESSAGE_FATAL,
tr("*** Test Run canceled by user ***")));
}
}
/******************** XML line parser helper ********************/