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>
This commit is contained in:
parent
4f2b8eea10
commit
ca21354d56
66 changed files with 119 additions and 32 deletions
|
@ -18,14 +18,7 @@ GODNEWS 0
|
|||
EOF
|
||||
|
||||
begin_test "$srcdir"/tests/fire/init_script
|
||||
|
||||
for i in `git ls-files "$srcdir"/tests/fire | grep '/[0-9][0-9]-.*$'`
|
||||
do
|
||||
c="${i##*/??-}"
|
||||
r=`echo $c | sed 's/^POGO$/peter/'`
|
||||
feed_input "$c" "$r" "$i"
|
||||
done
|
||||
|
||||
feed_dir "$srcdir"/tests/fire
|
||||
end_test
|
||||
|
||||
cmp_out var/empire/server.log var/empire/journal.log fire.xdump
|
||||
|
|
|
@ -14,30 +14,7 @@ create_sandbox
|
|||
begin_test "$srcdir"/tests/smoke/fairland.xdump
|
||||
|
||||
feed_input POGO peter "$srcdir"/tests/smoke/newcap_script
|
||||
|
||||
t=
|
||||
for i in `git ls-files "$srcdir"/tests/smoke | grep 'tests/smoke/../..$'`
|
||||
do
|
||||
p="$t"
|
||||
t="${i%/??}"
|
||||
if [ "$p" != "$t" ] && [ "$p" ]
|
||||
then
|
||||
feed_input POGO peter <<EOF
|
||||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
||||
EOF
|
||||
fi
|
||||
b="${i##*/}"
|
||||
if [ $b -eq 0 ]
|
||||
then c=POGO r=peter
|
||||
else c="${b#0}"; r="$c"
|
||||
fi
|
||||
feed_input "$c" "$r" "$i"
|
||||
done
|
||||
feed_dir "$srcdir"/tests/smoke
|
||||
|
||||
end_test
|
||||
|
||||
|
|
6
tests/smoke/00/99-POGO
Normal file
6
tests/smoke/00/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/01/99-POGO
Normal file
6
tests/smoke/01/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/02/99-POGO
Normal file
6
tests/smoke/02/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/03/99-POGO
Normal file
6
tests/smoke/03/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/04/99-POGO
Normal file
6
tests/smoke/04/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/05/99-POGO
Normal file
6
tests/smoke/05/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/06/99-POGO
Normal file
6
tests/smoke/06/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/07/99-POGO
Normal file
6
tests/smoke/07/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/08/99-POGO
Normal file
6
tests/smoke/08/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/09/99-POGO
Normal file
6
tests/smoke/09/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/10/99-POGO
Normal file
6
tests/smoke/10/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/11/99-POGO
Normal file
6
tests/smoke/11/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/12/99-POGO
Normal file
6
tests/smoke/12/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/13/99-POGO
Normal file
6
tests/smoke/13/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/14/99-POGO
Normal file
6
tests/smoke/14/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/15/99-POGO
Normal file
6
tests/smoke/15/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
6
tests/smoke/16/99-POGO
Normal file
6
tests/smoke/16/99-POGO
Normal file
|
@ -0,0 +1,6 @@
|
|||
power new
|
||||
report *
|
||||
cen * ?own#0
|
||||
comm * ?own#0
|
||||
reso * ?own#0
|
||||
force
|
|
@ -104,6 +104,21 @@ feed_input()
|
|||
sed '/^|/d' "$@" | src/client/empire "$c" "$r" >/dev/null
|
||||
}
|
||||
|
||||
feed_files()
|
||||
{
|
||||
for i
|
||||
do
|
||||
c="${i##*/*-}"
|
||||
r=`echo $c | sed 's/^POGO$/peter/'`
|
||||
feed_input "$c" "$r" "$i"
|
||||
done
|
||||
}
|
||||
|
||||
feed_dir()
|
||||
{
|
||||
feed_files `git ls-files "$@" | grep '/[0-9][0-9]-[^/]*$'`
|
||||
}
|
||||
|
||||
begin_test()
|
||||
{
|
||||
src/util/files -e sandbox/etc/empire/econfig -f >/dev/null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue