Exercise version, show and xdump, except for xdump of game state.
The xdump part is mostly factored out of tests/smoke.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
MALLOC_CHECK_=3 makes glibc check for memory allocation programming
errors. It's the factory default, but set it anyway just in case
someone disabled it for speed.
Non-zero MALLOC_PERTURB_ makes glibc wipe memory value on allocation
and deallocation. The actual value determines the bit pattern. Set
it to the value of environment variable EMPIRE_CHECK_MALLOC_PERTURB or
else a pseudo-random number, and record it in sandbox/malloc-perturb.
See mallopt(3) for more information.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
These logs are saved in the sandbox to help debugging setup.
Normalize them to make them easier to read.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
New helper run_and_cmp to automate the job: run a program capturing
its standard output, standard error and exit status, then compare the
actual with the expected results.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
When cmp_out detects a test failure, it returns non-zero status, which
terminates the test script unless caught.
Accumulate failures in a global variable checked at exit instead, so
running it multiple times in a test script just works.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Feeding other test output files (right now tests/files/files.out
tests/fairland/fairland.out fairland/newcap_script) works, but it's
odd, and might not work as well for all future output files. Only
strip trailing white space there.
There used to be other output files that required normalize.pl: client
output. Gone since commit 9ca3fa9.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
"diff -q" isn't blessed by POSIX anyway. Neither is -u, but it should
be widely available. -c is blessed, but I find its output hard to
read.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Moving the telegram files away isn't enough, we also have to reset
nat_tgms. actofgod/setup-POGO does it already, but fire/setup-POGO
doesn't. Do it in begin_test instead, right where the telegram files
are moved away.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
To make setup scripting more similar to test scripting. Also permits
use of countries other than POGO there, but that isn't necessary right
now.
Setup scripts renamed from init_script to setup-POGO.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Instead of relative to build directory. Shorter, and independent of
the path from build to source directory.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
The other test output files have fixed names, and having just one with
a name that varies with the test name complicates things with no gain.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Only actofgod-test wants it. Enable it there. The others either
don't want it (fire-test), or don't care.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Warn the first time a server is started. Incorrect for info-test with
POSIX threads, so suppress the warning there.
Improve the warning message a bit while we're at it.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
feed_input drops lines starting with a bar character '|', so they can
serve as comments. Syntax chosen because such lines shouldn't be
needed in tests. In particular, the server already ignores such lines
when it reads commands, because they get parsed as empty command with
a pipeline, and empty commands get ignored, regardless of
redirections.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Capturing the client's output tests both client and server, which is
nice. However, player input isn't visible in the resulting file,
which makes it more difficult to understand.
Route player output to journal (econfig key "keep_journal 2"), and
ignore client output.
Separate tests for the client would be useful.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
The smoke test waits for the server completing startup by trying to
connect until it works. Hangs if the server doesn't complete startup
for some reason. Make it give up after 5s.
Likewise, The smoke test waits for the server to terminate by trying
kill -0 until it fails. Hangs if the server doesn't terminate. Make
it give up after 5s.