Load tests from ctest
See original GitHub issueDescribe the solution you’d like
I’d like to be able to identify test executables via ctest, CMake’s test registry and test runner. We already have test configurations in CMakeLists.txt which I would like to use instead of defining testMate.cpp.test.advancedExecutables
.
A command like ctest --show-only=json-v1
causes ctest to print all the tests it knows about. A relevant section is
{
"tests" :
[
{
"command" :
[
"crun",
"c/build/catchtests",
"Hello world"
],
"name" : "catchtests-Hello world",
"properties" :
[
{
"name" : "WORKING_DIRECTORY",
"value" : "/home/lordmauve/myproj/"
}
]
}
}
where
crun
is a launcher defined with CROSSCOMPILING_EMULATOR - equivalent to TestMate’sexecutionWrapper
c/build/catchtests
is the test binary"Hello world"
is the name of the test to run. That’s being populated by the Catch2 CMake integration - each test case is registered as a separate CTest item.
This seems like a significant mismatch for the model of testMate.cpp.test.advancedExecutables
- because TestMate wants a list of executables that to can query for tests - and yet it seems like JetBrains was able to overcome this because this exact feature is available in CLion.
Describe alternatives you’ve considered
I have separately configured testMate.cpp.test.advancedExecutables
and CTest
and used them independently. However, this is hard to keep in sync across our user base. Some of our developers use CLion where the IDE integration with CTest is a supported feature; those developers can rely on adding tests in CMakeLists.txt without having to reconfigure their IDE. This means that CLion users can break VS Code users by adding tests that TestMate will not see.
Additional context
This is a related to https://github.com/matepek/vscode-catch2-test-adapter/issues/150
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
Probably because of the same reason this extension wouldn’t be able to.
No activity on this. I will close, but feel free to comment or add any new ideas.