| 150 | } |
| 151 | |
| 152 | void CTestRunJob::processFinished(KJob* job) |
| 153 | { |
| 154 | int error = job->error(); |
| 155 | auto finished = [this,error]() { |
| 156 | TestResult result; |
| 157 | result.testCaseResults = m_caseResults; |
| 158 | if (error == OutputJob::FailedShownError) { |
| 159 | result.suiteResult = TestResult::Failed; |
| 160 | } else if (error == KJob::NoError) { |
| 161 | result.suiteResult = TestResult::Passed; |
| 162 | } else { |
| 163 | result.suiteResult = TestResult::Error; |
| 164 | } |
| 165 | |
| 166 | // in case the job was killed, mark this job as killed as well |
| 167 | if (error == KJob::KilledJobError) { |
| 168 | setError(KJob::KilledJobError); |
| 169 | setErrorText(QStringLiteral("Child job was killed.")); |
| 170 | } |
| 171 | |
| 172 | qCDebug(CMAKE_TESTING) << result.suiteResult << result.testCaseResults; |
| 173 | ICore::self()->testController()->notifyTestRunFinished(m_suite, result); |
| 174 | emitResult(); |
| 175 | }; |
| 176 | |
| 177 | if (m_outputModel) |
| 178 | { |
| 179 | connect(m_outputModel, &OutputModel::allDone, this, finished, Qt::QueuedConnection); |
| 180 | m_outputModel->ensureAllDone(); |
| 181 | } |
| 182 | else |
| 183 | { |
| 184 | finished(); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | void CTestRunJob::rowsInserted(const QModelIndex &parent, int startRow, int endRow) |
| 189 | { |
nothing calls this directly
no test coverage detected