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

Scenario name can not be passed to -tc to execute single scenario #373

Closed
thekiwicoder0 opened this issue May 15, 2020 · 6 comments
Closed

Comments

@thekiwicoder0
Copy link

Description

Given the way the SCENARIO test macro works, it's not possible to use just the scenario name
as the command line argument with -tc= option to execute it.

Steps to reproduce

Given this test case:

SCENARIO("MyTestCase")
...

Attempt to execture a single scenario using the command line filter:
-tc=MyTestCase

Result:
0 tests pass

Extra information

It seems the SCENARIO macro prefixes the test case with ' Scenario: ' (including whitespace).
So the filter requried to execute is:
-tc=*Scenario:*MyTestCase

Perhaps a new command argument could be used?

@onqtam
Copy link
Member

onqtam commented May 15, 2020

I would lean towards people hacking their way around such issues because there's a fine balance between features and bloat. You could use ? (means match 1 char) instead of * for the whitespace btw - like this: *Scenario:?MyTestCase.

@thekiwicoder0
Copy link
Author

Sure, *Scenario:*MyTestCase gives the same result too, with just as many characters. My point was it’s a bit unintuitive that’s all.
The ‘Scenario:’ bit is kinda hidden without digging into the macro

@thekiwicoder0
Copy link
Author

I’m wondering why scenario test cases are prefixed with Scenario: at all, without this, they would work just fine with the standard filter.

@onqtam
Copy link
Member

onqtam commented May 15, 2020

I think it was done the same way in Catch when I made it initially. Perhaps I should add a note about that in the docs - will keep this issue open for that.

@thekiwicoder0
Copy link
Author

Thanks, adding to the docs a note about this would be good too.

@onqtam
Copy link
Member

onqtam commented May 17, 2020

added a note in the docs

@onqtam onqtam closed this as completed May 17, 2020
onqtam added a commit that referenced this issue May 17, 2020
… when using the SCENARIO macro instead of TEST_CASE
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

No branches or pull requests

2 participants