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

Expose SHOULD("XXX") sub-targets explicitly callable from the shell #73

Open
qknight opened this issue Mar 18, 2022 · 3 comments
Open

Comments

@qknight
Copy link

qknight commented Mar 18, 2022

In short: SHOULD("") tests should also be exposed as single targets on the shell and they 'could' eventually also show up as individual tests in the tests run. At least they should be callable individually!

Given this example:

GTEST(MYFooTest, "MyBarTest") {

... some setup stuff ...

SHOULD("foo") {

}
SHOULD("bar") {

}

I'd like to call SHOULD tests explicitly!

Using GUnit one can run all tests:

./mytest --gunit_filter="*"

Or just a subset:

./mytest --gunit_filter="MYFooTest.*"

Or one explicit test:

./mytest --gunit_filter="MYFooTest.MyBarTest"

But one cannot call a SHOULD:

./mytest --gunit_filter="MYFooTest.MyBarTest.foo"

why?

In our code-base we have like 10 SHOULD calls and if one fails it is often hard to see which one does as the output can be quite huge. So I basically comment all n-1 SHOULD tests and uncomment them one by one to work them down. Which is of course total overkill.

@MattYoung50
Copy link

I would also appreciate this feature

@kris-jusiak
Copy link
Contributor

Are there issues with the following?

Note Running specific should test case requires ':' in the test filter (--gtest_filter="test case pattern:should pattern")

--gtest_filter="FooTest*:Do A" # calls FooTest with should("Do A")
--gtest_filter="FooTest*:-Do A" # calls FooTest with not should("Do A")
--gtest_filter="FooTest*:Do*" # calls FooTest with should("Do...")
--gtest_filter="FooTest.:Do*" # calls FooTest with should("Do...")
--gtest_filter="-FooTest?:-Do*" # calls not FooTest with not should("Do...")

@MattYoung50
Copy link

That works for me! Who wants to read good documentation when opening a ticket is so much simpler right?

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

3 participants