matepek / vscode-catch2-test-adapter

Catch2, Google Test and doctest Adapter for the VSCode
https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter
MIT License
210 stars 52 forks source link

Add `ctest` parsing #401

Closed zanaviska closed 1 year ago

zanaviska commented 1 year ago

Checklist

Is your feature request related to a problem? Please describe. I have problem working with your extension with my everyday project. In most cases it fails to load test executable that I mostly work with. Our development process heavily relies on cmake. That is why ctest is able to find all our test executables without any problems. Here on screen you can find tests list that extension generated and ctest --show-only output. Only 6 test out of 9 were in common. зображення

Describe the solution you'd like So my proposal is to add cmake integration 1) Check for some flag in settings.json(for example "testMate.useCmake") 2) check if workspace contain cmakelists.txt file 3) fetch from cmake-tools extension path to build directory 4) execute command ctest --show-only=json-v1 and parse output to find all tests and executables 5) integrate those results into ui

Describe alternatives you've considered I considered developing my own extension, but there is a tonn of things that I'd like to add to my extension. So I decided that it would be easier and faster to add such approach to existing solution. P.S. I am not trying to promote my extension. As soon as I find existing solution, I will archive my extension and move to existing solution

Additional information If needed I will be able to help with developing such functionality

matepek commented 1 year ago

Hello,

I have considered this approach before and I decided not to support it for several reasons. It is a different tool for different purpose. The reason why you cannot run your executables with this extension because of the cmake magic happening under the hood.

I believe you can set this extension up with config variables ${config:<varname>} such as ${config:buildDirectory}, etc..

matepek commented 1 year ago

A lot of key features could not be supported.