aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/driver.sh
diff options
context:
space:
mode:
authorGravatar major seitan <majorseitan@users.noreply.github.com>2018-06-02 14:58:45 -0400
committerGravatar GitHub <noreply@github.com>2018-06-02 14:58:45 -0400
commit87c86c5d2066a8805c7e72e3279ae8d5822f0c90 (patch)
tree02fa912c9b44ee07c0fcfe2bad0e2b686d0103b3 /tests/driver.sh
parentb4ffc6c4837e06c48a1a15ea662c25aa92566bf6 (diff)
parent1c493e9ec47f4754dd7237078e8c4f3300925ce3 (diff)
Merge branch 'master' into master
Diffstat (limited to 'tests/driver.sh')
-rwxr-xr-xtests/driver.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/driver.sh b/tests/driver.sh
new file mode 100755
index 00000000..cc62644b
--- /dev/null
+++ b/tests/driver.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if [[ $# -eq 0 ]] ; then
+ echo 'Supply at least one argument'
+ exit 1
+fi
+
+TESTDB=/tmp/$1.db
+TESTSQL=/tmp/$1.sql
+TESTPID=/tmp/$1.pid
+TESTSRV=./$1.exe
+
+rm -f $TESTDB $TESTSQL $TESTPID $TESTSRV
+../bin/urweb -debug -boot -noEmacs -dbms sqlite -db $TESTDB -sql $TESTSQL "$1" || exit 1
+
+if [ -e $TESTSQL ]
+then
+ sqlite3 $TESTDB < $TESTSQL
+fi
+
+$TESTSRV -q -a 127.0.0.1 &
+echo $! >> $TESTPID
+sleep 1
+python -m unittest $1.py
+kill `cat $TESTPID`