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

GTest links do not open when double clicked for failures

    XMLWordPrintable

Details

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

    Description

      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:

      /xxx/myTest.cpp

      instead of:

      /xxx/yyy/test/src/myTest.cpp

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes