From 4f2b8eea10eece25c058f33df847be547b226138 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 8 Jan 2014 20:51:52 +0100 Subject: [PATCH] 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 --- tests/actofgod-test | 14 -------------- tests/fire-test | 14 -------------- tests/info-test | 5 +++++ tests/smoke-test | 14 -------------- tests/test-common.sh | 26 ++++++++++++++++++++++++++ 5 files changed, 31 insertions(+), 42 deletions(-) diff --git a/tests/actofgod-test b/tests/actofgod-test index 0afe1bc49..4f86a4bf9 100755 --- a/tests/actofgod-test +++ b/tests/actofgod-test @@ -9,20 +9,6 @@ srcdir="$1" . "$srcdir"/tests/test-common.sh -# -# Currently expected to work only with thread package LWP, because: -# -# - Thread scheduling is reliably deterministic only with LWP -# - Shell builtin kill appears not to do the job in MinGW -# - The Windows server tries to run as service when -d isn't -# specified -# -# TODO address these shortcomings. -# -if [ `sed -n 's/empthread *:= *\(.*\)/\1/p' &2 -fi - create_sandbox cat >>sandbox/etc/empire/econfig <&2 -fi - create_sandbox cat >>sandbox/etc/empire/econfig <&2 -fi - create_sandbox begin_test "$srcdir"/tests/smoke/fairland.xdump diff --git a/tests/test-common.sh b/tests/test-common.sh index 73b002109..806452063 100644 --- a/tests/test-common.sh +++ b/tests/test-common.sh @@ -8,6 +8,18 @@ fi test=${0##*/} test=${test%-test} +empthread=`sed -n 's/empthread *:= *\(.*\)/\1/p' &2 + warn_empthread= + fi +} + create_sandbox() { rm -rf sandbox @@ -33,6 +45,20 @@ start_server() { local pidfile=sandbox/var/empire/server.pid local timeout + + # + # Currently expected to work only with thread package LWP, + # because: + # + # - Thread scheduling is reliably deterministic only with LWP + # - Shell builtin kill appears not to do the job in MinGW + # - The Windows server tries to run as service when -d isn't + # specified + # + # TODO address these shortcomings. + # + check_empthread + pid= trap 'if [ "$pid" ]; then kill -9 "$pid" 2>/dev/null || true; fi' EXIT src/server/emp_server -e sandbox/etc/empire/econfig -R 1 -s -- 2.43.0