test: enable all tests, use expect count, add tinycc tests.
[mes.git] / build-aux / test.sh
index 4454c48888f051f6843757ede22acdbb9cd35826..cf9932a7748fa3b34d79b80371c541cace78e2a7 100755 (executable)
 
 set -ex
 
+GUILE=${GUILE-$MES}
+DIFF=${DIFF-$(command -v diff)}
+DIFF=${DIFF-sh build-aux/diff.scm}
+
 t=${1-scaffold/tests/t}
 #rm -f "$t".i686-unknown-linux-gnu-out
 rm -f "$t".mes-out
@@ -27,11 +31,14 @@ rm -f "$t".mes-out
 sh build-aux/cc-mes.sh "$t"
 
 r=0
+[ -f "$t".exit ] && r=$(cat "$t".exit)
 set +e
-"$t".mes-out | tee "$t".stdout
+"$t".mes-out "$@" > "$t".stdout
 m=$?
+cat "$t".stdout
+set -e
 
 [ $m = $r ]
 if [ -f "$t".expect ]; then
-    diff -u "$t".expect "$t".stdout;
+    $DIFF -u "$t".expect "$t".stdout;
 fi