Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force build to list tests #3399

Closed
sercxanto opened this issue Oct 20, 2023 · 3 comments
Closed

Don't force build to list tests #3399

sercxanto opened this issue Oct 20, 2023 · 3 comments
Labels
bug a bug in the product Feature: ctest repro needed This needs to be reproduced and repro steps detailed either in a comment or in the discussion.
Milestone

Comments

@sercxanto
Copy link

Brief Issue Summary

To list the tests the CMake tools forcibly build the project. It should be possible to list the tests without building them first for the following reasons:

  • For very large projects it is not feasible to build the full project upfront if you just work on a subsets of targets and their tests
  • Some of the tests might even not need to have any targets build

In other words it should to do the same with CMake tools as with command line CMake / ctest:

cmake --preset=my_default
# List tests:
ctest --preset=my_default -N
# Run helper test (does not need any compilation step):
ctest --preset=my_default -R helper

Steps to reproduce:

  • Select configure preset
  • Select test preset
  • Now CMake tools automatically run a build
  • Only after building its possible to see the list of tests

A simple CMake project to reproduce this issue is available in this github repo.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.82.2",
  "cmtVersion": "1.15.31",
  "configurations": [
    {
      "folder": "/home/gal/projekte/cmake_playground",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": null
    }
  ]
}

Debug Log

No response

Additional Information

No response

@gcampbell-msft
Copy link
Collaborator

@sercxanto Thanks for the issue. I'm adding this to our list of ctest suggestions / issues.

@xisui-MSFT FYI.

@gcampbell-msft gcampbell-msft added bug a bug in the product Feature: ctest repro needed This needs to be reproduced and repro steps detailed either in a comment or in the discussion. and removed triage labels Oct 27, 2023
@github-project-automation github-project-automation bot moved this to Needs Triaging in CMake Tools Nov 21, 2023
@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft moved this from Triage Needed to Needs Repro in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft added this to the Backlog milestone Jun 24, 2024
@gcampbell-msft gcampbell-msft moved this to Pending Prioritization in CMake Tools Jul 17, 2024
@hippo91
Copy link
Contributor

hippo91 commented Dec 14, 2024

@gcampbell-msft this issue seems to be a duplicate of #2933. Am i wrong?

@gcampbell-msft
Copy link
Collaborator

Yes, I believe you are right, we should likely add a setting that controls whether we force a build before running ctest, similar to the cmake.buildBeforeRun setting. Closing this in favor of #2933

@github-project-automation github-project-automation bot moved this from Pending Prioritization to Completed in CMake Tools Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: ctest repro needed This needs to be reproduced and repro steps detailed either in a comment or in the discussion.
Projects
Status: Completed
Development

No branches or pull requests

3 participants