gcc/libstdc++-v3/testsuite/util
Jonathan Wakely c7fc73ee45 libstdc++: Allow seeding random engines in testsuite
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.
2021-03-25 18:21:19 +00:00
..
atomic Update copyright years. 2021-01-04 10:26:59 +01:00
common_type Update copyright years. 2021-01-04 10:26:59 +01:00
debug Update copyright years. 2021-01-04 10:26:59 +01:00
exception libstdc++: Allow seeding random engines in testsuite 2021-03-25 18:21:19 +00:00
hash_fn Update copyright years. 2021-01-04 10:26:59 +01:00
io Update copyright years. 2021-01-04 10:26:59 +01:00
native_type Update copyright years. 2021-01-04 10:26:59 +01:00
performance Update copyright years. 2021-01-04 10:26:59 +01:00
pstl Synchronize libstdc++ PSTL with upstream LLVM PSTL 2019-06-07 22:01:16 +00:00
regression Update copyright years. 2021-01-04 10:26:59 +01:00
statistic Update copyright years. 2021-01-04 10:26:59 +01:00
thread Update copyright years. 2021-01-04 10:26:59 +01:00
replacement_memory_operators.h Update copyright years. 2021-01-04 10:26:59 +01:00
slow_clock.h Update copyright years. 2021-01-04 10:26:59 +01:00
specfun_testcase.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_abi_check.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_abi.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_abi.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_allocator.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_allocator.h libstdc++: Make test memory_resource work without exceptions and RTTI 2021-02-12 14:30:13 +00:00
testsuite_api.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_character.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_character.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_common_types.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_container_traits.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_containergen.h libstdc++: Allow seeding random engines in testsuite 2021-03-25 18:21:19 +00:00
testsuite_containers.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_counter_type.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_error.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_fs.h libstdc++: Restore <unistd.h> in testsuite_fs.h header [PR 99096] 2021-02-14 20:38:32 +00:00
testsuite_greedy_ops.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_hooks.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_hooks.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_io.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_iterators.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_new_operators.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_performance.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_random.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_regex.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_rng.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_rvalref.h Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_shared.cc Update copyright years. 2021-01-04 10:26:59 +01:00
testsuite_tr1.h Update copyright years. 2021-01-04 10:26:59 +01:00