aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-05-14 22:27:12 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-05-14 22:27:12 +1200
commitd732e377e81ba1c49d1e4f537066cd989feebca2 (patch)
tree88f819eb14d85bb3295c0a9584d702817266d112 /test/test.sh
parentfee0d71bb6790d2e9c4fdfdc40ef699e67abe87f (diff)
downloadpgm-interlace-d732e377e81ba1c49d1e4f537066cd989feebca2.tar.xz
Add beginnings of test suite
Diffstat (limited to 'test/test.sh')
-rwxr-xr-xtest/test.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/test.sh b/test/test.sh
new file mode 100755
index 0000000..0ba6164
--- /dev/null
+++ b/test/test.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+fail()
+{
+ echo -e '[\e[1;31mFAIL\e[0m] '$i
+}
+
+pass()
+{
+ echo -e '[\e[0;32mPASS\e[0m] '$i
+}
+
+
+#########################
+# tests expected to pass
+
+cd $(dirname $0)
+export EXECUTABLE="$PWD/../pgm-interlace"
+
+
+
+pushd pass >/dev/null
+for i in *.sh ; do
+ name=${i/.sh/}
+ expected="$name.pgm.expected"
+ out="$name.pgm.out"
+ ./$i
+ diff $expected $out
+ if [ $? -ne 0 ] ; then
+ fail
+ exit 1
+ fi
+ pass
+ rm $out
+done
+popd > /dev/null