Skip to content

feat: auto-detect test executables via CMake Tools#37

Open
haikion wants to merge 1 commit intoalfaix:mainfrom
haikion:executable-discovery-by-cmake
Open

feat: auto-detect test executables via CMake Tools#37
haikion wants to merge 1 commit intoalfaix:mainfrom
haikion:executable-discovery-by-cmake

Conversation

@haikion
Copy link

@haikion haikion commented Mar 4, 2026

Adds automatic detection of Google Test executables via CMake Tools. This is largely based on the discussions in issue #12. The submitted patch sort of worked but required a few tweaks. Permission to use the patch was granted, and credit will be given to the original authors in the form of a code comment. I also added a couple of tests. Feature has some imperfections, which I consider out of scope.

Working

  • Automatic test executable discovery for a file
  • Automatic test executable discovery for a test fixture
  • Automatic test executable discovery for a test

Known issues

  • Does not automatically discover executables for a directory
  • Issues may arise if the current working directory is not in the project root

I omitted implementation for directory-based discovery, as neotest-gtest seems to assume that a directory maps to a single test executable, which is not always the case. cmake-tools expects the current working directory to be in the project root, so fixing such issues would quickly snowball.

closes #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support build tool integration

1 participant