home · contact · privacy
7DRL: Some population balancing.
[plomrogue] / test_server.sh
1 #!/bin/sh
2
3 ./redo
4 cp ./roguelike-server ./testing/tested_server
5 cp ./src/server/libplomrogue.c ./testing/tested_server_lib.c
6
7 cp ./testing/start _test
8 echo "Starting server on save file '_test' copied from ./testing/start."
9 python3 -m cProfile -o ./testing/cProfile roguelike-server -l _test &
10
11 echo "Waiting until ./server/in is ready for writing."
12 while [ ! -e ./server/in ]
13 do
14     sleep 0.1
15 done
16
17 echo "Catting ./testing/run into ./server/in."
18 cat ./testing/run >> server/in
19
20 echo "Waiting until server has quit (i.e. ./server/in has disappeared)."
21 while [ -e ./server/in ]
22 do
23     sleep 1
24 done
25
26 echo "Server has quit. Here's the diff of final '_test' to reference save file"
27 echo "./testing/ref_end (TEST WENT WELL IF NO LINES FOLLOW):"
28 mv _test testing/last_end
29 diff testing/last_end testing/ref_end
30 #echo 'NODIFF'
31
32 rm record__test