From: Christian Heller Date: Tue, 25 Aug 2015 02:05:24 +0000 (+0200) Subject: Rename and improve testing script. X-Git-Tag: tce~345 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/condition?a=commitdiff_plain;h=2a73d6624309aeac6bc0077d27f401cba9cb0847;p=plomrogue Rename and improve testing script. --- diff --git a/test_python_variant.sh b/test_python_variant.sh deleted file mode 100755 index dc47daa..0000000 --- a/test_python_variant.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -cp ./testing/start _test -echo "Starting server on save file '_test' copied from ./testing/start." -python3 -m cProfile -o ./testing/cProfile plomrogue-server.py -l _test > ./testing/log 2>&1 & - -echo "Waiting until ./server/in is ready for writing." -while [ ! -e ./server/in ] -do - sleep 0.1 -done - -echo "Catting ./testing/run into ./server/in." -cat ./testing/run >> server/in - -echo "Waiting until server has quit (i.e. ./server/in has disappeared)." -while [ -e ./server/in ] -do - sleep 1 -done - -echo "Server has quit. Here's the diff of final '_test' to reference save file" -echo "./testing/ref_end (TEST WENT WELL IF NO LINES FOLLOW):" -diff _test testing/ref_end > ./testing/diff -cat ./testing/diff - -rm _test -rm record__test diff --git a/test_server.sh b/test_server.sh new file mode 100755 index 0000000..8d6d7b4 --- /dev/null +++ b/test_server.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +./redo +echo "Copying tested server script to ./tested_server.py." +cp ./plomrogue-server.py ./testing/tested_server.py +echo "Copying tested C library source to ./tested_server_lib.c." +cp ./libplomrogue.c ./testing/tested_server_lib.c + +cp ./testing/start _test +echo "Starting server on save file '_test' copied from ./testing/start." +python3 -m cProfile -o ./testing/cProfile plomrogue-server.py -l _test & + +echo "Waiting until ./server/in is ready for writing." +while [ ! -e ./server/in ] +do + sleep 0.1 +done + +echo "Catting ./testing/run into ./server/in." +cat ./testing/run >> server/in + +echo "Waiting until server has quit (i.e. ./server/in has disappeared)." +while [ -e ./server/in ] +do + sleep 1 +done + +echo "Server has quit. Here's the length of the diff of final '_test' (copy at" +echo "./testing/last_end) to the reference save file ./testing/ref_end (TEST WENT " +echo "WELL IF ZERO): " +mv _test testing/last_end +diff testing/last_end testing/ref_end | wc -l + +rm record__test