c7fc73ee45
The testsuite utilities that use random numbers use a default-constructed mersenne_twister_engine, meaning the values are reproducable. This adds support for seeding them, controlledby an environment variable. Defining GLIBCXX_SEED_TEST_RNG=val in the environment will cause the engines to be seeded with atoi(val) if that is non-zero, or with a value read from std::random_device otherwise. Running with different seeds revealed some bugs in the tests, where a randomly selected iterator was past-the-end (which can't be erased), or where the randomly populated container was empty, and then we tried to remove elements from it unconditionally. libstdc++-v3/ChangeLog: * testsuite/util/exception/safety.h (setup_base::generate): Support seeding random engine. (erase_point, erase_range): Adjust range of random numbers to ensure dereferenceable iterators are used where required. (generation_prohibited::run): Do not try to erase from empty containers. * testsuite/util/testsuite_containergen.h (test_containers): Support seeding random engine. |
||
---|---|---|
.. | ||
atomic | ||
common_type | ||
debug | ||
exception | ||
hash_fn | ||
io | ||
native_type | ||
performance | ||
pstl | ||
regression | ||
statistic | ||
thread | ||
replacement_memory_operators.h | ||
slow_clock.h | ||
specfun_testcase.h | ||
testsuite_abi_check.cc | ||
testsuite_abi.cc | ||
testsuite_abi.h | ||
testsuite_allocator.cc | ||
testsuite_allocator.h | ||
testsuite_api.h | ||
testsuite_character.cc | ||
testsuite_character.h | ||
testsuite_common_types.h | ||
testsuite_container_traits.h | ||
testsuite_containergen.h | ||
testsuite_containers.h | ||
testsuite_counter_type.h | ||
testsuite_error.h | ||
testsuite_fs.h | ||
testsuite_greedy_ops.h | ||
testsuite_hooks.cc | ||
testsuite_hooks.h | ||
testsuite_io.h | ||
testsuite_iterators.h | ||
testsuite_new_operators.h | ||
testsuite_performance.h | ||
testsuite_random.h | ||
testsuite_regex.h | ||
testsuite_rng.h | ||
testsuite_rvalref.h | ||
testsuite_shared.cc | ||
testsuite_tr1.h |