aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
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