Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-19565

Qt Creator may incorrectly show crashed tests as passing (gtest)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 4.6.0-beta1
    • Qt Creator 4.5.0
    • Test Integration
    • 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

        Activity

          People

            cstenger Christian Stenger
            lemo L M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes