Uploaded image for project: 'Qt Creator'
  1. Qt Creator

GTest links do not open when double clicked for failures



    • Linux/X11
    • f922d22ad4fd1c26921fab99a4226b2e8312bc96 (qt-creator/qt-creator/5.0)


      I am using generic project. this is how file structure looks:

      /xxx/myGenericProject.creator (with other generic project files)

      /xxx/yyy/inc/someheader.h  - external headers in this folder

      /xxx/yyy/src/somesource.cpp - sources and internal headers in this folder

      /xxx/yyy/test/bin/ - folder where compile is executed

      /xxx/yyy/test/src/myTest.cpp - folder where Gtest myTest.cpp file is, with test

      When test fails, up to recently I could double click on error in test output pane, and it would throw me on a line in myTest.cpp file where expect failed. Right now it throws error - could not open file, even though file line and file name is shown on right side of output pane.

      Some investigated stuff:

      In debug mode, in testresultpane.cpp on line 476 I see that

      void TestResultsPane::onItemActivated(const QModelIndex &index)
         if (!index.isValid())
           return;const TestResult *testResult = m_filterModel->testResult(index);
         if (testResult && !testResult->fileName().isEmpty())
           EditorManager::openEditorAt(Utils::Link{testResult->fileName(), testResult->line(), 0});

      In debug mode, in here, I see that testResult has constructed path to file as:


      instead of:


      Note that file myTest.cpp is part of my generic project, so I expected from QTC to find it in the project. I did notice that sometimes it looks for this file in build directory as well, which is also wrong in my case.

      Also, note that when test is passed, links work, and double click in output pane opens test in the test file. it only it does not work when test fails, for links to test failures.


        For Gerrit Dashboard: QTCREATORBUG-25979
        # Subject Branch Project Status CR V



            cstenger Christian Stenger
            pperisin Petar
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes