about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-06 01:58:21 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-08-06 01:58:21 +0000
commit3ac3ffc658517ae4591509ee17c1475ba698f24f (patch)
tree4e034553533fb6a6d9ca8cdfec15c9b39ae97578 /test
parent5e8f6c0a506db90a88ac975b7beb764568b4b980 (diff)
downloadnetpbm-mirror-3ac3ffc658517ae4591509ee17c1475ba698f24f.tar.gz
netpbm-mirror-3ac3ffc658517ae4591509ee17c1475ba698f24f.tar.xz
netpbm-mirror-3ac3ffc658517ae4591509ee17c1475ba698f24f.zip
Better reporting for invalid test cases; correction of need-Bash classification
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4578 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r--test/pamarith.ok84
-rwxr-xr-xtest/pamarith.test168
-rw-r--r--test/pamcat1.ok28
-rwxr-xr-xtest/pamcat1.test56
-rw-r--r--test/pamcat3.ok18
-rwxr-xr-xtest/pamcat3.test36
-rw-r--r--test/pamchannel.ok6
-rwxr-xr-xtest/pamchannel.test13
-rw-r--r--test/pamcrater.ok8
-rwxr-xr-xtest/pamcrater.test16
-rw-r--r--test/pamcut.ok30
-rwxr-xr-xtest/pamcut.test60
-rw-r--r--test/pamdepth.ok4
-rwxr-xr-xtest/pamdepth.test8
-rw-r--r--test/pamditherbw.ok24
-rwxr-xr-xtest/pamditherbw.test48
-rw-r--r--test/pamfile.ok6
-rwxr-xr-xtest/pamfile.test12
-rw-r--r--test/pamfind.ok8
-rwxr-xr-xtest/pamfind.test16
-rw-r--r--test/pamfix.ok8
-rwxr-xr-xtest/pamfix.test14
-rw-r--r--test/pamfunc.ok48
-rwxr-xr-xtest/pamfunc.test96
-rw-r--r--test/pamgauss.ok10
-rwxr-xr-xtest/pamgauss.test20
-rw-r--r--test/pamhue.ok2
-rwxr-xr-xtest/pamhue.test4
-rwxr-xr-xtest/pamrecolor.ok12
-rwxr-xr-xtest/pamrecolor.test24
-rw-r--r--test/pamrestack.ok10
-rwxr-xr-xtest/pamrestack.test20
-rw-r--r--test/pamscale-reportonly.ok12
-rwxr-xr-xtest/pamscale-reportonly.test24
-rw-r--r--test/pamseq.ok8
-rwxr-xr-xtest/pamseq.test16
-rwxr-xr-xtest/pamshuffle.ok6
-rwxr-xr-xtest/pamshuffle.test12
-rw-r--r--test/pamsumm.ok8
-rwxr-xr-xtest/pamsumm.test16
-rw-r--r--test/pamtable.ok4
-rwxr-xr-xtest/pamtable.test6
-rw-r--r--test/pamundice.ok24
-rwxr-xr-xtest/pamundice.test48
-rw-r--r--test/pbmclean.ok2
-rwxr-xr-xtest/pbmclean.test4
-rw-r--r--test/pbmmake.ok16
-rwxr-xr-xtest/pbmmake.test32
-rw-r--r--test/pbmnoise-parameters.ok50
-rwxr-xr-xtest/pbmnoise-parameters.test100
-rw-r--r--test/pbmpage.ok6
-rwxr-xr-xtest/pbmpage.test12
-rw-r--r--test/pbmpscale.ok6
-rwxr-xr-xtest/pbmpscale.test12
-rwxr-xr-xtest/pbmtext-iso88591.test2
-rw-r--r--test/pbmtext-utf8.ok16
-rwxr-xr-xtest/pbmtext-utf8.test32
-rw-r--r--test/pbmtext.ok22
-rwxr-xr-xtest/pbmtext.test44
-rw-r--r--test/pbmtextps-dump.ok70
-rwxr-xr-xtest/pbmtextps-dump.test16
-rw-r--r--test/pbmtopgm.ok8
-rwxr-xr-xtest/pbmtopgm.test16
-rw-r--r--test/pbmupc.ok18
-rwxr-xr-xtest/pbmupc.test36
-rw-r--r--test/pgmhist.ok8
-rwxr-xr-xtest/pgmhist.test16
-rw-r--r--test/pgmmake.ok16
-rwxr-xr-xtest/pgmmake.test32
-rw-r--r--test/pgmnoise-parameters.ok10
-rwxr-xr-xtest/pgmnoise-parameters.test20
-rw-r--r--test/pgmnoise.ok20
-rwxr-xr-xtest/pgmnoise.test40
-rw-r--r--test/pgmramp.ok10
-rwxr-xr-xtest/pgmramp.test12
-rw-r--r--test/pgmtoppm.ok22
-rwxr-xr-xtest/pgmtoppm.test48
-rw-r--r--test/pnmcat.ok28
-rwxr-xr-xtest/pnmcat.test56
-rw-r--r--test/pnmcolormap.ok14
-rwxr-xr-xtest/pnmcolormap.test28
-rw-r--r--test/pnmcrop1.ok22
-rwxr-xr-xtest/pnmcrop1.test6
-rw-r--r--test/pnmcrop3.ok4
-rwxr-xr-xtest/pnmcrop3.test12
-rw-r--r--test/pnmpsnr.ok8
-rwxr-xr-xtest/pnmpsnr.test16
-rw-r--r--test/pnmquant.ok16
-rwxr-xr-xtest/pnmquant.test32
-rw-r--r--test/pnmremap1.ok12
-rwxr-xr-xtest/pnmremap1.test24
-rw-r--r--test/pnmtile.ok8
-rwxr-xr-xtest/pnmtile.test16
-rw-r--r--test/ppmforge-parameters.ok14
-rwxr-xr-xtest/ppmforge-parameters.test28
-rw-r--r--test/ppmhist.ok6
-rwxr-xr-xtest/ppmhist.test12
-rw-r--r--test/ppmmake.ok20
-rwxr-xr-xtest/ppmmake.test40
-rw-r--r--test/ppmpat.ok52
-rwxr-xr-xtest/ppmpat.test104
-rw-r--r--test/ppmtoapplevol.ok6
-rwxr-xr-xtest/ppmtoapplevol.test12
-rw-r--r--test/ppmwheel.ok10
-rwxr-xr-xtest/ppmwheel.test20
-rw-r--r--test/qoi-roundtrip.ok28
-rwxr-xr-xtest/qoi-roundtrip.test54
-rwxr-xr-xtest/stdin-pam1.test2
-rwxr-xr-xtest/stdin-pam2.test2
-rwxr-xr-xtest/stdin-ppm3.test2
110 files changed, 1294 insertions, 1295 deletions
diff --git a/test/pamarith.ok b/test/pamarith.ok
index c2d34dea..a0942fb8 100644
--- a/test/pamarith.ok
+++ b/test/pamarith.ok
@@ -233,45 +233,45 @@ Prints 2247801875 481 three times, then 320101399 59 three times
 -xor
 320101399 59
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
-Expected failure 15 1
-Expected failure 16 1
-Expected failure 17 1
-Expected failure 18 1
-Expected failure 19 1
-Expected failure 20 1
-Expected failure 21 1
-Expected failure 22 1
-Expected failure 23 1
-Expected failure 24 1
-Expected failure 25 1
-Expected failure 26 1
-Expected failure 27 1
-Expected failure 28 1
-Expected failure 29 1
-Expected failure 30 1
-Expected failure 31 1
-Expected failure 32 1
-Expected failure 33 1
-Expected failure 34 1
-Expected failure 35 1
-Expected failure 36 1
-Expected failure 37 1
-Expected failure 38 1
-Expected failure 39 1
-Expected failure 40 1
-Expected failure 41 1
-Expected failure 42 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
+Expected failure 15 (no output)
+Expected failure 16 (no output)
+Expected failure 17 (no output)
+Expected failure 18 (no output)
+Expected failure 19 (no output)
+Expected failure 20 (no output)
+Expected failure 21 (no output)
+Expected failure 22 (no output)
+Expected failure 23 (no output)
+Expected failure 24 (no output)
+Expected failure 25 (no output)
+Expected failure 26 (no output)
+Expected failure 27 (no output)
+Expected failure 28 (no output)
+Expected failure 29 (no output)
+Expected failure 30 (no output)
+Expected failure 31 (no output)
+Expected failure 32 (no output)
+Expected failure 33 (no output)
+Expected failure 34 (no output)
+Expected failure 35 (no output)
+Expected failure 36 (no output)
+Expected failure 37 (no output)
+Expected failure 38 (no output)
+Expected failure 39 (no output)
+Expected failure 40 (no output)
+Expected failure 41 (no output)
+Expected failure 42 (no output)
diff --git a/test/pamarith.test b/test/pamarith.test
index 061f9488..03ce7317 100755
--- a/test/pamarith.test
+++ b/test/pamarith.test
@@ -127,130 +127,130 @@ test_out=${tmpdir}/test_out
 # multiple functions
 
 pamarith -add -subtract testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -multiply -divide testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -difference -minimum testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -maximum -mean testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -compare -and testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -compare -equal testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -or -nand testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -nor -xor testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -shiftleft -shiftright testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -add does not take a value
 
 pamarith -add=1 testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 10"
- test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # No function
 
 pamarith -plain testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Just one input image file
 
 pamarith -add testimg.ppm > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # No input image file
 
 pamarith -add > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Input images with different depth (number of planes)
 
 pamchannel -infile testimg.ppm 0 1 | \
   pamarith -add testimg.ppm - > ${test_out} || \
-  printf "Expected failure 15"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 15 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Input images with different x/y dimensions
 
 pamarith -add testimg.ppm testgrid.pbm > ${test_out} || \
-  printf "Expected failure 16"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 16 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamenlarge -xscale=2 testgrid.pbm | \
   pamarith -add testgrid.pbm - > ${test_out} || \
-  printf "Expected failure 17"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 17 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamenlarge -yscale=3 testgrid.pbm | \
   pamarith -add testgrid.pbm - > ${test_out} || \
