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