about summary refs log tree commit diff
path: root/test/pamsumm.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamsumm.test')
-rwxr-xr-xtest/pamsumm.test19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/pamsumm.test b/test/pamsumm.test
index 882b1b14..5b4fdb17 100755
--- a/test/pamsumm.test
+++ b/test/pamsumm.test
@@ -17,14 +17,23 @@ for type in -sum -min -max -mean
   done
 
 
-echo "Test 3"
+echo "Test Invalid"
+
+tmpdir=${tmpdir:-/tmp}
+test_out=${tmpdir}/test_out
 
 echo 1>&2
 echo "Invalid command-line argument combinations." 1>&2
 echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
-pamsumm -sum -min  testimg.ppm || echo "Expected failure 1"
-pamsumm -sum -max  testimg.ppm || echo "Expected failure 2"
-pamsumm -mean -max testimg.ppm || echo "Expected failure 3"
-pamsumm            testimg.ppm || echo "Expected failure 4"
+pamsumm -sum -min  testimg.ppm > ${test_out} || \
+   echo -n "Expected failure 1"; test -s ${test_out}; echo " "$?
+pamsumm -sum -max  testimg.ppm > ${test_out} || \
+   echo -n "Expected failure 2"; test -s ${test_out}; echo " "$?
+pamsumm -mean -max testimg.ppm > ${test_out} || \
+   echo -n "Expected failure 3"; test -s ${test_out}; echo " "$?
+pamsumm            testimg.ppm > ${test_out} || \
+   echo -n "Expected failure 4"; test -s ${test_out}; echo " "$?
+
+rm ${test_out}