-  printf "Expected failure 18"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 18 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Invalid usage of -closeness
 
 pamarith -equal -closeness=100.1 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 19"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 19 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -equal -closeness=-10 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 20"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 20 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -closeness -equal testgrid.pbm > ${test_out} || \
-  printf "Expected failure 21"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 21 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -compare -closeness=10 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 22"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 22 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Bit string functions
@@ -267,65 +267,65 @@ pgmmake -maxval=8191 1.0 3 1 > ${input5_pgm}
 # Bit string functions - Maxval must match
 
 pamarith -and ${input3_pgm} ${input5_pgm} > ${test_out} || \
-  printf "Expected failure 23"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 23 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -or ${input3_pgm} ${input5_pgm} > ${test_out} || \
-  printf "Expected failure 24"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 24 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -nand ${input3_pgm} ${input5_pgm} > ${test_out} || \
-  printf "Expected failure 25"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 25 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -nor ${input3_pgm} ${input5_pgm} > ${test_out} || \
-  printf "Expected failure 26"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 26 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -xor ${input3_pgm} ${input5_pgm} > ${test_out} || \
-  printf "Expected failure 27"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 27 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Bit string functions - Maxval must be 2^n -1
 
 pamarith -and ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 28"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 28 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -or ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 29"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 29 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -nand ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 30"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 30 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -nor ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 31"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 31 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -xor ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 32"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 32 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -shiftleft ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 33"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 33 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -shiftright ${input4_pgm} ${input4_pgm} > ${test_out} || \
-  printf "Expected failure 34"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 34 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${input3_pgm} ${input4_pgm} ${input5_pgm}
@@ -335,44 +335,44 @@ rm ${input3_pgm} ${input4_pgm} ${input5_pgm}
 # three or more inputs.
 
 pamarith -subtract testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 35"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 35 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -divide testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 36"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 36 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -compare testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 37"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 37 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -difference testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 38"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 38 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -shiftleft testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 39"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 39 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -shiftright testimg.ppm testimg.ppm testimg.ppm > ${test_out} || \
-  printf "Expected failure 40"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 40 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Currently -equal and -mean do not allow more than two input images.
 # These two cases should be removed once improvements are made.
 
 pamarith -equal testgrid.pbm testgrid.pbm testgrid.pbm > ${test_out} || \
-  printf "Expected failure 41"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 41 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamarith -mean testgrid.pbm  testgrid.pbm testgrid.pbm > ${test_out} || \
-  printf "Expected failure 42"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 42 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamcat1.ok b/test/pamcat1.ok
index 4e23666f..630b635f 100644
--- a/test/pamcat1.ok
+++ b/test/pamcat1.ok
@@ -134,17 +134,17 @@ Test 12.  Should print 2773166369 245, 0 nine times, 1 once
 0
 1
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
diff --git a/test/pamcat1.test b/test/pamcat1.test
index 67d941cc..902ef6d7 100755
--- a/test/pamcat1.test
+++ b/test/pamcat1.test
@@ -196,76 +196,76 @@ echo "-----------------------------------------------------------" 1>&2
 
 # direction not specified
 pamcat testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # both directions specified
 pamcat -topbottom -leftright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # both pad colors specified
 pamcat -topbottom -white -black testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # justification parameters overspecified
 pamcat -lr -jtop -jbottom testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -lr -jtop -jcenter testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -lr -jcenter -jbottom testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -tb -jleft -jright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -tb -jleft -jcenter testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -tb -jcenter -jright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # justification parameter in the wrong direction
 pamcat -lr -jleft    testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -lr -jright   testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -tb -jtop     testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcat -tb -jbottom  testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # more than one input image from standard input
 cat testgrid.pbm | pamcat -lr - - testimg.ppm > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamcat3.ok b/test/pamcat3.ok
index 5dbb2cbc..768f6f1e 100644
--- a/test/pamcat3.ok
+++ b/test/pamcat3.ok
@@ -8,12 +8,12 @@ Test 2.   Should print 1331083756 152559 three times
 1331083756 152559
 1331083756 152559
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
diff --git a/test/pamcat3.test b/test/pamcat3.test
index 3aed0131..fb89c3f6 100755
--- a/test/pamcat3.test
+++ b/test/pamcat3.test
@@ -36,59 +36,59 @@ echo "-----------------------------------------------------------" 1>&2
 
 # listfile not specified
 pamcat -lr -listfile > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # listfile does not exist
 pamcat -lr -listfile=`mktemp -u` > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # listfile empty
 pamcat -lr -listfile=/dev/null > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # listfile from stdin, empty
 cat /dev/null | pamcat -lr -listfile=- > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Files provided from command line in addition to listfile
 pamcat -lr -listfile=${list} testgrid.pbm testgrid.pbm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # "-" (stdin) provided from command line in addition to listfile
 pamcat -lr -listfile=${list} - > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # listfile has nothing but blank lines
 sed 's/^.*$//' ${list3} > ${liste1}  
 pamcat -lr -listfile=${liste1} > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out} ${liste1}
 
 # Non-existing file in listfile
 ( cat ${list} ; mktemp -u ) > ${liste2}
 pamcat -lr -listfile=${liste2} > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out} ${liste2}
 
 # Multiple instances of "-" in listfile
 ( echo "-"; cat ${list}; echo "-"; echo "-" ) > ${liste3}
 pamcat -lr -listfile=${liste3} > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out} ${liste3}
 
 
diff --git a/test/pamchannel.ok b/test/pamchannel.ok
index 91629202..72b84354 100644
--- a/test/pamchannel.ok
+++ b/test/pamchannel.ok
@@ -7,6 +7,6 @@ Test 3:blue-channel  Should produce 3164158573 33838
 Test 4:single-channel  Should produce 281226646 481
 281226646 481
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pamchannel.test b/test/pamchannel.test
index f2662706..2f772bf9 100755
--- a/test/pamchannel.test
+++ b/test/pamchannel.test
@@ -42,17 +42,16 @@ test_out=${tmpdir}/test_out
 echo "Test Invalid"
 
 pamchannel  -infile testgrid.pbm 1 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamchannel  -infile testimg.ppm 3 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamtopam testimg.ppm | pamchannel -infile=- 4 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
-
diff --git a/test/pamcrater.ok b/test/pamcrater.ok
index a5571f35..53faebf2 100644
--- a/test/pamcrater.ok
+++ b/test/pamcrater.ok
@@ -7,7 +7,7 @@ Test 2.
 2
 2
 Test Invalid.
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pamcrater.test b/test/pamcrater.test
index e0c98afb..1b4ffd54 100755
--- a/test/pamcrater.test
+++ b/test/pamcrater.test
@@ -64,21 +64,21 @@ echo "Error messages should appear below the line." 1>&2
 echo "------------------------------" 1>&2
 
 pamcrater -width 0 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcrater -height 0 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcrater -number 0 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcrater -test -radius=10 | pamshadedrelief -gamma 0 > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamcut.ok b/test/pamcut.ok
index fc4dc3de..60919865 100644
--- a/test/pamcut.ok
+++ b/test/pamcut.ok
@@ -19,18 +19,18 @@ Test 5. Should print 281226646 481 five times
 Test 6.  Should print 3412257956 129
 3412257956 129
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 6 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 6 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
diff --git a/test/pamcut.test b/test/pamcut.test
index a489635a..7cda5bce 100755
--- a/test/pamcut.test
+++ b/test/pamcut.test
@@ -56,79 +56,79 @@ echo "-----------------------------------------------------------" 1>&2
 
 # overspecification
 pamcut -left=1 -right=1 -width=14 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -top=1 -bottom=1 -height=16 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -right=1 -cropright=1 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -top=1 -croptop=1 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -bottom=1 -cropbottom=1 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -left=1 -cropleft=1 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # excessive cropping
 pamcut -cropleft=7 -cropright=8 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -left=7 -right=6 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -croptop=8 -cropbottom=8 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -top=10 -bottom=9 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # pad absent
 pamcut -cropleft=1 -width=14 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut -croptop=1  -height=16 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # legacy style: insufficient number of positional parameters
 pamcut 5 testimg.ppm > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut 5 4 testimg.ppm > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamcut 5 5 30 testimg.ppm > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamdepth.ok b/test/pamdepth.ok
index 1bd897ac..fefcc14f 100644
--- a/test/pamdepth.ok
+++ b/test/pamdepth.ok
@@ -10,5 +10,5 @@ stdin: PAM RAW 14 16 1 1 GRAYSCALE
 Test 2
 0 0 : 0
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
diff --git a/test/pamdepth.test b/test/pamdepth.test
index 7ff73f41..d97992a1 100755
--- a/test/pamdepth.test
+++ b/test/pamdepth.test
@@ -30,11 +30,11 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamdepth 0 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamdepth 65536 testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamditherbw.ok b/test/pamditherbw.ok
index 02200d0f..da3f6e8b 100644
--- a/test/pamditherbw.ok
+++ b/test/pamditherbw.ok
@@ -14,15 +14,15 @@ Test: Cluster-4
 Test: Cluster-8
 3493215477 33894
 Test: Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
diff --git a/test/pamditherbw.test b/test/pamditherbw.test
index be560089..ea3e803f 100755
--- a/test/pamditherbw.test
+++ b/test/pamditherbw.test
@@ -47,63 +47,63 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamditherbw -fs -atkinson       ${test_red} > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -floyd -atkinson    ${test_red} > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -dither8  -cluster3 ${test_red} > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -cluster3 -cluster4 ${test_red} > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -cluster3 -cluster8 ${test_red} > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -cluster4 -cluster8 ${test_red} > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -hilbert -threshold ${test_red} > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -clump=8            ${test_red} > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -fs -clump=8        ${test_red} > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -hilbert -clump=1   ${test_red} > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -th -value=-1       ${test_red} > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamditherbw -th -value=1.1      ${test_red} > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${test_red}
diff --git a/test/pamfile.ok b/test/pamfile.ok
index e222592c..91beec60 100644
--- a/test/pamfile.ok
+++ b/test/pamfile.ok
@@ -14,6 +14,6 @@ Test 3
 testimg.ppm: PPM RAW 227 149 3 255 RGB
 stdin: PBM RAW 14 16 1 1 BLACKANDWHITE
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pamfile.test b/test/pamfile.test
index 260d0b27..7be061ef 100755
--- a/test/pamfile.test
+++ b/test/pamfile.test
@@ -31,16 +31,16 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamfile -size -machine  testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfile -count -machine testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 head -n1 testimg.ppm | pamfile > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamfind.ok b/test/pamfind.ok
index de53166e..7776ba37 100644
--- a/test/pamfind.ok
+++ b/test/pamfind.ok
@@ -258,7 +258,7 @@ Test 3
 okay
 okay
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pamfind.test b/test/pamfind.test
index 9165fbdf..e7c9707f 100755
--- a/test/pamfind.test
+++ b/test/pamfind.test
@@ -44,21 +44,21 @@ echo "-----------------------------------------------------------" 1>&2
 echo "Test Invalid"
 
 pamfind -color=black -target=1,1,1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfind -target=0,0 testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfind -target=0,0,0,0 testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfind testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamfix.ok b/test/pamfix.ok
