Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.5.0
-
None
-
Windows
-
c57b06b9e6489b2ef0e2893991edd77eff724051 8accfddb17526ecab910123f2bc91c2cf66646f4
Description
Running a gtest which unexpectedly crashes will show the overall state as passing. A minimal (synthetic) example:
void iLikeOddNumbers(int n) {
{{ if(n % 2 == 0) { std::abort(); }}}
}
TEST(Foo, Bar) {
iLikeOddNumbers(2);
}
While this is an artificial example, crashing can happen for many reasons in real world code so it's critical to surface the failures. This is particularly relevant to code bases using design-by-contract where violations intentionally result in fail-fast.
Right now, Qt Creator 4.x+ seems to update the test state incrementally, showing the passed tests so far. If a test results in an unexpected crash (not an explicit death test like ASSERT_DEATH) the partial results superficially look like an overall pass.
Attachments
For Gerrit Dashboard: QTCREATORBUG-19565 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
216010,4 | AutoTest: Delegate reporting crashes to output reader | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
216011,2 | AutoTest: Fix noticing crashes on Windows for gtest | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |