Unable to determine if a test should run before calling RUN_ALL_TESTS
GoogleCodeExporter opened this issue · 2 comments
GoogleCodeExporter commented
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 commented
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 commented
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