index 7302f91e..ba1c678a 100644
--- a/test/pamfix.ok
+++ b/test/pamfix.ok
@@ -62,7 +62,7 @@ P2
 0 1 2 
 3 4 7 
 0 0 0 
-Test invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Test Invalid
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pamfix.test b/test/pamfix.test
index a18cae10..c274de86 100755
--- a/test/pamfix.test
+++ b/test/pamfix.test
@@ -44,7 +44,7 @@ printf "P2\n3 3\n7\n0 1 2\n3 4 8\n0 0 0\n" |\
 
 # Test Invalid
 
-echo "Test invalid"
+echo "Test Invalid"
 
 test_out=${tmpdir}/test_out
 
@@ -54,16 +54,16 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 printf "P2\n3 2\n7\n0 1 2\n6 7 8\n" | pamfix -change -clip > ${test_out} || \
-  printf "Expected failure 1";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 printf "P1\n5 5\n" | pamfix -truncate -plain > ${test_out} || \
-  printf "Expected failure 2";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 printf "P2\n3 3\255\n" | pamfix -truncate -plain > ${test_out} || \
-  printf "Expected failure 3";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamfunc.ok b/test/pamfunc.ok
index d358355b..0010476e 100644
--- a/test/pamfunc.ok
+++ b/test/pamfunc.ok
@@ -44,27 +44,27 @@ Test 5: Should print 281226646 481 six times
 281226646 481
 281226646 481
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
-Expected failure 15 1
-Expected failure 16 1
-Expected failure 17 1
-Expected failure 18 1
-Expected failure 19 1
-Expected failure 20 1
-Expected failure 21 1
-Expected failure 22 1
-Expected failure 23 1
-Expected failure 24 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
+Expected failure 15 (no output)
+Expected failure 16 (no output)
+Expected failure 17 (no output)
+Expected failure 18 (no output)
+Expected failure 19 (no output)
+Expected failure 20 (no output)
+Expected failure 21 (no output)
+Expected failure 22 (no output)
+Expected failure 23 (no output)
+Expected failure 24 (no output)
diff --git a/test/pamfunc.test b/test/pamfunc.test
index fe142be7..21f69247 100755
--- a/test/pamfunc.test
+++ b/test/pamfunc.test
@@ -93,121 +93,121 @@ echo "Test Invalid"
 test_out=${tmpdir}/test_out
 
 pamfunc -multiplier testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -multiplier=-1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -divisor testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -divisor=-20 testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -adder testimg.ppm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -adder 0.5 testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -subtractor testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -subtractor 0.1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -multiplier=1 -divisor=2 testimg.ppm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -adder=2 -subtractor=3 testimg.ppm > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -min testimg.ppm > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -max testimg.ppm > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -andmask testimg.ppm > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -ormask testimg.ppm > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -xormask testimg.ppm > ${test_out} || \
-  printf "Expected failure 15"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 15 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -not 1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 16"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 16 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -min=1 -max=2 testimg.ppm > ${test_out} || \
-  printf "Expected failure 17"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 17 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -andmask=1 -ormask=0 testimg.ppm > ${test_out} || \
-  printf "Expected failure 18"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 18 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -andmask=0xffff testimg.ppm > ${test_out} || \
-  printf "Expected failure 19"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 19 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -shiftleft testimg.ppm > ${test_out} || \
-  printf "Expected failure 20"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 20 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -shiftright testimg.ppm > ${test_out} || \
-  printf "Expected failure 21"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 21 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -changemaxval testimg.ppm > ${test_out} || \
-  printf "Expected failure 22"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 22 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -shiftleft=1 -shiftright=1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 23"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 23 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamfunc -multiplier=0.5 -changemaxval=65535 testimg.ppm > ${test_out} || \
-  printf "Expected failure 24"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 24 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamgauss.ok b/test/pamgauss.ok
index e31a2ee8..cc4d1465 100644
--- a/test/pamgauss.ok
+++ b/test/pamgauss.ok
@@ -84,8 +84,8 @@ Test 2
 stdin:	PAM, 3 by 3 by 1 maxval 255
     Tuple type: GRAYSCALE
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
diff --git a/test/pamgauss.test b/test/pamgauss.test
index 9400e928..b15ccbf0 100755
--- a/test/pamgauss.test
+++ b/test/pamgauss.test
@@ -28,26 +28,26 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pamgauss 3 3               > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamgauss 3 3   -sigma=0    > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamgauss 3 3   -sigma=-1.5 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamgauss 3     -sigma=0.5  > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamgauss 3 3 3 -sigma=0.5  > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamhue.ok b/test/pamhue.ok
index 5935cc5e..4bc4c385 100644
--- a/test/pamhue.ok
+++ b/test/pamhue.ok
@@ -33,4 +33,4 @@ Test 4
 0 0 : 0
 0 0 : 0
 Test Invalid
-Expected failure 1 1
+Expected failure 1 (no output)
diff --git a/test/pamhue.test b/test/pamhue.test
index 5979e414..ca7a7d82 100755
--- a/test/pamhue.test
+++ b/test/pamhue.test
@@ -43,6 +43,6 @@ echo "An error message should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamhue testimg.ppm  > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamrecolor.ok b/test/pamrecolor.ok
index 0a6b5413..f1bd74fb 100755
--- a/test/pamrecolor.ok
+++ b/test/pamrecolor.ok
@@ -3,9 +3,9 @@ Test 1. Should produce 3500040755 101532
 Test 2. Should produce 3500040755 101532 twice
 3500040755 101532
 3500040755 101532
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
diff --git a/test/pamrecolor.test b/test/pamrecolor.test
index a5fecc1f..4d75f2cc 100755
--- a/test/pamrecolor.test
+++ b/test/pamrecolor.test
@@ -28,35 +28,35 @@ echo "-----------------------------------------------------------" 1>&2
 
 pamrecolor --targetcolor=rgb:00/11/22 \
            --colorfile=${base1_pgm} testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrecolor --rmult=0.3  --gmult=0.3  --bmult=0.3 \
            --colorfile=${base1_pgm} testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrecolor --colorspace=void \
            --targetcolor=rgb:80/80/80 testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrecolor --targetcolor=vague testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrecolor --colorfile=${truncated_file} testimg.ppm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrecolor --rmult=0.2989 --gmult=0.5866 testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${base_pgm} ${truncated_file}
diff --git a/test/pamrestack.ok b/test/pamrestack.ok
index 07552913..63f809e8 100644
--- a/test/pamrestack.ok
+++ b/test/pamrestack.ok
@@ -61,8 +61,8 @@ Test 4. Should produce 1768948962 101484 twice
 1768948962 101484
 1768948962 101484
 Test Invalid.
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
diff --git a/test/pamrestack.test b/test/pamrestack.test
index 2ebee49f..776fe91b 100755
--- a/test/pamrestack.test
+++ b/test/pamrestack.test
@@ -64,28 +64,28 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamrestack testgrid.pbm maze.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrestack -abort \
   -width=$((pixels * 2 + 1 )) maze.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrestack -crop \
   -width=$((pixels * 2 + 1)) maze.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrestack -width=0 maze.pbm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamrestack -width maze.pbm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamscale-reportonly.ok b/test/pamscale-reportonly.ok
index bf5cde99..a3ece300 100644
--- a/test/pamscale-reportonly.ok
+++ b/test/pamscale-reportonly.ok
@@ -12,9 +12,9 @@ Test 1
 227 149 1.400881 2.684564 318 400
 227 149 1.000000 1.000000 227 149
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
diff --git a/test/pamscale-reportonly.test b/test/pamscale-reportonly.test
index 924fb7c2..2bf1030a 100755
--- a/test/pamscale-reportonly.test
+++ b/test/pamscale-reportonly.test
@@ -31,36 +31,36 @@ echo "-----------------------------------------------------------" 1>&2
 
 pamscale -reportonly -xsize=640 -ysize=400 -xscale=2 testimg.ppm > \
   ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamscale -reportonly -xsize=640 -xscale=2 -yscale=3 testimg.ppm > \
   ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamscale -reportonly -xsize=640 -ysize=400 -pixels=200000 testimg.ppm \
   > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamscale -reportonly -xsize=640 -ysize=400 -xysize 640 400 testimg.ppm \
   > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamscale -reportonly -xsize=640 -ysize=400 -xyfit  640 400 testimg.ppm \
   > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamscale -reportonly -xsize=640 -ysize=400 -xyfill 640 400 testimg.ppm \
   > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamseq.ok b/test/pamseq.ok
index 654596fb..a632de66 100644
--- a/test/pamseq.ok
+++ b/test/pamseq.ok
@@ -1,7 +1,7 @@
 Test 1
 3929266994 304
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pamseq.test b/test/pamseq.test
index ce3d4995..61fbfac7 100755
--- a/test/pamseq.test
+++ b/test/pamseq.test
@@ -17,18 +17,18 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pamseq 1 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamseq 0 255 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamseq 3 0   > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 c64="0123456789012345678901234567890123456789012345678901234567890123"
@@ -37,6 +37,6 @@ c256=${c64}${c64}${c64}${c64}
 # Tupletype string length=256
 
 pamseq -tupletype="${c256}" 3 15 > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamshuffle.ok b/test/pamshuffle.ok
