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

Running GTests in a CMake project with multiple targets runs the wrong target

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 4.3.1
    • Qt Creator 4.3.0
    • Test Integration
    • None
    • MacOS Sierra 10.12.5, QtCreator 4.3.0, CMake 3.8.2
    • f16339f18d5f09a7348dc636ad6c2d976531347a cce1e130d7125fdee30eaf283f6adba0fcd3b1cf

    Description

      I'm attempting to run GTests from QtCreator (either from the "Test Results" message window or the "Tests" pane) and the tests are not successfully run. The project is a CMake-based project with multiple targets (couple of libraries, couple of executables and a Google Test executable that contains tests for the libraries). QtCreator properly detects the Google Tests in the source files of the test target but when trying to run the tests from the QtCreator GUI a message "WARN Project's run configuration was guessed for <name of one of the library targets, sometimes changes>. This might cause trouble during execution. (guessed from <name of the google test target>" and no tests are actually run (0 passed, 0 failed is displayed).

      As far as I can see, there's no way of specifying which actual target should be run for the tests (QtCreator is guessing this by himself and guessing wrong??).

      When creating a fresh cmake project with a single google test target the command works fine (it guesses the only target available which is the correct one??).

      Attachments

        Issue Links

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

          Activity

            People

              cstenger Christian Stenger
              m1h4 Marko Mihovilic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes