aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/driver.sh
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@csail.mit.edu>2018-05-19 16:39:49 -0400
committerGravatar GitHub <noreply@github.com>2018-05-19 16:39:49 -0400
commit077666b77bf21054e1e1f67ba61dfbaf57525378 (patch)
treef38f14cf8adb099d94fdc28d52c64ae879a0359d /tests/driver.sh
parent30edae2956d346e7df7ca27fcc77432e45cea99e (diff)
parent4c01511f5bf2229da7b146943444278d714ed7d6 (diff)
Merge pull request #123 from ashalkhakov/tests
Adding Selenium-based checking to tests.
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`