index 4f829744..ec8c1a9c 100755
--- a/test/pamshuffle.ok
+++ b/test/pamshuffle.ok
@@ -14,6 +14,6 @@ nomatch
 nomatch
 nomatch
 Test Invalid.
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pamshuffle.test b/test/pamshuffle.test
index 2941a9bc..700631cb 100755
--- a/test/pamshuffle.test
+++ b/test/pamshuffle.test
@@ -52,16 +52,16 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamshuffle testimg.ppm testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamshuffle -randomseed -column testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamshuffle -randomseed=null testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamsumm.ok b/test/pamsumm.ok
index b9ce0269..5524e7b5 100644
--- a/test/pamsumm.ok
+++ b/test/pamsumm.ok
@@ -14,7 +14,7 @@ Test 3.  Should print in order: 10772432, 15, 255, 106.164760
 255
 106.164760
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pamsumm.test b/test/pamsumm.test
index f482911a..6fef5972 100755
--- a/test/pamsumm.test
+++ b/test/pamsumm.test
@@ -35,21 +35,21 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pamsumm -sum -min  testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamsumm -sum -max  testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamsumm -mean -max testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pamsumm            testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamtable.ok b/test/pamtable.ok
index d63c7720..5d69ffb7 100644
--- a/test/pamtable.ok
+++ b/test/pamtable.ok
@@ -122,5 +122,5 @@ Test 8
 65535     0     0|    0     0 65535|    0     0 65535|    0 65535     0
 
 Test Invalid
-Should print: Expected failure 1
-Expected failure 1
+Should print: Expected failure (no output)
+Expected failure (no output)
diff --git a/test/pamtable.test b/test/pamtable.test
index e948ad0c..740b2199 100755
--- a/test/pamtable.test
+++ b/test/pamtable.test
@@ -53,10 +53,10 @@ echo "Invalid command-line argument combinations." 1>&2
 echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
-echo "Should print: Expected failure 1"
+echo "Should print: Expected failure (no output)"
 
 pamseq -tupletype="void" 1 1 | pamtable -tuple -hex > \
   ${test_out} || \
-  printf "Expected failure"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pamundice.ok b/test/pamundice.ok
index 1234431d..9c869609 100644
--- a/test/pamundice.ok
+++ b/test/pamundice.ok
@@ -13,15 +13,15 @@ Test 4.  Should print 2434390296 4436 four times
 2434390296 4436
 2434390296 4436
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
diff --git a/test/pamundice.test b/test/pamundice.test
index ba532c30..1190fbdc 100755
--- a/test/pamundice.test
+++ b/test/pamundice.test
@@ -123,64 +123,64 @@ echo "-----------------------------------------------------------" 1>&2
 
 # No input file pattern specified
 pamundice -down=5 -across=2 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -down=0
 pamundice -down=0 -across=2 ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -across=0
 pamundice -down=5 -across=0 ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -down too large
 pamundice -down=6 -across=2 ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -across too large
 pamundice -down=5 -across=3 ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # precision does not match
 pamundice -down=5 -across=2 ${fname_stem}_"%2d"_"%2a".pbm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # precision set to zero
 pamundice -down=5 -across=2 ${fname_stem}_"%0d"_"%0a".pbm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # no precision
 pamundice -down=5 -across=2 ${fname_stem}_"%d"_"%a".pbm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -hoverlap too large
 pamundice -down=5 -across=2 -hoverlap=$((${mw}+1)) \
   ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # -voverlap too large
 pamundice -down=5 -across=2 -voverlap=$((${mh}+1)) \
   ${fname_stem}_"%1d"_"%1a".pbm > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # corrupt listfile : file names do not exist
@@ -188,15 +188,15 @@ for i in 0 1 2 3 4 5 6 7 8 9
   do
   mktemp -u XXXXXXXXXX.${i} || echo ":::::::::::"${i}":::::::::::"
   done | pamundice -down=5 -across=2 -listfile=- > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # listfile with insufficient lines (insufficient file entries)
 ls ${fname_stem}_*_*.pbm | head -n 9 | \
   pamundice -down=5 -across=2 -listfile=- > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${fname_stem}*.pbm
diff --git a/test/pbmclean.ok b/test/pbmclean.ok
index 17ee0338..5fc9a2d5 100644
--- a/test/pbmclean.ok
+++ b/test/pbmclean.ok
@@ -85,4 +85,4 @@ Test 3
 436062787 5051
 4188415575 5051
 Test Invalid
-Expected failure 1 1
+Expected failure 1 (no output)
diff --git a/test/pbmclean.test b/test/pbmclean.test
index 5eba68e0..9d59a5a6 100755
--- a/test/pbmclean.test
+++ b/test/pbmclean.test
@@ -46,8 +46,8 @@ echo "-----------------------------------------------------------" 1>&2
 
 # overspecification
 pbmclean -black -white -min=1 -extended testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # note that without -extended the above is valid.
diff --git a/test/pbmmake.ok b/test/pbmmake.ok
index e39f4cf8..4b13cf54 100644
--- a/test/pbmmake.ok
+++ b/test/pbmmake.ok
@@ -44,11 +44,11 @@ Test 2
 3651864954 3375
 3302595397 3849
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
diff --git a/test/pbmmake.test b/test/pbmmake.test
index 1d1c682b..52765747 100755
--- a/test/pbmmake.test
+++ b/test/pbmmake.test
@@ -33,41 +33,41 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pbmmake -b -w -plain 1 1 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -b -g -plain 1 1 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -gray -plain 1 1 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -plain   > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -plain 1 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -plain 1 0 > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -plain 0 1 > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmmake -white -plain 1 1 1 > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmnoise-parameters.ok b/test/pbmnoise-parameters.ok
index c2a61c37..d430f0f1 100644
--- a/test/pbmnoise-parameters.ok
+++ b/test/pbmnoise-parameters.ok
@@ -1,26 +1,26 @@
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
-Expected failure 15 1
-Expected failure 16 1
-Expected failure 17 1
-Expected failure 17 1
-Expected failure 18 1
-Expected failure 19 1
-Expected failure 20 1
-Expected failure 21 1
-Expected failure 22 1
-Expected failure 23 1
-Expected failure 24 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
+Expected failure 15 (no output)
+Expected failure 16 (no output)
+Expected failure 17 (no output)
+Expected failure 17 (no output)
+Expected failure 18 (no output)
+Expected failure 19 (no output)
+Expected failure 20 (no output)
+Expected failure 21 (no output)
+Expected failure 22 (no output)
+Expected failure 23 (no output)
+Expected failure 24 (no output)
diff --git a/test/pbmnoise-parameters.test b/test/pbmnoise-parameters.test
index 17d2c76b..0d9319cc 100755
--- a/test/pbmnoise-parameters.test
+++ b/test/pbmnoise-parameters.test
@@ -13,131 +13,131 @@ test_out=${tmpdir}/test_out
 # Invalid -ratio arguments
 
 pbmnoise -ratio       100 100 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio 0     1  100 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=1.1   100 100 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
   
 pbmnoise -ratio=-1    100 100 > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=half  100 100 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=0/1/1 100 100 > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=-1/2  100 100 > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=1/0   100 100 > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=/2    100 100 > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=4/2   100 100 > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=6/    100 100 > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=1.0/2.0 100 100 > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # denominator must be power of 2  
 pbmnoise -ratio=3/9   100 100 > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=a/2   100 100 > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 
 pbmnoise -ratio=2/a  100 100 > ${test_out} || \
-        printf "Expected failure 15"
-  test -s ${test_out}; echo " "$?
+        printf "Expected failure 15 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=1/-2  100 100 > ${test_out} || \
-        printf "Expected failure 16"
-  test -s ${test_out}; echo " "$?
+        printf "Expected failure 16 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Denominator must be 65536 or less
 pbmnoise -ratio=1/65537 100 100 > ${test_out} || \
-  printf "Expected failure 17"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 17 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -ratio=1/131072 100 100 > ${test_out} || \
-  printf "Expected failure 17"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 17 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -endian=large 100 100 > ${test_out} || \
-  printf "Expected failure 18"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 18 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -randomseed 100 100 > ${test_out} || \
-  printf "Expected failure 19"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 19 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -randomseed=-1 100 100 > ${test_out} || \
-  printf "Expected failure 20"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 20 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise -randomseed=0.1 100 100 > ${test_out} || \
-  printf "Expected failure 21"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 21 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise > ${test_out} || \
-  printf "Expected failure 22"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 22 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise 100 > ${test_out} || \
-  printf "Expected failure 23"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 23 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmnoise 100 200 300 > ${test_out} || \
-  printf "Expected failure 24"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 24 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
   
diff --git a/test/pbmpage.ok b/test/pbmpage.ok
index 8013f2f2..21731b08 100644
--- a/test/pbmpage.ok
+++ b/test/pbmpage.ok
@@ -4,6 +4,6 @@ Test 1
 2347597649 4210813
 3453559794 4349933
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pbmpage.test b/test/pbmpage.test
index 4f15452d..ee3dc25c 100755
--- a/test/pbmpage.test
+++ b/test/pbmpage.test
@@ -20,16 +20,16 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pbmpage -a3 1 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmpage 0 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmpage 4 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmpscale.ok b/test/pbmpscale.ok
index 9ea594d8..25552343 100644
--- a/test/pbmpscale.ok
+++ b/test/pbmpscale.ok
@@ -173,6 +173,6 @@ Test 9.  Should print 146160766 820
 Test 10. Should print 3327221668 2111
 3327221668 2111
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pbmpscale.test b/test/pbmpscale.test
index efa5bfb5..65ab6467 100755
--- a/test/pbmpscale.test
+++ b/test/pbmpscale.test
@@ -36,16 +36,16 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pbmpscale testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmpscale 0 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmpscale 2 3 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmtext-iso88591.test b/test/pbmtext-iso88591.test
index 6df296dd..69e6ec90 100755
--- a/test/pbmtext-iso88591.test
+++ b/test/pbmtext-iso88591.test
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # This script tests: pbmtext
 # Also requires:
 
