Initial testing added.
[skeinsum.git] / testing / Run_tests
diff --git a/testing/Run_tests b/testing/Run_tests
new file mode 100755 (executable)
index 0000000..5fd4b7f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 Jason Self <j@jxself.org>
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
+
+cd "$(dirname "$0")"
+
+for f in *.command; do
+    n="$(basename "$f" .command)"
+    r="$n.result"
+    t="$n.$(date +%Y-%m-%d-%H%M%S)"
+    test -s "$r" || { echo "WARNING: missing $r"; continue; }
+    sh "$f" > $t 2>&1
+    diff -U0 "$r" "$t" && { rm "$t"; continue; }
+    echo "ERROR: $n failed"
+    exit 1
+done
+
+## END ##