wisp
 
(Arne Babenhauserheide)
2014-11-06: new test which tests the scheme reader.

new test which tests the scheme reader.

diff --git a/tests/runtests-scheme-reader.sh b/tests/runtests-scheme-reader.sh
new file mode 100755
--- /dev/null
+++ b/tests/runtests-scheme-reader.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Simple test runner for wisp, mainly intended to be run by autotools.
+
+if [[ x"$1" == x"" || x"$1" == x"." ]]; then
+    srcdir="$(realpath "$(pwd)")"
+else
+    srcdir="$(realpath "$1")"
+fi
+
+if [[ x"$2" == x"" || x"$2" == x"."  ]]; then
+    builddir="$(realpath $(pwd))"
+else
+    builddir="$(realpath "$2")"
+fi
+
+failed=0
+cd ${builddir}
+for i in ${srcdir}/tests/*.w; do
+    d=$(guile -L . --language=wisp ${srcdir}/testrunner.w "${i}" "${srcdir}/tests/$(basename "${i}" .w).scm")
+    if test $? -eq 0; then
+        continue
+    else
+        echo test "$i" failed. Diff: "$d"
+        failed=$((failed + 1))
+    fi
+done
+cd - >/dev/null # undo dir change
+# if test $failed -eq 0; then echo "Tests succeeded"; 
+# else echo "tests failed: ${failed}";
+# fi
+exit $failed