From: Jason Self Date: Sat, 19 Sep 2015 04:01:00 +0000 (-0700) Subject: Initial testing added. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8bc5acdf01f1636c86626bdd2a9c43d2ab266ecc;p=skeinsum.git Initial testing added. --- diff --git a/testing/Run_tests b/testing/Run_tests new file mode 100755 index 0000000..5fd4b7f --- /dev/null +++ b/testing/Run_tests @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Copyright (C) 2015 Jason Self +# +# 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 index 0000000..01c4e1a --- /dev/null +++ b/testing/short_file.txt @@ -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 index 0000000..e3a02f6 --- /dev/null +++ b/testing/skein256sum-echo-n.command @@ -0,0 +1 @@ +echo -n | ../skein256sum diff --git a/testing/skein256sum-echo-n.result b/testing/skein256sum-echo-n.result new file mode 100644 index 0000000..1918da0 --- /dev/null +++ b/testing/skein256sum-echo-n.result @@ -0,0 +1 @@ +39CCC4554A8B31853B9DE7A1FE638A24CCE6B35A55F2431009E18780335D2621 - diff --git a/testing/skein256sum-echo.command b/testing/skein256sum-echo.command new file mode 100644 index 0000000..daffce9 --- /dev/null +++ b/testing/skein256sum-echo.command @@ -0,0 +1 @@ +echo | ../skein256sum diff --git a/testing/skein256sum-echo.result b/testing/skein256sum-echo.result new file mode 100644 index 0000000..4a2fc67 --- /dev/null +++ b/testing/skein256sum-echo.result @@ -0,0 +1 @@ +13EF758A5C38E8906C148354351F3AEB669E44B5CB6CBE14D20D3DE8E269AB96 - diff --git a/testing/skein256sum-short_file-stdio.command b/testing/skein256sum-short_file-stdio.command new file mode 100644 index 0000000..e6c4cd4 --- /dev/null +++ b/testing/skein256sum-short_file-stdio.command @@ -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 index 0000000..4f6fe3f --- /dev/null +++ b/testing/skein256sum-short_file-stdio.result @@ -0,0 +1 @@ +1B03A49DD903B91F84438914D18D6BB79FEB2DD2495EF2AEE6215F6D2CE87382 - diff --git a/testing/skein256sum-short_file.command b/testing/skein256sum-short_file.command new file mode 100644 index 0000000..0b019aa --- /dev/null +++ b/testing/skein256sum-short_file.command @@ -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 index 0000000..369bdcd --- /dev/null +++ b/testing/skein256sum-short_file.result @@ -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 index 0000000..e52d9d8 --- /dev/null +++ b/testing/skein256sum-short_file_b.command @@ -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 index 0000000..56c86b3 --- /dev/null +++ b/testing/skein256sum-short_file_b.result @@ -0,0 +1 @@ +1B03A49DD903B91F84438914D18D6BB79FEB2DD2495EF2AEE6215F6D2CE87382 *short_file.txt diff --git a/testing/skein256sum-unexisting.command b/testing/skein256sum-unexisting.command new file mode 100644 index 0000000..c16dd50 --- /dev/null +++ b/testing/skein256sum-unexisting.command @@ -0,0 +1 @@ +../skein256sum Something_unexisting diff --git a/testing/skein256sum-unexisting.result b/testing/skein256sum-unexisting.result new file mode 100644 index 0000000..4a530ec --- /dev/null +++ b/testing/skein256sum-unexisting.result @@ -0,0 +1 @@ +skein256sum: Something_unexisting: no such file or directory