empserver/tests
Markus Armbruster 73f1ac8a2c tests: Make robust against variations in PRNG use
Tests need repeatable pseudorandom numbers to yield repeatable
results.  We seed the pseudorandom number generator with a fixed value
(emp_server -R) to make it produce the same sequence of numbers every
time.  But whenever code exercised by a test is changed to consume
fewer or more of them, all subsequent users get different numbers
regardless.  The ensuing test result changes are extremely tedious to
review.

To address this problem, reseed the PRNG with the count of commands
right before executing a command when running_test_suite is on.  This
way, the effect of perturbing the PRN sequence lasts only until the
next command.

Note that the next command could be another player's.  Doesn't matter.

Adding or removing commands now upsets the PRN sequence even for
commands that don't consume PRNs.  The next commit will take care of
that.

Perturbs test results across the board.  Hopefully, that'll happen
much less frequently now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:17 +01:00
..
actofgod tests: Enable running_test_suite by default 2014-01-19 10:09:17 +01:00
fairland tests: Rename final xdump files to final.xdump 2014-01-19 10:09:16 +01:00
files tests: Rename final xdump files to final.xdump 2014-01-19 10:09:16 +01:00
fire tests: Make robust against variations in PRNG use 2014-01-19 10:09:17 +01:00
info tests/info: New; checks info and code agree on commands 2014-01-06 20:50:06 +01:00
smoke tests: Make robust against variations in PRNG use 2014-01-19 10:09:17 +01:00
actofgod-test tests: Use feed_files for setup scripts 2014-01-19 10:09:16 +01:00
fairland-test tests: Rename final xdump files to final.xdump 2014-01-19 10:09:16 +01:00
files-test tests: Rename final xdump files to final.xdump 2014-01-19 10:09:16 +01:00
fire-test tests: Use feed_files for setup scripts 2014-01-19 10:09:16 +01:00
info-test tests: Move "not expected to work" warning into test-common.sh 2014-01-19 10:08:20 +01:00
normalize.pl tests: Fix normalization of nat_timeused in prompt in journal 2014-01-19 10:09:16 +01:00
smoke-test tests: Rename final xdump files to final.xdump 2014-01-19 10:09:16 +01:00
test-common.sh tests: Enable running_test_suite by default 2014-01-19 10:09:17 +01:00