summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts')
-rwxr-xr-xtests/scripts/gen-simple12
-rw-r--r--tests/scripts/makefile16
-rwxr-xr-xtests/scripts/run-xpass11
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/scripts/gen-simple b/tests/scripts/gen-simple
new file mode 100755
index 0000000..3ce75f3
--- /dev/null
+++ b/tests/scripts/gen-simple
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+mkdir -p $(for d in "${@}"; do echo "$d"; done | uniq | sed "s|^|reports/|")
+
+for s in "${@}"
+do
+ echo ".PHONY: $s" >> tests.mk
+ echo "$s:" >> tests.mk
+ echo " ./scripts/run-xpass $s" >> tests.mk
+done
+
+echo "TESTS += " "${@}" >> tests.mk
diff --git a/tests/scripts/makefile b/tests/scripts/makefile
new file mode 100644
index 0000000..6354488
--- /dev/null
+++ b/tests/scripts/makefile
@@ -0,0 +1,16 @@
+.PHONY: all
+all: check
+
+TESTS :=
+include tests.mk
+
+.PHONY: check
+check: $(TESTS)
+ @cd reports; for d in $(TESTS) ; do \
+ if [ ! -f "$$d/OK" ]; then \
+ echo "BROKEN: $$d" ; \
+ elif [ "$$(tail -n1 $$d/OK)" != "OK" ]; then \
+ echo "FAIL: $$d" ; \
+ fi \
+ done
+ @echo "Done."
diff --git a/tests/scripts/run-xpass b/tests/scripts/run-xpass
new file mode 100755
index 0000000..d20c436
--- /dev/null
+++ b/tests/scripts/run-xpass
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+TEST="$1"
+OK="reports/$TEST/OK"
+LOG="reports/$TEST/log"
+
+if "./$1" > "$LOG" 2> "$LOG"; then
+ echo OK > "$OK"
+else
+ echo FAIL > "$OK"
+fi