Changeset View
Changeset View
Standalone View
Standalone View
projectmanagers/cmake/testing/ctestrunjob.cpp
Show All 30 Lines | |||||
31 | #include <interfaces/ilaunchmode.h> | 31 | #include <interfaces/ilaunchmode.h> | ||
32 | #include <util/executecompositejob.h> | 32 | #include <util/executecompositejob.h> | ||
33 | 33 | | |||
34 | #include <KConfigGroup> | 34 | #include <KConfigGroup> | ||
35 | #include <KLocalizedString> | 35 | #include <KLocalizedString> | ||
36 | 36 | | |||
37 | using namespace KDevelop; | 37 | using namespace KDevelop; | ||
38 | 38 | | |||
39 | CTestRunJob::CTestRunJob(CTestSuite* suite, const QStringList& cases, OutputJob::OutputJobVerbosity verbosity, bool expectFail, QObject* parent) | 39 | CTestRunJob::CTestRunJob(CTestSuite* suite, const QStringList& cases, OutputJob::OutputJobVerbosity verbosity, QObject* parent) | ||
40 | : KJob(parent) | 40 | : KJob(parent) | ||
41 | , m_suite(suite) | 41 | , m_suite(suite) | ||
42 | , m_cases(cases) | 42 | , m_cases(cases) | ||
43 | , m_job(nullptr) | 43 | , m_job(nullptr) | ||
44 | , m_outputJob(nullptr) | 44 | , m_outputJob(nullptr) | ||
45 | , m_verbosity(verbosity) | 45 | , m_verbosity(verbosity) | ||
46 | , m_expectFail(expectFail) | | |||
47 | { | 46 | { | ||
48 | foreach (const QString& testCase, cases) | 47 | foreach (const QString& testCase, cases) | ||
49 | { | 48 | { | ||
50 | m_caseResults[testCase] = TestResult::NotRun; | 49 | m_caseResults[testCase] = TestResult::NotRun; | ||
51 | } | 50 | } | ||
52 | 51 | | |||
53 | setCapabilities(Killable); | 52 | setCapabilities(Killable); | ||
54 | } | 53 | } | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 178 | { | |||
183 | if (caseRx.indexIn(line) >= 0) { | 182 | if (caseRx.indexIn(line) >= 0) { | ||
184 | testCase = caseRx.cap(1); | 183 | testCase = caseRx.cap(1); | ||
185 | } | 184 | } | ||
186 | 185 | | |||
187 | TestResult::TestCaseResult prevResult = m_caseResults.value(testCase, TestResult::NotRun); | 186 | TestResult::TestCaseResult prevResult = m_caseResults.value(testCase, TestResult::NotRun); | ||
188 | if (prevResult == TestResult::Passed || prevResult == TestResult::NotRun) | 187 | if (prevResult == TestResult::Passed || prevResult == TestResult::NotRun) | ||
189 | { | 188 | { | ||
190 | TestResult::TestCaseResult result = TestResult::NotRun; | 189 | TestResult::TestCaseResult result = TestResult::NotRun; | ||
190 | const bool expectFail = m_suite->properties().value(QStringLiteral("WILL_FAIL"), QStringLiteral("FALSE")) == QLatin1String("TRUE"); | ||||
191 | if (line.startsWith(QLatin1String("PASS :"))) | 191 | if (line.startsWith(QLatin1String("PASS :"))) | ||
192 | { | 192 | { | ||
193 | result = m_expectFail ? TestResult::UnexpectedPass : TestResult::Passed; | 193 | result = expectFail ? TestResult::UnexpectedPass : TestResult::Passed; | ||
194 | } | 194 | } | ||
195 | else if (line.startsWith(QLatin1String("FAIL! :"))) | 195 | else if (line.startsWith(QLatin1String("FAIL! :"))) | ||
196 | { | 196 | { | ||
197 | result = m_expectFail ? TestResult::ExpectedFail : TestResult::Failed; | 197 | result = expectFail ? TestResult::ExpectedFail : TestResult::Failed; | ||
198 | } | 198 | } | ||
199 | else if (line.startsWith(QLatin1String("XFAIL :"))) | 199 | else if (line.startsWith(QLatin1String("XFAIL :"))) | ||
200 | { | 200 | { | ||
201 | result = TestResult::ExpectedFail; | 201 | result = TestResult::ExpectedFail; | ||
202 | } | 202 | } | ||
203 | else if (line.startsWith(QLatin1String("XPASS :"))) | 203 | else if (line.startsWith(QLatin1String("XPASS :"))) | ||
204 | { | 204 | { | ||
205 | result = TestResult::UnexpectedPass; | 205 | result = TestResult::UnexpectedPass; | ||
Show All 13 Lines |