Commit graph

24 commits

Author SHA1 Message Date
4c92dc36ba tests: Simplify running cmp_out more than once
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>
2015-02-01 16:52:59 +01:00
cc692142d9 tests: Feed only logs and xdump to normalize.pl
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>
2015-02-01 16:52:59 +01:00
9f33eb1ba8 tests: Define and use some abbreviations
No functional change.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
c2683e5b58 tests: Save diff -u between expected and actual output
"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>
2014-02-16 13:19:25 +01:00
582ad80d75 Suppress duplicates in output of git ls-files
Happens during merges; can mess up tests badly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 13:19:24 +01:00
caf239b3ed tests: Zap setup's news and lost items, like telegrams
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 11:51:50 +01:00
370b9d1c07 tests: Don't leak telegram counters from setup into test
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>
2014-02-16 11:44:42 +01:00
6c0a1fcb1e tests: Enable running_test_suite by default
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:17 +01:00
558b4078ff tests: New make target check-accept
Updates expected results from actual results, for review and commit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:17 +01:00
e444cac552 tests: Run server with -E crash-dump
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:17 +01:00
cf942fbf1b tests: Use feed_files for setup scripts
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>
2014-01-19 10:09:16 +01:00
c82a481bc3 tests: Name compared files relative to sandbox in output
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>
2014-01-19 10:09:16 +01:00
ab913d73f9 tests: Rename final xdump files to final.xdump
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>
2014-01-19 10:09:16 +01:00
d38b685ca3 tests: Disable GODNEWS by default
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>
2014-01-19 10:09:16 +01:00
ca21354d56 tests: Factor feed_dir out of fire-test and smoke-test
Smoke test's player input files renamed from $cnum to $ordnum-$cname
to keep feed_dir simple.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
4f2b8eea10 tests: Move "not expected to work" warning into test-common.sh
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>
2014-01-19 10:08:20 +01:00
8a94f2a8ae tests: Make helper begin_test accept any number of arguments
Zero arguments mean "read the script from stdin", so you can write
begin_test <<EOF...

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:05 +01:00
d0d692e415 tests: New helper function feed_input, for comment support
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>
2014-01-06 20:49:56 +01:00
71cb2d8940 tests: Use only files known to git
Filename expansion can pick up junk files.  Use git-ls-files instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:45 +01:00
3404b9ce7f tests: Factor out begin_tests(), end_tests()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:07:22 +01:00
9ca3fa95b8 tests: Capture player output via journal instead of client
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>
2013-05-31 10:52:50 +02:00
a835282a3c tests: Enable thread stack checking (emp_server -s)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-05-31 09:27:09 +02:00
a59e496024 Make smoke test time out instead of hang when server misbehaves
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.
2013-05-08 06:57:55 +02:00
d161b6d9e4 Factor tests/test-common.sh out of tests/smoke-test
For reuse by future tests.
2013-05-08 06:55:18 +02:00