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

TestMate not fetching GTest test cases #352

Closed Lygaen closed 2 years ago

Lygaen commented 2 years ago

Checklist

Describe the bug The extension is unable to find any test cases, giving me this message "No tests have been found in this workspace yet.". I am using the latest version of VSCode, with the following settings for finding executables :

{
    "testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
}

While checking the logs, It does seems to be an error.

To Reproduce

  1. Clone my repository I uploaded.
  2. Open it with VS Code
  3. Download the CMake Tools extension
  4. Click on "Run CTest" on the status bar
  5. Open the "Testing" tab on the left hand side

Here is my top-level CMakelists.txt and my CMakelists.txt handling tests.

Screenshots (optional) The testing tab : image The files : image

Desktop

Log (optional but recommended)

[2022-06-25 13:51:48.017] [INFO] Activating extension
[2022-06-25 13:51:48.020] [INFO] Activation finished
[2022-06-25 13:51:51.828] [INFO] `test.advancedExecutables` is not defined. trying to use `test.executables`
[2022-06-25 13:51:51.830] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: 'build/tests/stream-test',
  resolved: 'build/tests/stream-test',
  strictAllowed: false
}
[2022-06-25 13:51:51.833] [INFO] pattern build/tests/stream-test /home/lygaen/code/mineserver {
  isAbsolute: false,
  absPath: '/home/lygaen/code/mineserver/build/tests/stream-test',
  isPartOfWs: true,
  relativeToWsPosix: 'build/tests/stream-test'
}
[2022-06-25 13:51:51.865] [DEBUG] Checking file for tests: /home/lygaen/code/mineserver/build/tests/stream-test
[2022-06-25 13:51:51.867] [DEBUG] ExecutableConfig.resolveVariable:  {
  value: '${absDirpath}',
  resolved: '/home/lygaen/code/mineserver/build/tests',
  strictAllowed: false
}
[2022-06-25 13:51:51.868] [DEBUG] ExecutableConfig.resolveVariable:  { value: {}, resolved: {}, strictAllowed: true }
[2022-06-25 13:51:51.886] [DEBUG] Not a supported test executable {
  spawner: s {},
  execPath: '/home/lygaen/code/mineserver/build/tests/stream-test',
  stdout: '',
  stderr: ''
}
Lygaen commented 2 years ago

We can notice the Not a supported test executable at the bottom of the logs but the extension does not that it supports GTest, and CTest runs it perfectly.

Lygaen commented 2 years ago

Switched to the lib doctest and it is now working.

rsehgalaka commented 3 months ago

I am having the same issue. It works on a different setup but I have a new setup where it doesn't work. I am working on a remote ssh host. I do see the extension installed but can't see it under Output!