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

Unable to determine if a test should run before calling RUN_ALL_TESTS #478

Open
GoogleCodeExporter opened this issue Aug 7, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hey fox!

I'm trying to determine if a test should be executed using 
::testing::TestInfo->should_run() before calling RUN_ALL_TESTS()
but it always returns false.

After RUN_ALL_TESTS() all works fine.

I don't know if this is considered a bug, or the info about the tests are 
loaded using a "lazy behaviour".

Is there any way to walk around it?

Thanks!

Original issue reported on code.google.com by genesisl...@gmail.com on 13 Oct 2014 at 9:52

Attachments:

@GoogleCodeExporter
Copy link
Author

RUN_ALL_TESTS() calls RunAllTests() calls FilterTests() which sets the 
should_run_ field.

There's what looks like a deliberate wndow of opportunity for main() authors to 
manipulate the filters between GoogleTestInit() time and RUN_ALL_TESTS() time, 
so it may not be possible to set should_run_ earlier.

Original comment by billydon...@google.com on 14 Oct 2014 at 4:47

@GoogleCodeExporter
Copy link
Author

With your suggestion I've found out a way to walkaround it by simply running 
the test with GTEST_FLAG(list_tests) set to true, before checking the stuffs I 
need.

Thank you for the support ;)

Original comment by genesisl...@gmail.com on 14 Oct 2014 at 6:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant