microsoft / microsoft/vscode-cmake-tools

[Feature] Support CTest without CMake

Open
#4,169 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement more votes needed
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Brief Issue Summary

We have a Python project with no compiled code, and no need for cmake. But we still like to use ctest as the test driver. It works fine from the command-line, and have the list of tests in CTestTestfile.cmake (as documented).

In order to get them into vscode test explorer, two hacks are needed to trick cmake-test-explorer to believe the source directory is a build directory:

  • Create a CMakeCache.txt with a single line: CMAKE_CTEST_COMMAND:INTERNAL=ctest
  • Change configuration: "cmakeExplorer.buildDir": "."

Would it be possible to make vscode-cmake-tools discover a testable directory by the existance of CTestTestfile.cmake?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

Migrated from this discussion thread.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing CMake Tools test discovery flow and how it identifies build directories. Use the reported CTestTestfile.cmake-only setup as the starting case, then verify that a directory containing that file is discovered without CMakeCache.txt or a special buildDir setting and that its tests appear in VS Code Test Explorer.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.