--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Internally, tests are registered using static constructors, so they're typically run in link order. (This should be considered an implementation detail.) Google Test doesn't directly provide a means of specifying a test order, but you can use the --gtest_filter flag to run a subset of tests:
--Josh Kelley
On Sun, May 1, 2016 at 12:03 PM, Aaron Gray <aaron...@gmail.com> wrote:
Hi,How do I run individual tests or test groups in main to allow test ordering ?At the moment as test order seems to be alphabetical as far as I can tell I am running some complex test before the simpler ones.Rather than 'RUN_ALL_TESTS()' is there a way to invoke specific tests so I can order them please ?Many thanks in advance,Aaron Gray
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
You can specify the --gtest_shuffle flag (or set the GTEST_SHUFFLE environment variable to 1) to run the tests in a program in a random order. This helps to reveal bad dependencies between tests.
By default, Google Test uses a random seed calculated from the current time. Therefore you'll get a different order every time. The console output includes the random seed value, such that you can reproduce an order-related test failure later. To specify the random seed explicitly, use the --gtest_random_seed=SEED flag (or set the GTEST_RANDOM_SEED environment variable), where SEED is an integer between 0 and 99999. The seed value 0 is special: it tells Google Test to do the default behavior of calculating the seed from the current time.
If you combine this with --gtest_repeat=N, Google Test will pick a different random seed and re-shuffle the tests in each iteration.
Availability: Linux, Windows, Mac; since v1.4.0.
You could also look at the googletest source code that implements "--gtest_shuffle" and implement your own option, perhaps called "--gtest_sort_by_names".
On 2016 May 05, at 11:12 AM, Aaron Gray <aaron...@gmail.com> wrote:
On Tuesday, 3 May 2016 03:35:37 UTC+1, Josh Kelley wrote:Internally, tests are registered using static constructors, so they're typically run in link order. (This should be considered an implementation detail.) Google Test doesn't directly provide a means of specifying a test order, but you can use the --gtest_filter flag to run a subset of tests:Wow that's pretty annoying ! Gonna have to stick a prefix on the test names like 'TestN_*' !
--Josh Kelley
On Sun, May 1, 2016 at 12:03 PM, Aaron Gray <aaron...@gmail.com> wrote:
Hi,How do I run individual tests or test groups in main to allow test ordering ?At the moment as test order seems to be alphabetical as far as I can tell I am running some complex test before the simpler ones.Rather than 'RUN_ALL_TESTS()' is there a way to invoke specific tests so I can order them please ?Many thanks in advance,Aaron Gray
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.