diff --git a/test/pbmtext-utf8.ok b/test/pbmtext-utf8.ok
index 84743a09..0d40adde 100644
--- a/test/pbmtext-utf8.ok
+++ b/test/pbmtext-utf8.ok
@@ -13,12 +13,12 @@ Test 5 Invalid
 9998
 989454365 52512
 9999
-Expected failure 1 1
-Expected failure 2 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
 Test 6 Invalid
-6-1: 0 1 : 1 1
-6-2: 0 1 : 1 1
-6-3: 0 1 : 1 1
-6-4: 0 1 : 1 1
-6-5: 0 1 : 1 1
-6-6: 0 1 : 1 1
+6-1: 0 1 : 1 (no output)
+6-2: 0 1 : 1 (no output)
+6-3: 0 1 : 1 (no output)
+6-4: 0 1 : 1 (no output)
+6-5: 0 1 : 1 (no output)
+6-6: 0 1 : 1 (no output)
diff --git a/test/pbmtext-utf8.test b/test/pbmtext-utf8.test
index 9203607f..78dfaf9e 100755
--- a/test/pbmtext-utf8.test
+++ b/test/pbmtext-utf8.test
@@ -141,15 +141,15 @@ cat ${long_txt} | wc -c | tr -d ' '
 cat ${long_txt} | \
   LC_ALL=${locale_for_test} \
   pbmtext -nomargins -builtin fixed -wchar > ${test_out} || \
-  printf "Expected failure 1";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 cat ${long_txt} | \
   LC_ALL=${locale_for_test} \
   pbmtext -nomargins -builtin fixed -wchar > ${test_out} || \
