Skip to content

Disabled gtest tests are executed and fail #4267

Closed

Description

@rokas-kbit

Hi,

It seems that extension is handling disabled gtest tests incorrectly.

Current behavior

Disabled tests are executed when execution of all tests is requested and such tests are considered as failed:
Image

[proc] Executing command: /usr/local/bin/ctest -j18 -C Debug -T test --output-on-failure -R ^Tests\.Runs$
[ctest]    Site: rk-work-laptop
[ctest]    Build name: Linux-c++
[ctest] Test project /home/rokas/cmake-tools-bug/build
[ctest]     Start 1: Tests.Runs
[ctest] 1/1 Test #1: Tests.Runs .......................   Passed    0.00 sec
[ctest] 
[ctest] 100% tests passed, 0 tests failed out of 1
[ctest] 
[ctest] Total Test time (real) =   0.00 sec
[ctest] CTest finished with return code 0
[proc] Executing command: /usr/local/bin/ctest -j18 -C Debug -T test --output-on-failure -R ^Tests\.DoesntRun$
[ctest]    Site: rk-work-laptop
[ctest]    Build name: Linux-c++
[ctest] Test project /home/rokas/cmake-tools-bug/build
[ctest]     Start 2: Tests.DoesntRun
[ctest] 1/1 Test #2: Tests.DoesntRun ..................***Not Run (Disabled)   0.00 sec
[ctest] No tests were found!!!
[ctest] CTest finished with return code 0
[ctest] Test Tests.DoesntRun failed with completion status "Disabled".

Expected behavior

  • Disabled tests should not be executed when we are running all tests.
  • They may be included in the test list and may be executed manually.
  • They should not impact status of the test group.
    • Manual execution may impact group status, but it starts to get complicated. For example, if entire group of tests is executed again, we probably want disabled tests to stop impacting group status, even if we manually executed these tests and they failed.

Minimal reproducer: bug-4267.zip

Activity

  1. Amy-Li03 commented on Feb 8, 2025

    @Amy-Li03
    Collaborator

    Hi rokas-kbit , thanks for reporting issue here!
    We can repro this issue on cmake tools latest build 1.20.47(pre-release), following is the repro steps:

    1. Extract and open project: ctest-project.zip with VS Code
    2. Build this project
    3. Switch to "Testing" tab and click the "Run tests" button

    Actual result:
    Disabled gtest tests are executed and fail

    Image

    Garrett Campbell (@gcampbell-msft) FYI

  2. moved this from Blocked to Pending Prioritization in CMake Toolson Feb 10, 2025
  3. amir-s2 commented on Jul 10, 2025

    @amir-s2

    Any update?

  4. yanghhhhhhh commented on Jul 11, 2025

    @yanghhhhhhh
    Collaborator

    Hi amir-s2, thanks for the comment. If there is progress on this issue, we will update here. Thanks for help us build a better CMake Tools!

  5. anand-hariharan commented on Nov 2, 2025

    @anand-hariharan

    I have tested and confirm that changing this line of code to -

    if (completionStatus === "SKIP_REGULAR_EXPRESSION_MATCHED" || completionStatus === "Disabled") {

    fixes the problem.

  6. yanghhhhhhh commented on Nov 6, 2025

    @yanghhhhhhh
    Collaborator

    Anand Hariharan (@anand-hariharan) Thank you for your information. If this issue is fixed, we will update here. Thanks for help us build a better CMake Tools!

  7. moved this from Pending Prioritization to Completed in CMake Toolson Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions