Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 5.0.0-beta1
-
None
-
-
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.