home · contact · privacy
Fix buggy healthy_addch().
[plomrogue] / test_server.sh
1 #!/bin/sh
2
3 set -e
4
5 ./build.sh
6 echo "Copying tested server to ./testing/tested_server.py and ./testing/server."
7 cp ./roguelike-server ./testing/tested_server.py
8 cp -R ./server ./testing/
9 echo "Copying tested C library source to ./tested_server_lib.c."
10 cp ./libplomrogue.c ./testing/tested_server_lib.c
11
12 cp ./testing/start _test
13 echo "Starting server on save file '_test' copied from ./testing/start."
14 python3 -m cProfile -o ./testing/cProfile roguelike-server -l _test &
15
16 echo "Waiting until ./server/in is ready for writing."
17 while [ ! -e ./server_run/in ]
18 do
19     sleep 0.1
20 done
21
22 echo "Catting ./testing/run into ./server/in."
23 cat ./testing/run >> server_run/in
24
25 echo "Waiting until server has quit (i.e. ./server/in has disappeared)."
26 while [ -e ./server_run/in ]
27 do
28     sleep 1
29 done
30
31 echo "Server has quit. Here's the length of the diff of final '_test' (copy at"
32 echo "./testing/last_end) to the reference save file ./testing/ref_end (TEST WENT "
33 echo "WELL IF ZERO): "
34 mv _test testing/last_end
35 diff testing/last_end testing/ref_end | wc -l
36
37 rm record__test