-  printf "Expected failure 2";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${long_txt}
@@ -169,41 +169,41 @@ echo "Test 6 Invalid"
 awk 'BEGIN { printf("%c%c",128,129);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-1: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-1: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 awk 'BEGIN { printf("ABC%c%c",192, 193);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-2: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-2: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 awk 'BEGIN { printf("abcde%c%c", 254, 253);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-3: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-3: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 awk 'BEGIN { printf("abcdefg%c%c", 195, 15);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-4: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-4: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 awk 'BEGIN { printf("123456789%c%c%c", 224, 143 ,0);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-5: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-5: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 awk 'BEGIN { printf("abcdefg123ABCDEFG%c%c%c%c",247, 135, 135, 7);  print ""}' | \
         LC_ALL=${locale_for_test} \
         pbmtext -builtin bdf -wchar -text-dump > ${test_out}
-  printf "6-6: ${PIPESTATUS[*]} : $?"
-  test -s ${test_out}; echo " "$?
+  printf "6-6: ${PIPESTATUS[*]} : $? "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmtext.ok b/test/pbmtext.ok
index 68ed40d8..975911f2 100644
--- a/test/pbmtext.ok
+++ b/test/pbmtext.ok
@@ -20,20 +20,20 @@ Test 5
 2547645687 4564
 1174281741 5741
 Test 6 Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
 Test 7
 text length: 4999
 1854691667 52512
 1854691667 52512
 Test 8 Invalid
 text length: 5000
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/pbmtext.test b/test/pbmtext.test
index 247f76c5..d4ab027e 100755
--- a/test/pbmtext.test
+++ b/test/pbmtext.test
@@ -112,43 +112,43 @@ echo "Test 6 Invalid"
 test_out=${tmpdir}/test_out
 
 pbmtext -font=testgrid.pbm foo > ${test_out} || \
-  printf "Expected failure 1";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -font=testimg.ppm  foo > ${test_out} || \
-  printf "Expected failure 2";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -builtin=void      foo > ${test_out} || \
-  printf "Expected failure 3";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -font=${font_pbm} -builtin=fixed foo > ${test_out}  || \
-  printf "Expected failure 4";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -dry-run    -text-dump  foo > ${test_out} || \
-  printf "Expected failure 5";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -dump-sheet -text-dump  foo > ${test_out} || \
-  printf "Expected failure 6";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -dry-run    -dump-sheet foo > ${test_out} || \
-  printf "Expected failure 7";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtext -wchar foo > ${test_out} || \
-  printf "Expected failure 8";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${font_pbm}
@@ -177,19 +177,19 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pbmtext -nomargins -builtin fixed `cat ${long_txt}` > ${test_out}  || \
-  printf "Expected failure 1";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 cat ${long_txt} | pbmtext -nomargins -builtin fixed > ${test_out}  || \
-  printf "Expected failure 2";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 cat ${long_txt} | \
   LC_ALL=C pbmtext -nomargins -builtin fixed -wchar > ${test_out}  || \
-  printf "Expected failure 3";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${long_txt}
diff --git a/test/pbmtextps-dump.ok b/test/pbmtextps-dump.ok
index 11a4c5fd..71b2d2a2 100644
--- a/test/pbmtextps-dump.ok
+++ b/test/pbmtextps-dump.ok
@@ -51,38 +51,38 @@ Test 2
 <303132 20 414243 2d 78797a 2e>
 1
 Test Invalid
-Expected failure 1 (-fontsize) 1
-Expected failure 2 (-fontsize 0) 1
-Expected failure 3 (-resolution) 1
-Expected failure 4 (-resolution=0) 1
-Expected failure 5 (-leftmargin) 1
-Expected failure 6 (-leftmargin -1) 1
-Expected failure 7 (-rightmargin) 1
-Expected failure 8 (-rightmargin -1) 1
-Expected failure 9 (-topmargin) 1
-Expected failure 10 (-topmargin -1) 1
-Expected failure 11 (-bottommargin) 1
-Expected failure 12 (-bottommargin -1) 1
-Expected failure 13 (-ascent) 1
-Expected failure 14 (-ascent -1) 1
-Expected failure 15 (-descent) 1
-Expected failure 16 (-descent -1) 1
-Expected failure 17 (-stroke=A) 1
-Expected failure 18 (-pad -crop) 1
-Expected failure 19 (-asciihex <a>) 1
-Expected failure 20 (-asciihex ) 1
-Expected failure 21 (-asciihex <53756c667572) 1
-Expected failure 22 (-asciihex 53756c667572>) 1
-Expected failure 23 (-asciihex <5375<6c667572>) 1
-Expected failure 24 (-asciihex <53756c>667572>) 1
-Expected failure 25 (-ascii85 <~@<6O!FD5W(~) 1
-Expected failure 26 (-ascii85 ~@<6O!FD5W(~>) 1
-Expected failure 27 (-ascii85 <~@<6O<~!FD5W(~>) 1
-Expected failure 28 (-ascii85 <~@<6O~>!FD5W(~>) 1
-Expected failure 29 (-ascii85 <~@<6O!FD5W(~~>) 1
-Expected failure 30 (-ascii85 v) 1
-Expected failure 31 (-ascii85 y) 1
-Expected failure 32 (-ascii85 1z) 1
-Expected failure 33 (-ascii85 z1z) 1
-Expected failure 34 (-ascii85 <~0123z~>) 1
-Expected failure 35 (-font="") 1
+Expected failure 1 (-fontsize) (no output)
+Expected failure 2 (-fontsize 0) (no output)
+Expected failure 3 (-resolution) (no output)
+Expected failure 4 (-resolution=0) (no output)
+Expected failure 5 (-leftmargin) (no output)
+Expected failure 6 (-leftmargin -1) (no output)
+Expected failure 7 (-rightmargin) (no output)
+Expected failure 8 (-rightmargin -1) (no output)
+Expected failure 9 (-topmargin) (no output)
+Expected failure 10 (-topmargin -1) (no output)
+Expected failure 11 (-bottommargin) (no output)
+Expected failure 12 (-bottommargin -1) (no output)
+Expected failure 13 (-ascent) (no output)
+Expected failure 14 (-ascent -1) (no output)
+Expected failure 15 (-descent) (no output)
+Expected failure 16 (-descent -1) (no output)
+Expected failure 17 (-stroke=A) (no output)
+Expected failure 18 (-pad -crop) (no output)
+Expected failure 19 (-asciihex <a>) (no output)
+Expected failure 20 (-asciihex ) (no output)
+Expected failure 21 (-asciihex <53756c667572) (no output)
+Expected failure 22 (-asciihex 53756c667572>) (no output)
+Expected failure 23 (-asciihex <5375<6c667572>) (no output)
+Expected failure 24 (-asciihex <53756c>667572>) (no output)
+Expected failure 25 (-ascii85 <~@<6O!FD5W(~) (no output)
+Expected failure 26 (-ascii85 ~@<6O!FD5W(~>) (no output)
+Expected failure 27 (-ascii85 <~@<6O<~!FD5W(~>) (no output)
+Expected failure 28 (-ascii85 <~@<6O~>!FD5W(~>) (no output)
+Expected failure 29 (-ascii85 <~@<6O!FD5W(~~>) (no output)
+Expected failure 30 (-ascii85 v) (no output)
+Expected failure 31 (-ascii85 y) (no output)
+Expected failure 32 (-ascii85 1z) (no output)
+Expected failure 33 (-ascii85 z1z) (no output)
+Expected failure 34 (-ascii85 <~0123z~>) (no output)
+Expected failure 35 (-font="") (no output)
diff --git a/test/pbmtextps-dump.test b/test/pbmtextps-dump.test
index 82856f7e..fd68667d 100755
--- a/test/pbmtextps-dump.test
+++ b/test/pbmtextps-dump.test
@@ -90,8 +90,8 @@ for error_flag in \
   "-pad -crop"
   do
     pbmtextps ${error_flag} -dump-ps ${text} >${test_out} || \
-    printf "Expected failure $n (${error_flag})";
-    test -s ${test_out}; echo " "$?
+    printf "Expected failure $n (${error_flag}) "
+    test -s ${test_out} && echo "unexpected output" || echo "(no output)"
     rm -f ${test_out}
     n=$((n + 1))
   done
@@ -105,8 +105,8 @@ for asciihex_string in \
   "<53756c>667572>"
   do
     pbmtextps -dump-ps -asciihex ${asciihex_string} >${test_out} || \
-    printf "Expected failure $n (-asciihex ${asciihex_string})";
-    test -s ${test_out}; echo " "$?
+    printf "Expected failure $n (-asciihex ${asciihex_string}) "
+    test -s ${test_out} && echo "unexpected output" || echo "(no output)"
     rm -f ${test_out}
     n=$((n + 1))
   done
@@ -124,13 +124,13 @@ for ascii85_string in \
   "<~0123z~>"
   do
     pbmtextps -dump-ps -ascii85 ${ascii85_string} >${test_out} || \
-    printf "Expected failure $n (-ascii85 ${ascii85_string})";
-    test -s ${test_out}; echo " "$?
+	printf "Expected failure $n (-ascii85 ${ascii85_string}) "
+    test -s ${test_out} && echo "unexpected output" || echo "(no output)"
     rm -f ${test_out}
     n=$((n + 1))
   done
 
   pbmtextps -font="" -dump-ps ${text} >${test_out} || \
-  printf "Expected failure $n (-font=\"\")";
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure $n (-font=\"\") "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmtopgm.ok b/test/pbmtopgm.ok
index 6ccf9c64..11242259 100644
--- a/test/pbmtopgm.ok
+++ b/test/pbmtopgm.ok
@@ -19,7 +19,7 @@ P2
 0 1 0 1 0 1 0 1 0 1 0 1 0 1
 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pbmtopgm.test b/test/pbmtopgm.test
index 02f2bb21..f2c5cf1f 100755
--- a/test/pbmtopgm.test
+++ b/test/pbmtopgm.test
@@ -18,21 +18,21 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pbmtopgm 5 0 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtopgm 0 9 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtopgm 15 5 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmtopgm 5 17 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pbmupc.ok b/test/pbmupc.ok
index f1b91e99..4f2fd0ae 100644
--- a/test/pbmupc.ok
+++ b/test/pbmupc.ok
@@ -1,12 +1,12 @@
 Test 1
 2619309127 10172
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
diff --git a/test/pbmupc.test b/test/pbmupc.test
index f8343dd7..74bd54d9 100755
--- a/test/pbmupc.test
+++ b/test/pbmupc.test
@@ -20,46 +20,46 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pbmupc -s3 0 72890 00011     > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1   72890 00011     > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0 72890           > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 10 72890 00011    > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0 172890 00011    > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0   2890 00011    > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0 72890 100011    > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0 72890   0011    > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pbmupc -s1 0 72890 100011 1  > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmhist.ok b/test/pgmhist.ok
index 3be73ff9..f9184828 100644
--- a/test/pgmhist.ok
+++ b/test/pgmhist.ok
@@ -30,7 +30,7 @@ Test 2
 230
 255
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pgmhist.test b/test/pgmhist.test
index c141627d..a47ab71e 100755
--- a/test/pgmhist.test
+++ b/test/pgmhist.test
@@ -35,21 +35,21 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pgmhist -median   -quartile testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmhist -median   -decile   testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmhist -quartile -decile   testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmhist testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmmake.ok b/test/pgmmake.ok
index 8b242822..ac9b968c 100644
--- a/test/pgmmake.ok
+++ b/test/pgmmake.ok
@@ -2,11 +2,11 @@ Test 1
 3662611538 2513
 3109612402 5012
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
diff --git a/test/pgmmake.test b/test/pgmmake.test
index 3c96d99e..80997d07 100755
--- a/test/pgmmake.test
+++ b/test/pgmmake.test
@@ -19,41 +19,41 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pgmmake 100  5 5 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake 1.01 5 5 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake .5   5   > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake .5       > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake -maxval=5        5 5 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake -maxval=0     .5 5 5 > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake -maxval=-1    .5 5 5 > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmmake -maxval=65536 .5 5 5 > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmnoise-parameters.ok b/test/pgmnoise-parameters.ok
index 1bb1cd59..10a05cfa 100644
--- a/test/pgmnoise-parameters.ok
+++ b/test/pgmnoise-parameters.ok
@@ -1,5 +1,5 @@
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
diff --git a/test/pgmnoise-parameters.test b/test/pgmnoise-parameters.test
index c5e6ada5..79c068d8 100755
--- a/test/pgmnoise-parameters.test
+++ b/test/pgmnoise-parameters.test
@@ -11,26 +11,26 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pgmnoise -maxval=255  -randomseed=1 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 100 -randomseed=1 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 100 0 -randomseed=1 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 0 100 -randomseed=1 > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 100 100 100 -randomseed=1 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmnoise.ok b/test/pgmnoise.ok
index d98ee053..2a2db565 100644
--- a/test/pgmnoise.ok
+++ b/test/pgmnoise.ok
@@ -90,13 +90,13 @@ First column should be 2^n - 1.  Last column should be 'pool'.
 1023 pgmnoise: method: pool
 65535 pgmnoise: method: pool
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
diff --git a/test/pgmnoise.test b/test/pgmnoise.test
index 6141121a..ed41622f 100755
--- a/test/pgmnoise.test
+++ b/test/pgmnoise.test
@@ -78,51 +78,51 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pgmnoise 0 0  > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 0 1  > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 1 0  > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise      > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 1    > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise 100 -1 > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise -randomseed=-1 100 100  > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise -maxval=-1 100 100  > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise -maxval=0 100 100  > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmnoise -maxval=$((256 * 256 * 256 * 256)) 10 10 > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmramp.ok b/test/pgmramp.ok
index de0d9206..69e3a6e5 100644
--- a/test/pgmramp.ok
+++ b/test/pgmramp.ok
@@ -42,8 +42,8 @@ Test 2
 Test 3
 886972785 131087
 Test Invalid
-Expected failure: -lr -tb 1
-Expected failure: -lr -rectangle 1
-Expected failure: -rectangle -ellipse 1
-Expected failure: insufficient parameters 1
-Expected failure: excessive parameters 1
+Expected failure: -lr -tb (no output)
+Expected failure: -lr -rectangle (no output)
+Expected failure: -rectangle -ellipse (no output)
+Expected failure: insufficient parameters (no output)
+Expected failure: excessive parameters (no output)
diff --git a/test/pgmramp.test b/test/pgmramp.test
index b4dbb3cd..d2e34885 100755
--- a/test/pgmramp.test
+++ b/test/pgmramp.test
@@ -31,17 +31,17 @@ test_out=${tmpdir}/test_out
 
 for combination in "-lr -tb" "-lr -rectangle" "-rectangle -ellipse"
 do pgmramp $combination 10 10 > ${test_out} || \
-  printf "Expected failure: $combination"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure: $combination "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 done
 
 pgmramp -lr     1 > ${test_out} || \
-  printf "Expected failure: insufficient parameters"; \
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure: insufficient parameters "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmramp -tb 1 1 1 > ${test_out} || \
-  printf "Expected failure: excessive parameters"; \
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure: excessive parameters "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pgmtoppm.ok b/test/pgmtoppm.ok
index 2484c487..4a2114ab 100644
--- a/test/pgmtoppm.ok
+++ b/test/pgmtoppm.ok
@@ -26,14 +26,14 @@ Test 6. Should print 3083028153 685 three times
 3083028153 685
 3083028153 685
 Test 7 Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
diff --git a/test/pgmtoppm.test b/test/pgmtoppm.test
index 36f63de7..6054fc03 100755
--- a/test/pgmtoppm.test
+++ b/test/pgmtoppm.test
@@ -66,74 +66,74 @@ echo "-----------------------------------------------------------" 1>&2
 
 pgmtoppm white testimg.ppm > \
   ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm -map=/dev/null testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm black white testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm hwite testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm off-color testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm rgb-255:7/7/7 testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm -black=black -white=white white testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm -black=rgb:0/0/0 -map=${palette_ppm} testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm -white=rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pgmtoppm rgb:00/00/00-rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
   ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 #pgmtoppm rgb-255:7/7/7 testgrid.pbm > \
 #  ${test_out} || \
-#  printf "Expected failure 12"
-#  test -s ${test_out}; echo " "$?
+#  printf "Expected failure 12 "
+#  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
 #  rm -f ${test_out}
 
 rm -f ${palette_ppm}
diff --git a/test/pnmcat.ok b/test/pnmcat.ok
index 96e2b884..9958ad62 100644
--- a/test/pnmcat.ok
+++ b/test/pnmcat.ok
@@ -82,17 +82,17 @@ Test 15.  Should print 3948141157 107742
 Test 16.  Should print 3910239002 107742
 3910239002 107742
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
diff --git a/test/pnmcat.test b/test/pnmcat.test
index bf40ada2..02fefd38 100755
--- a/test/pnmcat.test
+++ b/test/pnmcat.test
@@ -109,76 +109,76 @@ echo "-----------------------------------------------------------" 1>&2
 
 # direction not specified
 pnmcat testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # both directions specified
 pnmcat -topbottom -leftright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # both pad colors specified
 pnmcat -topbottom -white -black testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # justification parameters overspecified
 pnmcat -lr -jtop -jbottom testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -lr -jtop -jcenter testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -lr -jcenter -jbottom testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -tb -jleft -jright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -tb -jleft -jcenter testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -tb -jcenter -jright testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # justification parameter in the wrong direction
 pnmcat -lr -jleft    testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -lr -jright   testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -tb -jtop     testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcat -tb -jbottom  testgrid.pbm testimg.ppm > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # more than one input image from standard input
 cat testgrid.pbm | pnmcat -lr - - testimg.ppm > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pnmcolormap.ok b/test/pnmcolormap.ok
index 0c6f0d71..8918cf25 100644
--- a/test/pnmcolormap.ok
+++ b/test/pnmcolormap.ok
@@ -31,10 +31,10 @@ ok
 ok
 
 Test Invalid.
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
diff --git a/test/pnmcolormap.test b/test/pnmcolormap.test
index 11d47385..b34a0360 100755
--- a/test/pnmcolormap.test
+++ b/test/pnmcolormap.test
@@ -44,37 +44,37 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pnmcolormap 0 testimg.ppm   > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap -1 testimg.ppm  > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap 0.1 testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap -center -meancolor 16 testimg.ppm    > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap -center -meanpixel 16 testimg.ppm    > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap -meancolor -meanpixel 16 testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmcolormap -spreadbrightness -spreadluminosity 16 \
   testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pnmcrop1.ok b/test/pnmcrop1.ok
index d979d2db..35852c8c 100644
--- a/test/pnmcrop1.ok
+++ b/test/pnmcrop1.ok
@@ -69,14 +69,14 @@ file: rose.ppm option: -white
 file: rose.ppm option: -top
 0
 Test Invalid
-Expected failure:  -reportfull -reportsize 1
-Expected failure:  -reportfull -borderfile=testgrid.pbm 1
-Expected failure:  -reportsize -borderfile=testgrid.pbm 1
-Expected failure:  -black -white 1
-Expected failure:  -black -sides 1
-Expected failure:  -white -bg-color=red 1
-Expected failure:  -white -bg-corner=topleft 1
-Expected failure:  -white -bg-corner=top 1
-Expected failure:  -blank-image=pasturize 1
-Expected failure:  -bg-color=black -closeness=-1 1
-Expected failure:  -bg-color=black -closeness=101 1
+Expected failure:  -reportfull -reportsize (no output)
+Expected failure:  -reportfull -borderfile=testgrid.pbm (no output)
+Expected failure:  -reportsize -borderfile=testgrid.pbm (no output)
+Expected failure:  -black -white (no output)
+Expected failure:  -black -sides (no output)
+Expected failure:  -white -bg-color=red (no output)
+Expected failure:  -white -bg-corner=topleft (no output)
+Expected failure:  -white -bg-corner=top (no output)
+Expected failure:  -blank-image=pasturize (no output)
+Expected failure:  -bg-color=black -closeness=-1 (no output)
+Expected failure:  -bg-color=black -closeness=101 (no output)
diff --git a/test/pnmcrop1.test b/test/pnmcrop1.test
index 3c86efd7..811b36d8 100755
--- a/test/pnmcrop1.test
+++ b/test/pnmcrop1.test
@@ -1,4 +1,4 @@
- #! /bin/sh
+#! /bin/sh
 # This script tests: pnmcrop
 # Also requires: pnmpad pnmmargin pamcut
 
@@ -78,7 +78,7 @@ for option in "-reportfull -reportsize" \
               "-bg-color=black -closeness=101"
     do
     pnmcrop -reportfull ${option} testgrid.pbm > ${test_out} || \
-        printf "Expected failure:  %s" "${option}"
-        test -s ${test_out}; echo " "$?
+        printf "Expected failure:  %s" "${option} "
+        test -s ${test_out} && echo "unexpected output" || echo "(no output)"	
         rm ${test_out}
     done
diff --git a/test/pnmcrop3.ok b/test/pnmcrop3.ok
index 5a86139c..4b096940 100644
--- a/test/pnmcrop3.ok
+++ b/test/pnmcrop3.ok
@@ -86,5 +86,5 @@ P1
 1111111111111
 -3 -1 -1 -1 9 13
 544280424 101484
-Expected failure 1 1
-Expected failure 2 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
diff --git a/test/pnmcrop3.test b/test/pnmcrop3.test
index 1e8da345..3d32ca21 100755
--- a/test/pnmcrop3.test
+++ b/test/pnmcrop3.test
@@ -68,13 +68,13 @@ echo "Error messages should appear below the line." 1>&2
 echo "--------------------------------------------" 1>&2
 
 pnmcrop -borderfile=${border_ppm} ${test_pbm} > ${test_out} || \
-        printf "Expected failure 1";
-        test -s ${test_out}; echo " "$?
-        rm ${test_out}
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
+  rm ${test_out}
 
 pnmcrop -borderfile=${border_pbm} ${test_ppm} > ${test_out} || \
-        printf "Expected failure 2";
-        test -s ${test_out}; echo " "$?
-        rm ${test_out}
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
+  rm ${test_out}
 
 rm ${test_pbm} ${test_ppm} ${border_pbm} ${border_ppm} ${gray_pgm}
diff --git a/test/pnmpsnr.ok b/test/pnmpsnr.ok
index 7042f86c..38bed0f3 100644
--- a/test/pnmpsnr.ok
+++ b/test/pnmpsnr.ok
@@ -8,7 +8,7 @@ Test 2
 match
 match
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test
index ae6ba3cc..efabe9aa 100755
--- a/test/pnmpsnr.test
+++ b/test/pnmpsnr.test
@@ -36,23 +36,23 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pnmpsnr ${b_pbm} ${w_pbm} ${b_pbm}     > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmpsnr ${b_pbm}                       > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmpsnr ${b_pbm} ${w_pbm} -target1=100 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmpsnr                   -machine     > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 rm ${b_pbm} ${w_pbm}
diff --git a/test/pnmquant.ok b/test/pnmquant.ok
index 407d42a3..f4229601 100644
--- a/test/pnmquant.ok
+++ b/test/pnmquant.ok
@@ -8,11 +8,11 @@ Test 1
 1 1
 1 1
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
diff --git a/test/pnmquant.test b/test/pnmquant.test
index cbe69f5c..4baff9a8 100755
--- a/test/pnmquant.test
+++ b/test/pnmquant.test
@@ -42,41 +42,41 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pnmquant 0 testimg.ppm   > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant testimg.ppm  > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant 10.5 testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant -center -meancolor 16 testimg.ppm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant -center -meanpixel 16 testimg.ppm    > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant -meancolor -meanpixel 16 testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant -spreadbrightness -spreadluminosity 16 testimg.ppm > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmquant -randomseed 1 -norandom 10 testimg.ppm > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pnmremap1.ok b/test/pnmremap1.ok
index 23a9dddd..0f511754 100644
--- a/test/pnmremap1.ok
+++ b/test/pnmremap1.ok
@@ -1,7 +1,7 @@
 3602410851 101482
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
diff --git a/test/pnmremap1.test b/test/pnmremap1.test
index 8626c50f..9c60460b 100755
--- a/test/pnmremap1.test
+++ b/test/pnmremap1.test
@@ -33,32 +33,32 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pnmremap -mapfile=/dev/null testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmremap -mapfile=/dev/zero testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmremap testimg.ppm                    > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmremap -fs -nofs testimg.ppm          > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmremap -mapfile=testgrid.pbm -missingcolor=rgb:00/ff/00 testimg.ppm \
  > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmremap -mapfile=testgrid.pbm -firstisdefault testimg.ppm > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/pnmtile.ok b/test/pnmtile.ok
index d28fafa3..572893df 100644
--- a/test/pnmtile.ok
+++ b/test/pnmtile.ok
@@ -1,6 +1,6 @@
 4228632379 259
 0 0 0 : 0
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
diff --git a/test/pnmtile.test b/test/pnmtile.test
index b72ef946..74bae013 100755
--- a/test/pnmtile.test
+++ b/test/pnmtile.test
@@ -29,21 +29,21 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 pnmtile 100 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmtile 100 0 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmtile 0 100 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 pnmtile 100 100 100 testgrid.pbm > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmforge-parameters.ok b/test/ppmforge-parameters.ok
index c8edc5dd..afb3e855 100644
--- a/test/ppmforge-parameters.ok
+++ b/test/ppmforge-parameters.ok
@@ -5,10 +5,10 @@ Test 2: Should print 40 30
 Test 3: Should print 90 90
 90 90
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
diff --git a/test/ppmforge-parameters.test b/test/ppmforge-parameters.test
index e5822673..ba436bf0 100755
--- a/test/ppmforge-parameters.test
+++ b/test/ppmforge-parameters.test
@@ -30,36 +30,36 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 ppmforge -night  -dimension=0  > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge  -dimension=10  > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge  -dimension=-1  > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge -clouds -mesh=1.99    > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge -clouds -power=0      > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge         -ice=-1       > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmforge         -glaciers=-1  > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmhist.ok b/test/ppmhist.ok
index 468bd317..a78540f1 100644
--- a/test/ppmhist.ok
+++ b/test/ppmhist.ok
@@ -20,6 +20,6 @@ Test 2
  Summary: 6 colors: 1 black, 0 white, 0 gray, 5 color
  Summary: 6 colors: 1 black, 1 white, 1 gray, 3 color
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/ppmhist.test b/test/ppmhist.test
index 8c2eedbc..27ae9cea 100755
--- a/test/ppmhist.test
+++ b/test/ppmhist.test
@@ -36,16 +36,16 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 ppmhist -hexcolor -float testimg.ppm > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmhist -hexcolor -map   testimg.ppm > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmhist -float    -map   testimg.ppm > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmmake.ok b/test/ppmmake.ok
index 6d559c8d..0231874f 100644
--- a/test/ppmmake.ok
+++ b/test/ppmmake.ok
@@ -3,13 +3,13 @@ Test 1
 4294967295 0
 2378991101 7513
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
diff --git a/test/ppmmake.test b/test/ppmmake.test
index 30eb596a..fb7bf74a 100755
--- a/test/ppmmake.test
+++ b/test/ppmmake.test
@@ -19,51 +19,51 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 ppmmake rgb:gg/00/00  2 2  > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake rgb:ff/ff/00  2    > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake rgbi:1.1/0/0  2 2  > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake rgbi:1.0/.5   2 2  > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake rainbow       2 2  > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake               2 2  > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake blue -maxval=0 2 2  > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake blue -maxval=-1 2 2  > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmmake blue -maxval=65536 2 2  > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 RGBDEF=/dev/null ppmmake red 2 2 > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmpat.ok b/test/ppmpat.ok
index f2b355a9..dc7922ed 100644
--- a/test/ppmpat.ok
+++ b/test/ppmpat.ok
@@ -19,29 +19,29 @@ Test 9. Should print: 3057513592 661
 Test 10. Should print: 1861389287 661
 1861389287 661
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
-Expected failure 9 1
-Expected failure 10 1
-Expected failure 11 1
-Expected failure 12 1
-Expected failure 13 1
-Expected failure 14 1
-Expected failure 15 1
-Expected failure 16 1
-Expected failure 17 1
-Expected failure 18 1
-Expected failure 19 1
-Expected failure 20 1
-Expected failure 21 1
-Expected failure 22 1
-Expected failure 23 1
-Expected failure 24 1
-Expected failure 25 1
-Expected failure 26 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
+Expected failure 9 (no output)
+Expected failure 10 (no output)
+Expected failure 11 (no output)
+Expected failure 12 (no output)
+Expected failure 13 (no output)
+Expected failure 14 (no output)
+Expected failure 15 (no output)
+Expected failure 16 (no output)
+Expected failure 17 (no output)
+Expected failure 18 (no output)
+Expected failure 19 (no output)
+Expected failure 20 (no output)
+Expected failure 21 (no output)
+Expected failure 22 (no output)
+Expected failure 23 (no output)
+Expected failure 24 (no output)
+Expected failure 25 (no output)
+Expected failure 26 (no output)
diff --git a/test/ppmpat.test b/test/ppmpat.test
index ced2e64a..48c2460f 100755
--- a/test/ppmpat.test
+++ b/test/ppmpat.test
@@ -50,48 +50,48 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 ppmpat -g2 -g3 10 10 > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -madras -tartan 10 10 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -poles -squig 10 10 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -camo -anticamo 10 10 > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -argyle1 -argyle2 10 10 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat 10 10 > ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -g2 10 > ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -g2 10 10 10 > ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -g2 10 > ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 clist1="-color=rgb:00/00/00"
@@ -101,89 +101,89 @@ clist4="-color=rgb:00/00/00,rgb:00/00/ff,rgb:00/ff/ff,rgb:ff/ff/ff"
 
 # These patterns require exactly 2 colors
 ppmpat -gingham2 ${clist1} 10 10 > ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -argyle1  ${clist1} 10 10 > ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -gingham2 ${clist3} 10 10 > ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -argyle1  ${clist3} 10 10 > ${test_out} || \
-  printf "Expected failure 13"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 13 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # These require exactly 3 colors
 ppmpat -gingham3 ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 14"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 14 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -argyle2  ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 15"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 15 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -madras   ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 16"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 16 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -tartan   ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 17"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 17 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -gingham3 ${clist4} 10 10 > ${test_out} || \
-  printf "Expected failure 18"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 18 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -argyle2  ${clist4} 10 10 > ${test_out} || \
-  printf "Expected failure 19"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 19 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -madras   ${clist4} 10 10 > ${test_out} || \
-  printf "Expected failure 20"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 20 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -tartan   ${clist4} 10 10 > ${test_out} || \
-  printf "Expected failure 21"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 21 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # These require at least 3 colors
 ppmpat -squig    ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 22"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 22 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -camo     ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 23"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 23 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -anticamo ${clist2} 10 10 > ${test_out} || \
-  printf "Expected failure 24"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 24 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # The squig pattern has an aspect ratio restriction
 ppmpat -squig ${clist3} 10 250  > ${test_out} || \
-  printf "Expected failure 25"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 25 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmpat -squig ${clist3} 500 20  > ${test_out} || \
-  printf "Expected failure 26"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 26 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmtoapplevol.ok b/test/ppmtoapplevol.ok
index 46acda60..daed172c 100644
--- a/test/ppmtoapplevol.ok
+++ b/test/ppmtoapplevol.ok
@@ -1,6 +1,6 @@
 Test: should print 1518149010 3065
 1518149010 3065
 Test Invalid
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
diff --git a/test/ppmtoapplevol.test b/test/ppmtoapplevol.test
index 4964ede8..a11e6aa6 100755
--- a/test/ppmtoapplevol.test
+++ b/test/ppmtoapplevol.test
@@ -15,16 +15,16 @@ tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
 pbmmake 10 11 | ppmtoapplevol > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
  
 pbmmake 10 13 | ppmtoapplevol > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
  
 pbmmake 256 12 | ppmtoapplevol > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/ppmwheel.ok b/test/ppmwheel.ok
index 790a19cb..525bee2c 100644
--- a/test/ppmwheel.ok
+++ b/test/ppmwheel.ok
@@ -2,8 +2,8 @@ Test 1.
 1537578995 59
 875938089 86
 Test Invalid.
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
diff --git a/test/ppmwheel.test b/test/ppmwheel.test
index c6583f97..ca439bea 100755
--- a/test/ppmwheel.test
+++ b/test/ppmwheel.test
@@ -122,26 +122,26 @@ echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
 ppmwheel 10 -huevalue -huesaturation > ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmwheel 0 > ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmwheel 3 > ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmwheel > ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ppmwheel 10 10 > ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
diff --git a/test/qoi-roundtrip.ok b/test/qoi-roundtrip.ok
index faa7601f..66e25bd8 100644
--- a/test/qoi-roundtrip.ok
+++ b/test/qoi-roundtrip.ok
@@ -17,18 +17,18 @@ Test 3.  Should print 3.N 0 0
 3.3 0 0
 3.4 0 0
 Test Invalid
-Should print: Expected failure N 1
-Expected failure 1 1
-Expected failure 2 1
-Expected failure 3 1
-Expected failure 4 1
-Expected failure 5 1
-Expected failure 6 1
-Expected failure 7 1
-Expected failure 8 1
+Should print: Expected failure N (no output)
+Expected failure 1 (no output)
+Expected failure 2 (no output)
+Expected failure 3 (no output)
+Expected failure 4 (no output)
+Expected failure 5 (no output)
+Expected failure 6 (no output)
+Expected failure 7 (no output)
+Expected failure 8 (no output)
 ------------------------------
-Should print: Expected failure N 0
-Expected failure 9 0
-Expected failure 10 0
-Expected failure 11 0
-Expected failure 12 0
+Should print: Expected failure N (output produced)
+Expected failure 9 (output produced)
+Expected failure 10 (output produced)
+Expected failure 11 (output produced)
+Expected failure 12 (output produced)
diff --git a/test/qoi-roundtrip.test b/test/qoi-roundtrip.test
index f758abcc..52396e39 100755
--- a/test/qoi-roundtrip.test
+++ b/test/qoi-roundtrip.test
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 # This script tests: qoitopam pamtoqoi
 # Also requires: pamdepth pamfile pamseq pamstack pamtopnm pbmmake
 # Also requires: pgmnoise ppmpat ppmtopgm
@@ -155,19 +155,19 @@ echo "Invalid command-line argument combinations." 1>&2
 echo "Error messages should appear below the line." 1>&2
 echo "-----------------------------------------------------------" 1>&2
 
-echo "Should print: Expected failure N 1"
+echo "Should print: Expected failure N (no output)"
 
 pamseq -tupletype="void" 1 1 | pamtoqoi > \
   ${test_out} || \
-  printf "Expected failure 1"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 1 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ( echo "P1"; echo "400000001 1" ;
   head -c 400000001 /dev/zero ) | pamtoqoi > \
   ${test_out} || \
-  printf "Expected failure 2"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 2 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Replace fields in the qoi file header with invalid values
@@ -175,24 +175,24 @@ pamseq -tupletype="void" 1 1 | pamtoqoi > \
 ( printf "qojf"
   tail -c +5 ${maze_qoi} ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 3"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 3 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ( head -c 4 ${maze_qoi}
   head -c 4 /dev/zero
   tail -c +9 ${maze_qoi} ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 4"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 4 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ( head -c 8 ${maze_qoi}
   head -c 4 /dev/zero
   tail -c +13 ${maze_qoi} ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 5"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 5 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 # Following sed construct means: "replace first 8 bytes of input
@@ -204,51 +204,51 @@ pamseq -tupletype="void" 1 1 | pamtoqoi > \
   tail -c +5 ${maze_qoi} | \
   sed '1s/^......../\x00\x00\x4F\xFF\x00\x00\x4F\xFF/' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 6"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 6 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ( head -c 12 ${maze_qoi}
   tail -c +13 ${maze_qoi} | sed '1s/^./\x01/' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 7"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 7 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 ( head -c 13 ${maze_qoi}
   tail -c +14 ${maze_qoi} | sed '1s/^./\x02/' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 8"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 8 "
+  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
   rm -f ${test_out}
 
 echo "------------------------------"
-echo "Should print: Expected failure N 0"
+echo "Should print: Expected failure N (output produced)"
 
 ( head -c $(( ${maze_qoi_size} - 9 )) ${maze_qoi}
   tail -c 9 ${maze_qoi} |   sed '1s/^./\xfd/' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 9"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 9 "
+  test -s ${test_out} && echo "(output produced)"|| echo "no output"
   rm -f ${test_out}
 
 head -c $(( ${maze_qoi_size} - 1 )) ${maze_qoi} | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 10"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 10 "
+  test -s ${test_out} && echo "(output produced)"|| echo "no output"
   rm -f ${test_out}
 
 ( head -c $(( ${maze_qoi_size} - 1 )) ${maze_qoi}
   printf '1' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 11"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 11 "
+  test -s ${test_out} && echo "(output produced)"|| echo "no output"
   rm -f ${test_out}
 
 ( cat ${maze_qoi}; printf '1' ) | qoitopam > \
   ${test_out} || \
-  printf "Expected failure 12"
-  test -s ${test_out}; echo " "$?
+  printf "Expected failure 12 "
+  test -s ${test_out} && echo "(output produced)"|| echo "no output"
   rm -f ${test_out}
 
 rm ${maze_qoi}
diff --git a/test/stdin-pam1.test b/test/stdin-pam1.test
index 7cb15dfc..2ab7b11c 100755
--- a/test/stdin-pam1.test
+++ b/test/stdin-pam1.test
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 # This script tests: pamaddnoise pamaltsat pambackground pambayer
 # This script tests: pambrighten pamcat pamcut pamdeinterlace pamdepth pamditherbw
 # This script tests: pamedge pamexec pamfile pamfind pamfix pamflip
diff --git a/test/stdin-pam2.test b/test/stdin-pam2.test
index f47df604..10713c77 100755
--- a/test/stdin-pam2.test
+++ b/test/stdin-pam2.test
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 # This script tests: pammasksharpen pammixmulti pamdice
 # This script tests: pamlookup pamunlookup
 # Also requires: pbmmake
diff --git a/test/stdin-ppm3.test b/test/stdin-ppm3.test
index 064e3e22..1313ac40 100755
--- a/test/stdin-ppm3.test
+++ b/test/stdin-ppm3.test
@@ -1,4 +1,4 @@
-o#! /bin/sh
+#! /bin/sh
 # This script tests: ppmtobmp bmptopnm
 # This script tests: ppmtoilbm ilbmtoppm
 # This script tests: ppmtoleaf leaftoppm