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

Unit tests are executed twice in Test Results panel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • Qt Creator 4.4.1, Qt Creator 4.6.0-beta1
    • Test Integration
    • None

    Description

      When I load (or recreate) this project: AutoTesting01.zip I only get 1 unit test in the Tests panel  (see QTCREATORBUG-19314). Executing the tests works fine.

      If I change the order of the QTest::qExec calls in main.cpp the panel shows both test groups.

      From this:

      res += QTest::qExec(&tg1, argc, argv);

      res += QTest::qExec(&tg2, argc, argv);

      To this:

      {{ res += QTest::qExec(&tg2, argc, argv); }}

      {{ res += QTest::qExec(&tg1, argc, argv);}}

      I got the 2 groups as expected:

      Now running the tests in the Test Results panel shows the results twice:

      It's the same if running the tests from Tools > Tests or the Tests panel.

      Furthermore if I disable 1 group:

      And I run only selected tests, I got both groups executed (only once):

      Output is fine when I run the executable.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cstenger Christian Stenger
            vivaladav Davide Coppola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes