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 use flags of the selected test preset when running an individual test #3152

Open
quyykk opened this issue Apr 29, 2023 · 6 comments
Open
Assignees
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: ctest
Projects
Milestone

Comments

@quyykk
Copy link

quyykk commented Apr 29, 2023

Brief Issue Summary

I have an active selected test preset that filters out a couple of tests. Now I want to run a single test through the test explorer, that is not part of the test preset. But the extension executes ctest by passing the filter from the selected test preset, and so the result is that ctest can't find the test.

Running an individual test through the test explorer should not use any options/flags of the currently selected test preset.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@benmcmorran benmcmorran added bug a bug in the product Feature: ctest labels May 2, 2023
@benmcmorran benmcmorran added this to Triage in 1.15 via automation May 2, 2023
@benmcmorran benmcmorran added this to the 1.15 milestone May 2, 2023
@gcampbell-msft gcampbell-msft moved this from Triage to To do in 1.15 Jul 5, 2023
@xisui-MSFT
Copy link
Collaborator

Sorry I'm not sure if I understand your question. If you want to use the test preset to filter out tests, why do you want to run tests that are filtered out? In addition, this is not supported by CTest either.

If I'm understanding this issue correctly, I'd suggest you have two presets. The first one contains all the configs and doesn't have any filters, and the second one inherits the first one and has filters. Then you'll able to use the first preset when trying to run any tests that are listed.

@quyykk
Copy link
Author

quyykk commented Jul 28, 2023

I don't want to constantly switch presets just because I want to run one test.

But also this

Running an individual test through the test explorer should not use any options/flags of the currently selected test preset.

If I want to run a single test through the test explorer, then why are the options from the current preset used? The options from the current preset might be completely inappropriate for the single test run.

@xisui-MSFT
Copy link
Collaborator

I don't want to constantly switch presets just because I want to run one test.

If you are inheriting the test preset, then you can just use the base preset, and don't need to constantly switching them. Unless you have different settings for each test, in which case, unfortunately, I don't think there's a good way not switching presets.

The options from the current preset might be completely inappropriate for the single test run

As you said, this is why you shouldn't allow a preset include those tests that don't use the settings in this preset. Because otherwise we can't know what settings we should use for each test.

@quyykk
Copy link
Author

quyykk commented Jul 28, 2023

What do you think about not specifying any options when running a single test through the test explorer?

@xisui-MSFT
Copy link
Collaborator

Then don't specify any options in your test preset? You can also use the default preset, which doesn't add anything.

But we don't do this by default. as you already implied in your earlier comments, some tests require additional settings. In another word, we chose to always list and run test under the selected test preset by default, since this is more generic. I think this is also what you asked in #3151.

@gcampbell-msft gcampbell-msft added this to Triage in 1.16 via automation Aug 1, 2023
@gcampbell-msft gcampbell-msft removed this from To do in 1.15 Aug 1, 2023
@gcampbell-msft gcampbell-msft modified the milestones: 1.15, 1.16 Aug 1, 2023
@gcampbell-msft
Copy link
Collaborator

This issue is actually somewhat complex, and the root cause is that our design should only be displaying tests defined by the test preset in the Text Explorer. Currently, this is not working correctly and thus you're seeing tests in the Text Explorer that you shouldn't.

Therefore, this is likely more of a feature request, to be able to see all tests in the Text Explorer, even those that aren't defined by a test preset. Marking this as a feature request and we moved it to the 1.16 milestone.

@gcampbell-msft gcampbell-msft added enhancement an enhancement to the product that is either not present or an improvement to an existing feature and removed bug a bug in the product labels Aug 2, 2023
@benmcmorran benmcmorran modified the milestones: 1.16, 1.17 Oct 4, 2023
@gcampbell-msft gcampbell-msft added this to Triage in 1.17 via automation Nov 20, 2023
@gcampbell-msft gcampbell-msft removed this from Triage in 1.16 Nov 20, 2023
@gcampbell-msft gcampbell-msft modified the milestones: 1.17, On Deck Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: ctest
Projects
Status: Pending Prioritization
1.17
Triage
Development

No branches or pull requests

4 participants