home · contact · privacy
Rename and improve testing script.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 25 Aug 2015 02:05:24 +0000 (04:05 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 25 Aug 2015 02:05:24 +0000 (04:05 +0200)
test_python_variant.sh [deleted file]
test_server.sh [new file with mode: 0755]

diff --git a/test_python_variant.sh b/test_python_variant.sh
deleted file mode 100755 (executable)
index dc47daa..0000000
+++ /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 (executable)
index 0000000..8d6d7b4
--- /dev/null
@@ -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