Initial testing added.
authorJason Self <j@jxself.org>
Sat, 19 Sep 2015 04:01:00 +0000 (21:01 -0700)
committerJason Self <j@jxself.org>
Sat, 19 Sep 2015 04:01:00 +0000 (21:01 -0700)
14 files changed:
testing/Run_tests [new file with mode: 0755]
testing/short_file.txt [new file with mode: 0644]
testing/skein256sum-echo-n.command [new file with mode: 0644]
testing/skein256sum-echo-n.result [new file with mode: 0644]
testing/skein256sum-echo.command [new file with mode: 0644]
testing/skein256sum-echo.result [new file with mode: 0644]
testing/skein256sum-short_file-stdio.command [new file with mode: 0644]
testing/skein256sum-short_file-stdio.result [new file with mode: 0644]
testing/skein256sum-short_file.command [new file with mode: 0644]
testing/skein256sum-short_file.result [new file with mode: 0644]
testing/skein256sum-short_file_b.command [new file with mode: 0644]
testing/skein256sum-short_file_b.result [new file with mode: 0644]
testing/skein256sum-unexisting.command [new file with mode: 0644]
testing/skein256sum-unexisting.result [new file with mode: 0644]

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 ##
diff --git a/testing/short_file.txt b/testing/short_file.txt
new file mode 100644 (file)
index 0000000..01c4e1a
--- /dev/null
@@ -0,0 +1,2 @@
+line1 line1 line1 line1 line1 line1 line1 line1 line1
+line2 line2 line2 line2 line2 line2 line2 line2 line2
diff --git a/testing/skein256sum-echo-n.command b/testing/skein256sum-echo-n.command
new file mode 100644 (file)
index 0000000..e3a02f6
--- /dev/null
@@ -0,0 +1 @@
+echo -n | ../skein256sum
diff --git a/testing/skein256sum-echo-n.result b/testing/skein256sum-echo-n.result
new file mode 100644 (file)
index 0000000..1918da0
--- /dev/null
@@ -0,0 +1 @@
+39CCC4554A8B31853B9DE7A1FE638A24CCE6B35A55F2431009E18780335D2621 -
diff --git a/testing/skein256sum-echo.command b/testing/skein256sum-echo.command
new file mode 100644 (file)
index 0000000..daffce9
--- /dev/null
@@ -0,0 +1 @@
+echo | ../skein256sum
diff --git a/testing/skein256sum-echo.result b/testing/skein256sum-echo.result
new file mode 100644 (file)
index 0000000..4a2fc67
--- /dev/null
@@ -0,0 +1 @@
+13EF758A5C38E8906C148354351F3AEB669E44B5CB6CBE14D20D3DE8E269AB96 -
diff --git a/testing/skein256sum-short_file-stdio.command b/testing/skein256sum-short_file-stdio.command
new file mode 100644 (file)
index 0000000..e6c4cd4
--- /dev/null
@@ -0,0 +1 @@
+../skein256sum < short_file.txt
diff --git a/testing/skein256sum-short_file-stdio.result b/testing/skein256sum-short_file-stdio.result
new file mode 100644 (file)
index 0000000..4f6fe3f
--- /dev/null
@@ -0,0 +1 @@
+1B03A49DD903B91F84438914D18D6BB79FEB2DD2495EF2AEE6215F6D2CE87382 -
diff --git a/testing/skein256sum-short_file.command b/testing/skein256sum-short_file.command
new file mode 100644 (file)
index 0000000..0b019aa
--- /dev/null
@@ -0,0 +1 @@
+../skein256sum short_file.txt
diff --git a/testing/skein256sum-short_file.result b/testing/skein256sum-short_file.result
new file mode 100644 (file)
index 0000000..369bdcd
--- /dev/null
@@ -0,0 +1 @@
+1B03A49DD903B91F84438914D18D6BB79FEB2DD2495EF2AEE6215F6D2CE87382 short_file.txt
diff --git a/testing/skein256sum-short_file_b.command b/testing/skein256sum-short_file_b.command
new file mode 100644 (file)
index 0000000..e52d9d8
--- /dev/null
@@ -0,0 +1 @@
+../skein256sum -b short_file.txt
diff --git a/testing/skein256sum-short_file_b.result b/testing/skein256sum-short_file_b.result
new file mode 100644 (file)
index 0000000..56c86b3
--- /dev/null
@@ -0,0 +1 @@
+1B03A49DD903B91F84438914D18D6BB79FEB2DD2495EF2AEE6215F6D2CE87382 *short_file.txt
diff --git a/testing/skein256sum-unexisting.command b/testing/skein256sum-unexisting.command
new file mode 100644 (file)
index 0000000..c16dd50
--- /dev/null
@@ -0,0 +1 @@
+../skein256sum Something_unexisting
diff --git a/testing/skein256sum-unexisting.result b/testing/skein256sum-unexisting.result
new file mode 100644 (file)
index 0000000..4a530ec
--- /dev/null
@@ -0,0 +1 @@
+skein256sum: Something_unexisting: no such file or directory