diff --git a/src/plugins/autotest/ctest/ctestoutputreader.cpp b/src/plugins/autotest/ctest/ctestoutputreader.cpp index be20942da5e..31b41b41349 100644 --- a/src/plugins/autotest/ctest/ctestoutputreader.cpp +++ b/src/plugins/autotest/ctest/ctestoutputreader.cpp @@ -84,6 +84,8 @@ void CTestOutputReader::processOutputLine(const QByteArray &outputLine) static const QRegularExpression testResult("^\\s*\\d+/\\d+ Test\\s+#\\d+: (.*) (\\.+)\\s*" "(Passed|\\*\\*\\*Failed|\\*\\*\\*Not Run|" ".*\\*\\*\\*Exception:.*)\\s+(.*) sec$"); + static const QRegularExpression testCrash("^\\s*\\d+/\\d+ Test\\s+#\\d+: (.*) (\\.+)\\s*" + "Exit code .*$"); static const QRegularExpression summary("^\\d+% tests passed, (\\d+) tests failed " "out of (\\d+)"); static const QRegularExpression summaryTime("^Total Test time .* =\\s+(.*) sec$"); @@ -137,10 +139,19 @@ void CTestOutputReader::processOutputLine(const QByteArray &outputLine) testResult->setResult(ResultType::TestEnd); testResult->setDescription(match.captured()); reportResult(testResult); + } else if (ExactMatch match = testCrash.match(line)) { + m_description = match.captured(); + m_testName = match.captured(1); + m_result = ResultType::Fail; + m_expectExceptionFromCrash = true; } else { if (!m_description.isEmpty()) m_description.append('\n'); m_description.append(line); + if (m_expectExceptionFromCrash) { + if (QTC_GUARD(line.startsWith("***Exception:"))) + m_expectExceptionFromCrash = false; + } } } diff --git a/src/plugins/autotest/ctest/ctestoutputreader.h b/src/plugins/autotest/ctest/ctestoutputreader.h index b5baaaf96c5..baff9a9ca17 100644 --- a/src/plugins/autotest/ctest/ctestoutputreader.h +++ b/src/plugins/autotest/ctest/ctestoutputreader.h @@ -46,6 +46,7 @@ protected: QString m_testName; QString m_description; ResultType m_result = ResultType::Invalid; + bool m_expectExceptionFromCrash = false; }; } // namespace Internal