Closed svak closed 6 years ago
$ ninja -j6 install
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(testadapter)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
enable_testing()
set(GTEST_ROOT "Work/gtest")
set(GTEST_INCLUDE_DIRS "${GTEST_ROOT}/include")
set(GTEST_LIBRARY "${GTEST_ROOT}/lib/gtestd.lib")
set(GMOCK_LIBRARY "${GTEST_ROOT}/lib/gmockd.lib")
set(GTEST_MAIN_LIBRARY "${GTEST_ROOT}/lib/gtest_maind.lib")
set(GTEST_LIBS ${GTEST_LIBRARY} ${GMOCK_LIBRARY} ${GTEST_MAIN_LIBRARY})
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(testadapter main.cpp)
target_link_libraries(testadapter ${GTEST_LIBS})
main.cpp
#include <gtest/gtest.h>
#include <gmock/gmock.h>
TEST(TestAdapter, CheckOne)
{
EXPECT_TRUE(false);
}
install gtest-adapter extension, settings.json:
{
"gtest-adapter.debugConfig": "(Windows) Launch",
"gtest-adapter.supportLocation": true
}
build project
testadapter run successfully with some expected output:
[----------] 1 test from TestAdapter
[ RUN ] TestAdapter.CheckOne
..\main.cpp(28): error: Value of: false
Actual: false
Expected: true
[ FAILED ] TestAdapter.CheckOne (9 ms)
Now. Within "Test" view press "Refresh". Everything (but "Go to Code") is fine. Test "TestAdapter/CheckOne" appear in the tree, it can be run and debug.
Press "Go to Code" and nothing will be happend.
@svak Thanks for reporting this issue.
I believe that version 1.2.2 fixes this issue. Could you confirm that with this new version Go to Test
does indeed work as expected, and I will then close this.
Thank you,
David
Unfortunately, after upgrading to version 1.2, the issue is not fixed.
Within Developers Tools/Console i can see that message:
"cannot open file:///../main.cpp. Detail: File not found (file:///../main.cpp)
@svak Would you mind sending me the unit test app, by mail. Also send me where Main.cpp is located relative to the workspace folder.
@DavidSchuldenfrei
Unpack to %USERPROFILE% checkone.zip
Thank you!
@svak Could you send just the compiled executable (and the content of the build/compile_commands.json file)? Thanks,
David
Sure,
@svak Thanks for your help in finding this issue. I hadn't accounted for the fact that sometimes, a file location might start with ../ (or ..\ in Windows). This is fixed by PR #13 and in version 1.2.3 If you still encounter problems, please reopen this issue.
Windows 10 + VSCode 1.27.2
Test list and launch/debug works fine. But "Go to Code" item does not work neither with googletest release-1.8.1 or master.
Is there any solutions available for that issue?
(Already read https://github.com/google/googletest/pull/1658)