about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/Execute-Tests95
-rw-r--r--test/Test-Order1
-rw-r--r--test/infotopam.ok27
-rwxr-xr-xtest/infotopam.test65
-rwxr-xr-xtest/pamarith.test2
-rwxr-xr-xtest/pambrighten.test2
-rwxr-xr-xtest/pamcat1.test2
-rwxr-xr-xtest/pamchannel.test2
-rwxr-xr-xtest/pamcrater.test2
-rw-r--r--test/pamcut.ok4
-rwxr-xr-xtest/pamcut.test56
-rwxr-xr-xtest/pamdepth.test2
-rwxr-xr-xtest/pamditherbw.test2
-rwxr-xr-xtest/pamfile.test2
-rwxr-xr-xtest/pamfind.test2
-rwxr-xr-xtest/pamfunc.test2
-rwxr-xr-xtest/pamgauss.test2
-rwxr-xr-xtest/pamhue.test2
-rwxr-xr-xtest/pamrecolor.test2
-rwxr-xr-xtest/pamrestack.test2
-rwxr-xr-xtest/pamscale-reportonly.test2
-rwxr-xr-xtest/pamseq.test2
-rwxr-xr-xtest/pamshuffle.test2
-rwxr-xr-xtest/pamstack.test2
-rwxr-xr-xtest/pamsumm.test2
-rwxr-xr-xtest/pamtable.test2
-rwxr-xr-xtest/pbmclean.test2
-rwxr-xr-xtest/pbmmake.test2
-rwxr-xr-xtest/pbmnoise-parameters.test2
-rwxr-xr-xtest/pbmpage.test2
-rwxr-xr-xtest/pbmpscale.test2
-rwxr-xr-xtest/pbmtopgm.test2
-rwxr-xr-xtest/pgmhist.test2
-rwxr-xr-xtest/pgmmake.test2
-rwxr-xr-xtest/pgmnoise-parameters.test2
-rwxr-xr-xtest/pgmramp.test2
-rwxr-xr-xtest/pnmcat.test2
-rwxr-xr-xtest/pnmcolormap.test2
-rwxr-xr-xtest/pnmindex.test2
-rwxr-xr-xtest/pnmpad-color.test206
-rwxr-xr-xtest/pnmpad-format.test128
-rwxr-xr-xtest/pnmpsnr.test2
-rwxr-xr-xtest/pnmtile.test2
-rwxr-xr-xtest/ppmbrighten.test2
-rwxr-xr-xtest/ppmchange.test21
-rwxr-xr-xtest/ppmforge-parameters.test2
-rwxr-xr-xtest/ppmhist.test2
-rwxr-xr-xtest/ppmmake.test2
-rwxr-xr-xtest/ppmpat.test2
-rw-r--r--test/rgbt.txt16
50 files changed, 402 insertions, 297 deletions
diff --git a/test/Execute-Tests b/test/Execute-Tests
index c86121dc..e3b691d9 100755
--- a/test/Execute-Tests
+++ b/test/Execute-Tests
@@ -53,32 +53,30 @@ esac
 export srcdir=$(dirname $0)
 
 # Set tmpdir, which is used in some of the test scripts.  By default
-# this is created by mktemp.  The user can override and specify tmpdir,
-# but in this case it must be an existing directory and must not be
-# either $srcdir or current work.
+# this is created by mktemp.  To override edit the following lines.
+
+# When tmpdir is specified it must be an existing directory and must
+# not be either $srcdir or current work.  tmpdir should not contain
+# whitespace, non-printable characters, etc.
+
+tmpdir_created=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || exit 1;
+export tmpdir=${tmpdir_created}
 
-if [ -z $tmpdir ]
-  then
-    tmpdir_created=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || exit 1;
-  export tmpdir=${tmpdir_created}
-  else
-  tmpdir_created="";
-  if [ ! -d ${tmpdir} ]
-     then echo "Specified temporary directory $tmpdir does not exist."
-     exit 1;
-  elif [ ${tmpdir} -ef ${srcdir} ]
-     then echo "Temporary directory must not be $srcdir."
-     exit 1;
-  elif [ ${tmpdir} -ef $PWD ]
-     then echo "Temporary directory must not be current directory."
-     exit 1;
-  fi
-fi
 
-# If necessary set the RGBDEF environment variable.
-#export RGBDEF=/etc/rgb.txt
-#export RGBDEF=/usr/local/netpbm/lib/rgb.txt
-#export RGBDEF=/usr/share/emacs/*/etc/rgb.txt
+# tmpdir_created=""
+# export tmpdir=/tmp/netpbm-test-tempdir
+
+#  if [ ! -d "${tmpdir}" ]
+#     then echo "Specified temporary directory $tmpdir does not exist."
+#     exit 1;
+#  elif [ "${tmpdir}" -ef "${srcdir}" ]
+#     then echo "Temporary directory must not be $srcdir."
+#     exit 1;
+#  elif [ "${tmpdir}" -ef "$PWD" ]
+#     then echo "Temporary directory must not be current directory."
+#     exit 1;
+#  fi
+#fi
 
 
 # Declare arrays used to count and report test results.
@@ -100,17 +98,29 @@ status[4]="NOT TESTABLE"
 # Copy test image files to the current work directory
 
 if [ ! -f ./testgrid.pbm ]
-  then cp -v ${srcdir}/testgrid.pbm ./testgrid.pbm
+  then cp -v "${srcdir}"/testgrid.pbm ./testgrid.pbm
 fi
 
 if [ ! -f ./maze.pbm ]
-  then cp -v ${srcdir}/maze.pbm ./maze.pbm
+  then cp -v "${srcdir}"/maze.pbm ./maze.pbm
 fi
 
 if [ ! -f ./testimg.ppm ]
-  then cp -v ${srcdir}/testimg.ppm  ./testimg.ppm 
+  then cp -v "${srcdir}"/testimg.ppm  ./testimg.ppm 
+fi
+
+if [ ! -f ./rgbt.txt ]
+  then cp -v "${srcdir}"/rgbt.txt  ./rgbt.txt
+  # Color name dictionary file rgbt.txt is a short digest. 
+  # If desired use the proper file:
+  # cp -v /etc/rgb.txt ./rgbt.txt
+  # cp -v $RGBDEF ./rgbt.txt
 fi
 
+if [ ! -f ./test-invalid.inc ]
+  then cp -v "${srcdir}"/test-invalid.inc  ./test-invalid.inc
+fi
+   
 # The block-bin directory
 #
 # This directory contains dummy executables with the names of the
@@ -130,14 +140,14 @@ if [ ! -z $PBM_TEST_PATH ]
     then rm -rf $blockbin
   fi
   mkdir $blockbin
-  cp ${srcdir}/BLOCK $blockbin/BLOCK
+  cp "${srcdir}"/BLOCK $blockbin/BLOCK
   chmod +x $blockbin/BLOCK
 
 # Populate the block-bin directory using all-in-place.ok and
 # legacy-names.ok which together make a complete list of programs.
 
   sed 's/: ok$//' \
-       ${srcdir}/all-in-place.ok ${srcdir}/legacy-names.ok | \
+       "${srcdir}"/all-in-place.ok "${srcdir}"/legacy-names.ok | \
      tr ' ' '\n' | while read prog
     do
     ln -s $blockbin/BLOCK $blockbin/$prog
@@ -216,17 +226,17 @@ if [ ! -z $target ]
   echo $target | sed 's/,/\n/g' | \
                  sed -e 's/^/# This script tests: .*\\</' -e 's/$/\\>/' \
                      -e '/^$/q' | \
-                 grep -f - ${srcdir}/*.test -l | \
+                 grep -f - "${srcdir}"/*.test -l | \
                    while read i ; do echo ${i##*/} ; done | \
-                 grep -f - ${srcdir}/Test-Order > ./Test-Order ;
+                 grep -f - "${srcdir}"/Test-Order > ./Test-Order ;
   if [ ! -s ./Test-Order ]
     then echo;
          echo "Error: No testable program names in target: "$target;
          echo; exit 1
   fi
 else 
-       cp ${srcdir}/Test-Order ./Test-Order ;
-       #cp --no-clobber ${srcdir}/Test-Order ./Test-Order ;
+       cp "${srcdir}"/Test-Order ./Test-Order ;
+       #cp --no-clobber "${srcdir}"/Test-Order ./Test-Order ;
 fi
 
 echo
@@ -250,25 +260,25 @@ fi
 # either of these conditions are not met, do not execute the test and
 # report "Not Testable".
 
-if [ ! -s ${srcdir}/${tname%.test}.ok ]
+if [ ! -s "${srcdir}"/${tname%.test}.ok ]
 then
   echo "${tname%.test}.ok does not exist"
   let result=4;
 else
-  ${srcdir}/Available-Testprog \
+  "${srcdir}"/Available-Testprog \
     `sed -n -e '/^# This script tests: /s/# This script tests: //p' \
             -e '/^# Also requires: /s/^# Also requires: //p' \
-            -e '/^$/q' ${srcdir}/$tname | tr '\n' ' '`
+            -e '/^$/q' "${srcdir}"/$tname | tr '\n' ' '`
   case $? in
   0)
-    PATH=${testpath} $vg_command ${srcdir}/$tname > ${tname%.test}.out;
+    PATH=${testpath} $vg_command "${srcdir}"/$tname > ${tname%.test}.out;
     let retval=$?
     case $retval in
-    0)   cmp -s ${tname%.test}.out ${srcdir}/${tname%.test}.ok ;
+    0)   cmp -s ${tname%.test}.out "${srcdir}"/${tname%.test}.ok ;
          if [ $? -eq 0 ]
             then let result=0;  rm  ${tname%.test}.out ;
             else let result=1;
-                 grep "^##" ${srcdir}/$tname  # Print failure message.
+                 grep "^##" "${srcdir}"/$tname  # Print failure message.
          fi ;;
     80) let result=4 ;;
     *)  let result=1 ;;
@@ -290,7 +300,7 @@ done
 
 # Erase temporary bin directory and its contents.
 
-rm -rf ${srcdir}/bin
+rm -rf "${srcdir}"/bin
 
 
 # Erase temporary directory and its contents, if it was created.
@@ -303,8 +313,9 @@ fi
 # Erase test image files in the current (work) directory.
 # (Do not erase them if we are working from the source directory.)
 
-if [ ! $PWD -ef ${srcdir} ]
-    then rm ./testimg.ppm ./testgrid.pbm ./maze.pbm
+if [ ! $PWD -ef "${srcdir}" ]
+  then rm ./testimg.ppm ./testgrid.pbm ./maze.pbm \
+          ./rgbt.txt ./test-invalid.inc
 fi
 
 
diff --git a/test/Test-Order b/test/Test-Order
index 6c21c759..3b3fc4af 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -178,6 +178,7 @@ ppmtoapplevol.test
 ppmtomitsu.test
 411toppm.test
 eyuvtoppm.test
+infotopam.test
 rawtoppm.test
 
 gif-transparent1.test
diff --git a/test/infotopam.ok b/test/infotopam.ok
new file mode 100644
index 00000000..03c029c7
--- /dev/null
+++ b/test/infotopam.ok
@@ -0,0 +1,27 @@
+Test 0.1  Should print 341768228 989
+341768228 989
+Test 0.2  Should print 3992125899 16230
+3992125899 16230
+Test 1.1  Should print 3375570914 10141
+3375570914 10141
+Test 1.2  Should print 1428271393 94509
+1428271393 94509
+Test 2.   Should print 352521340 94509
+352521340 94509
+Test 3.1  Should print 3375570914 10141
+3375570914 10141
+Test 3.2  Should print 1428271393 94509
+1428271393 94509
+Test 4.   Should print match twice
+match
+match
+Test Invalid
+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/infotopam.test b/test/infotopam.test
new file mode 100755
index 00000000..5b849c65
--- /dev/null
+++ b/test/infotopam.test
@@ -0,0 +1,65 @@
+#! /bin/sh
+# This script tests: infotopam
+# Also requires: ppmchange pamtopnm
+
+tmpdir=${tmpdir:-/tmp}
+test1_pam=${tmpdir}/test1.pam
+test1ch_ppm=${tmpdir}/test1ch.ppm
+RGBDEF=./rgb.test
+
+cp "$srcdir/test1.info" "$tmpdir"
+cp "$srcdir/test2.info" "$tmpdir"
+
+test1_info="$tmpdir/test1.info"
+test2_info="$tmpdir/test2.info"
+
+echo "Test 0.1  Should print 341768228 989"
+cksum < ${test1_info}
+
+echo "Test 0.2  Should print 3992125899 16230"
+cksum < ${test2_info}
+
+echo "Test 1.1  Should print 3375570914 10141"
+infotopam ${test1_info} | tee ${test1_pam} | cksum
+
+echo "Test 1.2  Should print 1428271393 94509"
+infotopam ${test2_info} | cksum
+
+echo "Test 2.   Should print 352521340 94509"
+infotopam -selected ${test2_info} | cksum
+
+echo "Test 3.1  Should print 3375570914 10141"
+infotopam -forcecolor ${test1_info} | cksum
+
+echo "Test 3.2  Should print 1428271393 94509"
+infotopam -forcecolor ${test2_info} | cksum
+
+echo "Test 4.   Should print match twice"
+
+ppmchange rgb:00/55/AA rgb:0/0/f rgb:00/00/20 rgb:0/0/0 ${test1_pam} > ${test1ch_ppm}
+infotopam -numcolors 2 0 rgb:0/0/f 2 rgb:0/0/0 ${test1_info} | pamtopnm | \
+cmp -s  ${test1ch_ppm} - && echo "match" || echo "no match"
+
+infotopam -numcolors 4 0 rgb:00/55/AA  1 rgb:f/f/f  2 rgb:00/00/20  3 rgb:FF/8A/00 \
+    ${test1_info} | \
+cmp -s ${test1_pam} - && echo "match" || echo "no match"
+
+rm ${test1_pam} ${test1ch_ppm}
+
+echo "Test Invalid"
+
+. ./test-invalid.inc
+
+invCmd "infotopam -selected ${test1_info}"
+invCmd "infotopam -selected -forcecolor ${test1_info}"
+invCmd "infotopam -numcolors 0 0 rgb:0/0/f ${test1_info}"
+invCmd "infotopam -numcolors 1 4 rgb:0/0/f ${test1_info}"
+invCmd "infotopam -numcolors 1 -1 rgb:0/0/f ${test1_info}"
+invCmd "infotopam -numcolors 1 rgb:00/00/00 ${test1_info}"
+invCmd "infotopam -numcolors 2 0 rgb:00/00/00 1 ${test1_info}"
+invCmd "infotopam -numcolors 4 \
+  rgb:0/0/f 1 rgb:0/f/0 2 rgb:/f/f/f 3 rgb:f/0/0 4 yellow ${test1_info}"
+invCmd "infotopam -numcolors 5 0 \
+  rgb:0/0/f 1 rgb:0/f/0 2 rgb:/f/f/f 3 rgb:f/0/0 4 rgb:f/f/0 ${test1_info}"
+
+rm ${test1_info} ${test2_info}
diff --git a/test/pamarith.test b/test/pamarith.test
index 20c4039d..8f5e35ef 100755
--- a/test/pamarith.test
+++ b/test/pamarith.test
@@ -118,7 +118,7 @@ rm ${input1_ppm}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # multiple functions
 
diff --git a/test/pambrighten.test b/test/pambrighten.test
index d79ad583..31d063be 100755
--- a/test/pambrighten.test
+++ b/test/pambrighten.test
@@ -52,7 +52,7 @@ rm ${input_pgm}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pambrighten -v -120 testimg.ppm"
 invCmd "pambrighten -s -120 testimg.ppm"
diff --git a/test/pamcat1.test b/test/pamcat1.test
index 9480228c..fb8e39cd 100755
--- a/test/pamcat1.test
+++ b/test/pamcat1.test
@@ -187,7 +187,7 @@ rm ${seq2_4h_pam} ${seq2_4v_pam} ${seq2_4v3_pam} ${seq2_4h4_pam}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # direction not specified
 invCmd "pamcat testgrid.pbm testimg.ppm"
diff --git a/test/pamchannel.test b/test/pamchannel.test
index f3399343..e7ab4efb 100755
--- a/test/pamchannel.test
+++ b/test/pamchannel.test
@@ -41,7 +41,7 @@ test_out=${tmpdir}/test_out
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamchannel  -infile testgrid.pbm 1"
 invCmd "pamchannel  -infile testimg.ppm 3"
diff --git a/test/pamcrater.test b/test/pamcrater.test
index 5362bde3..8c78ac6b 100755
--- a/test/pamcrater.test
+++ b/test/pamcrater.test
@@ -58,7 +58,7 @@ echo "Test Invalid."
 
 test_out=${tmpdir}/test_out
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamcrater -width 0"
 invCmd "pamcrater -height 0"
diff --git a/test/pamcut.ok b/test/pamcut.ok
index 18ed88e8..cc1563b7 100644
--- a/test/pamcut.ok
+++ b/test/pamcut.ok
@@ -100,7 +100,3 @@ 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)
diff --git a/test/pamcut.test b/test/pamcut.test
index 7d60e1cd..74fe0091 100755
--- a/test/pamcut.test
+++ b/test/pamcut.test
@@ -66,7 +66,7 @@ pamcut -croptop 0 -cropleft 0 -cropbottom 0 -cropright 0 \
       -reportonly maze.pbm
 pamcut -top 0 -left 0 \
       -bottom $((${height} -1)) -right $((${width} -1)) \
-       -reportonly maze.pbm
+      -reportonly maze.pbm
 pamcut -top 0 -left 0 -bottom -1 -right -1 -reportonly maze.pbm 
 pamcut -top 0 -left 0 -width ${width} -height ${height} \
       -reportonly maze.pbm
@@ -75,10 +75,10 @@ pamcut -reportonly maze.pbm
 echo "Test 5b. Should print 281226646 481 twice"
 
 pamcut -croptop 0 -cropleft 0 -cropbottom 0 -cropright 0 maze.pbm | \
- cksum
+  cksum
 pamcut maze.pbm | cksum
 
-test50_pbm=${tmpdir}/test50.pbm
+test50_pbm="${tmpdir}"/test50.pbm
 
 echo "Test 6a.  Should print 5 34 5 34 50 50 30 30"
 
@@ -92,7 +92,7 @@ rm  ${test50_pbm}
 
 echo "Test 7.  Should print 284857390 12 sixteen times"
 
-test1_pbm=${tmpdir}/test1.pbm
+test1_pbm="${tmpdir}"/test1.pbm
 
 pbmmake -b 1 1 > ${test1_pbm}
 
@@ -121,12 +121,12 @@ pamcut  -pad -cropright=17 -width=5 -height=5 ${test1_pbm} | cksum
 
 echo "Test 8.  Should print 3125257619 29 four times"
 
-test3_pbm=${tmpdir}/test3.pbm
+test3_pbm="${tmpdir}"/test3.pbm
 
 pbmmake -g 3 3 > ${test3_pbm}
 
-pamcut -pad -cropleft=10  -croptop=10    -width=10 -height=10 ${test3_pbm} | cksum
-pamcut  -pad -cropright=10 -croptop=10 -width=10 -height=10    ${test3_pbm} |\
+pamcut  -pad -cropleft=10  -croptop=10    -width=10 -height=10 ${test3_pbm} | cksum
+pamcut  -pad -cropright=10 -croptop=10    -width=10 -height=10 ${test3_pbm} |\
    pamflip -lr | cksum
 pamcut  -pad -cropleft=10  -cropbottom=10 -width=10 -height=10 ${test3_pbm} |\
    pamflip -tb | cksum
@@ -137,7 +137,7 @@ rm ${test3_pbm}
 
 echo "Test 9.  Should print 3338453023 36 sixteen times"
 
-testb_pgm=${tmpdir}/testb.pgm
+testb_pgm="${tmpdir}"/testb.pgm
 
 pgmmake 0.0 1 1 > ${testb_pgm}
 
@@ -167,7 +167,7 @@ rm  ${testb_pgm}
 
 echo "Test 10.  Should print 3957742883 302 four times"
 
-testg_pgm=${tmpdir}/testg.pgm
+testg_pgm="${tmpdir}"/testg.pgm
 
 pgmmake 0.5 2 2 > ${testg_pgm}
 
@@ -185,7 +185,7 @@ rm  ${testg_pgm}
 
 echo "Test 11.  Should print 1576602925 8 four times"
 
-test5_pbm=${tmpdir}/test5.pbm
+test5_pbm="${tmpdir}"/test5.pbm
 
 pbmmake -g 5 5 > ${test5_pbm}
 
@@ -198,29 +198,29 @@ rm ${test1_pbm} ${test5_pbm}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # overspecification
-invCmd "pamcut -left=1 -right=1 -width=14 testgrid.pbm"
-invCmd "pamcut -top=1 -bottom=1 -height=16 testgrid.pbm"
-invCmd "pamcut -right=1 -cropright=1 testgrid.pbm"
-invCmd "pamcut -top=1 -croptop=1 testgrid.pbm"
-invCmd "pamcut -bottom=1 -cropbottom=1 testgrid.pbm"
-invCmd "pamcut -left=1 -cropleft=1 testgrid.pbm"
+invCmd 'pamcut -left=1 -right=1 -width=14 testgrid.pbm"
+invCmd 'pamcut -top=1 -bottom=1 -height=16 testgrid.pbm"
+invCmd 'pamcut -right=1 -cropright=1 testgrid.pbm"
+invCmd 'pamcut -top=1 -croptop=1 testgrid.pbm"
+invCmd 'pamcut -bottom=1 -cropbottom=1 testgrid.pbm"
+invCmd 'pamcut -left=1 -cropleft=1 testgrid.pbm"
 
 # excessive amounts
-invCmd "pamcut -cropleft=14 testgrid.pbm"
-invCmd "pamcut -cropleft=7 -cropright=8 testgrid.pbm"
-invCmd "pamcut -left=7 -right=6 testgrid.pbm"
-invCmd "pamcut -croptop=16 testgrid.pbm"
-invCmd "pamcut -croptop=8 -cropbottom=8 testgrid.pbm"
-invCmd "pamcut -top=10 -bottom=9 testgrid.pbm"
+invCmd 'pamcut -cropleft=14 testgrid.pbm'
+invCmd 'pamcut -cropleft=7 -cropright=8 testgrid.pbm'
+invCmd 'pamcut -left=7 -right=6 testgrid.pbm'
+invCmd 'pamcut -croptop=16 testgrid.pbm'
+invCmd 'pamcut -croptop=8 -cropbottom=8 testgrid.pbm'
+invCmd 'pamcut -top=10 -bottom=9 testgrid.pbm'
 
 # pad absent
-invCmd "pamcut -cropleft=1 -width=14 testgrid.pbm"
-invCmd "pamcut -croptop=1  -height=16 testgrid.pbm"
+invCmd 'pamcut -cropleft=1 -width=14 testgrid.pbm'
+invCmd 'pamcut -croptop=1  -height=16 testgrid.pbm'
 
 # legacy style: insufficient number of positional parameters
-invCmd "pamcut 5 testimg.ppm"
-invCmd "pamcut 5 4 testimg.ppm"
-invCmd "pamcut 5 5 30 testimg.ppm"
+invCmd 'pamcut 5 testimg.ppm'
+invCmd 'pamcut 5 4 testimg.ppm'
+invCmd 'pamcut 5 5 30 testimg.ppm'
diff --git a/test/pamdepth.test b/test/pamdepth.test
index e938a630..e4e0684c 100755
--- a/test/pamdepth.test
+++ b/test/pamdepth.test
@@ -24,7 +24,7 @@ pamdepth 255 testimg.ppm | cmp -s - testimg.ppm
 # Test Invalid
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamdepth 0 testgrid.pbm"
 invCmd "pamdepth 65536 testimg.ppm"
diff --git a/test/pamditherbw.test b/test/pamditherbw.test
index 76bcdbd7..3c21dc4b 100755
--- a/test/pamditherbw.test
+++ b/test/pamditherbw.test
@@ -39,7 +39,7 @@ pamditherbw -cluster8 ${test_red} | cksum
 
 echo "Test: Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamditherbw -fs -atkinson       ${test_red}"
 invCmd "pamditherbw -floyd -atkinson    ${test_red}"
diff --git a/test/pamfile.test b/test/pamfile.test
index d605326d..11db2f3a 100755
--- a/test/pamfile.test
+++ b/test/pamfile.test
@@ -22,7 +22,7 @@ cat testgrid.pbm testimg.ppm testgrid.pbm | pamfile -machine
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamfile -size -machine  testimg.ppm"
 invCmd "pamfile -count -machine testimg.ppm"
diff --git a/test/pamfind.test b/test/pamfind.test
index 079e35f4..68aa0a20 100755
--- a/test/pamfind.test
+++ b/test/pamfind.test
@@ -33,7 +33,7 @@ rm ${sorted0_res} ${sorted1_res}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamfind -color=black -target=1,1,1 testimg.ppm"
 invCmd "pamfind -target=0,0 testimg.ppm"
diff --git a/test/pamfunc.test b/test/pamfunc.test
index b1b9edfc..16d4c36d 100755
--- a/test/pamfunc.test
+++ b/test/pamfunc.test
@@ -87,7 +87,7 @@ pamfunc -shiftright 0 maze.pbm | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamfunc -multiplier testimg.ppm"
 invCmd "pamfunc -multiplier=-1 testimg.ppm"
diff --git a/test/pamgauss.test b/test/pamgauss.test
index 34b6630a..09e400b3 100755
--- a/test/pamgauss.test
+++ b/test/pamgauss.test
@@ -19,7 +19,7 @@ pamgauss 3 3 -sigma=0.5 -tupletype="GRAYSCALE" | pamfile
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamgauss       -sigma=0.5 "
 invCmd "pamgauss 0 5   -sigma=0.5 "
diff --git a/test/pamhue.test b/test/pamhue.test
index ce148a45..d538daec 100755
--- a/test/pamhue.test
+++ b/test/pamhue.test
@@ -34,6 +34,6 @@ pamhue -huechange=360 testimg.ppm | cmp -s - testimg.ppm
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamhue testimg.ppm "
diff --git a/test/pamrecolor.test b/test/pamrecolor.test
index b5674776..e88346ff 100755
--- a/test/pamrecolor.test
+++ b/test/pamrecolor.test
@@ -16,7 +16,7 @@ echo "Test 2. Should produce 3500040755 101532 twice"
 pamrecolor --targetcolor=rgb:80/80/80 testimg.ppm | cksum
 pamrecolor --colorspace=ntsc --targetcolor=rgb:80/80/80 testimg.ppm | cksum
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 truncated_file=${tmpdir}/truncated.txt
 echo P6 > ${truncated_file}
diff --git a/test/pamrestack.test b/test/pamrestack.test
index c91830e4..6f607ff6 100755
--- a/test/pamrestack.test
+++ b/test/pamrestack.test
@@ -58,7 +58,7 @@ pamrestack \
 test_out=${tmpdir}/test_out
 echo "Test Invalid."
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamrestack testgrid.pbm maze.pbm"
 invCmd "pamrestack -abort -width=$((pixels * 2 + 1 )) maze.pbm"
diff --git a/test/pamscale-reportonly.test b/test/pamscale-reportonly.test
index 39745809..a759e4e3 100755
--- a/test/pamscale-reportonly.test
+++ b/test/pamscale-reportonly.test
@@ -19,7 +19,7 @@ pamscale -reportonly -pixels=45000 testimg.ppm
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # Expected failure cases
 
diff --git a/test/pamseq.test b/test/pamseq.test
index 894e8d6d..33379b46 100755
--- a/test/pamseq.test
+++ b/test/pamseq.test
@@ -8,7 +8,7 @@ pamseq 1 255 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamseq 1"
 invCmd "pamseq 0 255"
diff --git a/test/pamshuffle.test b/test/pamshuffle.test
index 371b65a5..8b58783f 100755
--- a/test/pamshuffle.test
+++ b/test/pamshuffle.test
@@ -46,7 +46,7 @@ rm ${out1_pam}
 test_out=${tmpdir}/test_out
 echo "Test Invalid."
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamshuffle testimg.ppm testgrid.pbm"
 invCmd "pamshuffle -randomseed -column testgrid.pbm"
diff --git a/test/pamstack.test b/test/pamstack.test
index 6374c4bd..62baab2d 100755
--- a/test/pamstack.test
+++ b/test/pamstack.test
@@ -98,7 +98,7 @@ test "$s0" = "$s2" && echo "true" || echo "false"
 # Test Invalid
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamstack testgrid.pbm testimg.ppm"
 invCmd "pamstack ${i1_pgm} ${std_pgm}"
diff --git a/test/pamsumm.test b/test/pamsumm.test
index eb41ee36..cd58913f 100755
--- a/test/pamsumm.test
+++ b/test/pamsumm.test
@@ -26,7 +26,7 @@ for type in -sum -min -max -mean
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pamsumm -sum -min  testimg.ppm"
 invCmd "pamsumm -sum -max  testimg.ppm"
diff --git a/test/pamtable.test b/test/pamtable.test
index d42187f9..c7a0e962 100755
--- a/test/pamtable.test
+++ b/test/pamtable.test
@@ -46,7 +46,7 @@ for maxval in 9 10 9999 10000 65535
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 input1_pam=${tmpdir}/input1.pam
 
diff --git a/test/pbmclean.test b/test/pbmclean.test
index 64ed6df0..0200df7e 100755
--- a/test/pbmclean.test
+++ b/test/pbmclean.test
@@ -37,7 +37,7 @@ rm ${sheet_pbm}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # overspecification
 invCmd "pbmclean -black -white -min=1 -extended testgrid.pbm"
diff --git a/test/pbmmake.test b/test/pbmmake.test
index 32153f95..909ee8c8 100755
--- a/test/pbmmake.test
+++ b/test/pbmmake.test
@@ -24,7 +24,7 @@ done
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pbmmake -b -w -plain 1 1"
 invCmd "pbmmake -b -g -plain 1 1"
diff --git a/test/pbmnoise-parameters.test b/test/pbmnoise-parameters.test
index d0e04ebf..a0d1bcc8 100755
--- a/test/pbmnoise-parameters.test
+++ b/test/pbmnoise-parameters.test
@@ -4,7 +4,7 @@
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # Invalid -ratio arguments
 
diff --git a/test/pbmpage.test b/test/pbmpage.test
index 9cb46e22..b8776864 100755
--- a/test/pbmpage.test
+++ b/test/pbmpage.test
@@ -11,7 +11,7 @@ pbmpage -a4 2 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pbmpage -a3 1"
 invCmd "pbmpage 0"
diff --git a/test/pbmpscale.test b/test/pbmpscale.test
index b99561f6..92965c5d 100755
--- a/test/pbmpscale.test
+++ b/test/pbmpscale.test
@@ -27,7 +27,7 @@ pbmtext -nomargin "10" | pbmpscale 10 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pbmpscale testgrid.pbm"
 invCmd "pbmpscale 0 testgrid.pbm"
diff --git a/test/pbmtopgm.test b/test/pbmtopgm.test
index 19378bb6..f9aeb1a1 100755
--- a/test/pbmtopgm.test
+++ b/test/pbmtopgm.test
@@ -9,7 +9,7 @@ pbmtopgm -plain 1 1 testgrid.pbm
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pbmtopgm 5 0 testgrid.pbm"
 invCmd "pbmtopgm 0 9 testgrid.pbm"
diff --git a/test/pgmhist.test b/test/pgmhist.test
index 5c458a57..22244ad2 100755
--- a/test/pgmhist.test
+++ b/test/pgmhist.test
@@ -26,7 +26,7 @@ pgmramp -lr 256 1 | pgmhist -machine -decile   | \
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pgmhist -median   -quartile testgrid.pbm"
 invCmd "pgmhist -median   -decile   testgrid.pbm"
diff --git a/test/pgmmake.test b/test/pgmmake.test
index d8e248d4..acbe75a4 100755
--- a/test/pgmmake.test
+++ b/test/pgmmake.test
@@ -12,7 +12,7 @@ pgmmake .2 50 100 -maxval=5 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pgmmake"
 invCmd "pgmmake 100  5 5"
diff --git a/test/pgmnoise-parameters.test b/test/pgmnoise-parameters.test
index 871aacf9..127b4b3f 100755
--- a/test/pgmnoise-parameters.test
+++ b/test/pgmnoise-parameters.test
@@ -4,7 +4,7 @@
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pgmnoise"
 invCmd "pgmnoise -maxval=255  -randomseed=1"
diff --git a/test/pgmramp.test b/test/pgmramp.test
index 84fe02ca..49f71209 100755
--- a/test/pgmramp.test
+++ b/test/pgmramp.test
@@ -21,7 +21,7 @@ pgmramp -diagonal -maxval=510 256 256 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 
 for combination in "-lr -tb" "-lr -rectangle" "-rectangle -ellipse"
diff --git a/test/pnmcat.test b/test/pnmcat.test
index 8779638b..0db06fd5 100755
--- a/test/pnmcat.test
+++ b/test/pnmcat.test
@@ -100,7 +100,7 @@ rm ${diag_ppm}
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 # direction not specified
 invCmd "pnmcat testgrid.pbm testimg.ppm"
diff --git a/test/pnmcolormap.test b/test/pnmcolormap.test
index 953dece3..4efefb39 100755
--- a/test/pnmcolormap.test
+++ b/test/pnmcolormap.test
@@ -36,7 +36,7 @@ rm ${map}
 echo
 echo "Test Invalid."
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pnmcolormap 0 testimg.ppm  "
 invCmd "pnmcolormap -1 testimg.ppm "
diff --git a/test/pnmindex.test b/test/pnmindex.test
index 174f60bd..fbdcc038 100755
--- a/test/pnmindex.test
+++ b/test/pnmindex.test
@@ -44,7 +44,7 @@ pnmindex -size 50 -across=2 -quant -colors=256 testimg.ppm testimg.ppm testimg.p
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pnmindex -size -1 testgrid.pbm"
 invCmd "pnmindex -size  0 testgrid.pbm"
diff --git a/test/pnmpad-color.test b/test/pnmpad-color.test
index 05e8acca..7ef03e07 100755
--- a/test/pnmpad-color.test
+++ b/test/pnmpad-color.test
@@ -4,33 +4,31 @@
 
 tmpdir=${tmpdir:-/tmp}
 
-white_pbm=${tmpdir}/white.pbm
-black_pbm=${tmpdir}/black.pbm
-test127_pgm=${tmpdir}/testimg1.pgm
-test255_pgm=${tmpdir}/testimg2.pgm
-test511_pgm=${tmpdir}/testimg3.pgm
-test127_ppm=${tmpdir}/testimg1.ppm
-test255_ppm=${tmpdir}/testimg2.ppm
-test511_ppm=${tmpdir}/testimg3.ppm
-target_pnm=${tmpdir}/target.pnm
-
-BLACK="rgbi:0.0/0.0/0.0"
-WHITE="rgbi:1.0/1.0/1.0"
+white_pbm="${tmpdir}"/white.pbm
+black_pbm="${tmpdir}"/black.pbm
+test127_pgm="${tmpdir}"/testimg1.pgm
+test255_pgm="${tmpdir}"/testimg2.pgm
+test511_pgm="${tmpdir}"/testimg3.pgm
+test127_ppm="${tmpdir}"/testimg1.ppm
+test255_ppm="${tmpdir}"/testimg2.ppm
+test511_ppm="${tmpdir}"/testimg3.ppm
+target_pnm="${tmpdir}"/target.pnm
+
+RGBDEF=./rgbt.txt
+
 LIGHTGRAY="rgbi:0.6/0.6/0.6"
 LIGHTGRAYv=0.6
 DARKGRAY="rgbi:0.01/0.01/0.01"
 DARKGRAYv=0.01
-PURPLE="rgb:A0/20/F0"
-YELLOW="rgb:F0/F0/00"
 
 pbmmake -w 1 1 > ${white_pbm}
 pbmmake -b 1 1 > ${black_pbm}
 pgmmake 0.25 1 1 -maxval 127 > ${test127_pgm}
 pgmmake 0.25 1 1 -maxval 255 > ${test255_pgm}
 pgmmake 0.25 1 1 -maxval 511 > ${test511_pgm}
-ppmmake ${YELLOW} 1 1 -maxval 127 > ${test127_ppm}
-ppmmake ${YELLOW} 1 1 -maxval 255 > ${test255_ppm}
-ppmmake ${YELLOW} 1 1 -maxval 511 > ${test511_ppm}
+ppmmake yellow 1 1 -maxval 127 > ${test127_ppm}
+ppmmake yellow 1 1 -maxval 255 > ${test255_ppm}
+ppmmake yellow 1 1 -maxval 511 > ${test511_ppm}
 
 ptop="-top 1"
 
@@ -48,9 +46,9 @@ pbmmake -w 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
 pnmpad ${ptop} -extend-edge ${infile} | cmptarget
 pnmpad ${ptop} -detect-background ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 pnmpad ${ptop} -color ${LIGHTGRAY}  -promote none   ${infile} | cmptarget
 
 echo "Should print match seven times"
@@ -58,11 +56,11 @@ echo "Should print match seven times"
 pbmmake -b 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 pnmpad ${ptop} -color ${DARKGRAY} -promote none ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE}   -promote none ${infile} | cmptarget
+pnmpad ${ptop} -color purple   -promote none ${infile} | cmptarget
 
 echo "Should print match once"
 
@@ -88,14 +86,14 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote all ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 1 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} -promote format ${infile} | cmptarget
+ppmmake -maxval 1 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
-ppmmake -maxval 255 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all ${infile} | cmptarget
+ppmmake -maxval 255 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all ${infile} | cmptarget
 
 echo
 echo "Test 2. PBM black infile"
@@ -107,11 +105,11 @@ echo "Should print match nine times"
 pbmmake -b 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 pnmpad ${ptop} -color ${DARKGRAY} -promote none ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE}   -promote none ${infile} | cmptarget
+pnmpad ${ptop} -color purple   -promote none ${infile} | cmptarget
 pnmpad ${ptop} -extend-edge ${infile} | cmptarget
 pnmpad ${ptop} -detect-background ${infile} | cmptarget
 
@@ -119,9 +117,9 @@ echo "Should print match five times"
 
 pbmmake -w 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 pnmpad ${ptop} -color ${LIGHTGRAY} -promote none ${infile} | cmptarget
 
 echo
@@ -134,17 +132,17 @@ echo "Should print match five times"
 pgmmake -maxval 127 0.0 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 
 echo "Should print match four times"
 
 pgmmake -maxval 127 1.0 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -166,8 +164,8 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote format ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 127 ${PURPLE} 1 1 | ppmtopgm > ${target_pnm} 
-pnmpad ${ptop} -color ${PURPLE}   -promote none ${infile} | cmptarget
+ppmmake -maxval 127 purple 1 1 | ppmtopgm > ${target_pnm} 
+pnmpad ${ptop} -color purple   -promote none ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -183,14 +181,14 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote all ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 127 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} -promote format ${infile} | cmptarget
+ppmmake -maxval 127 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
-ppmmake -maxval 255 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all    ${infile} | cmptarget
+ppmmake -maxval 255 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all    ${infile} | cmptarget
 
 
 echo
@@ -203,17 +201,17 @@ echo "Should print match five times"
 pgmmake -maxval 255 0.0 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 
 echo "Should print match four times"
 
 pgmmake -maxval 255 1.0 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -235,8 +233,8 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote format ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 255  ${PURPLE} 1 1 | ppmtopgm > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE}   -promote none ${infile} | cmptarget
+ppmmake -maxval 255  purple 1 1 | ppmtopgm > ${target_pnm}
+pnmpad ${ptop} -color purple   -promote none ${infile} | cmptarget
 
 echo "Should print match four times"
 
@@ -256,10 +254,10 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote all    ${infile} | cmptarget
 
 echo "Should print match three times"
 
-ppmmake -maxval 255 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote format ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all    ${infile} | cmptarget
+ppmmake -maxval 255 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all    ${infile} | cmptarget
 
 echo
 echo "Test 5. PGM maxval 511 infile"
@@ -271,17 +269,17 @@ echo "Should print match five times"
 pgmmake -maxval 511 0.0 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 
 echo "Should print match four times"
 
 pgmmake -maxval 511 1.0 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -303,8 +301,8 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote format ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 511 ${PURPLE} 1 1 | ppmtopgm > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} -promote none ${infile} | cmptarget
+ppmmake -maxval 511 purple 1 1 | ppmtopgm > ${target_pnm}
+pnmpad ${ptop} -color purple -promote none ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -320,10 +318,10 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote all ${infile} | cmptarget
 
 echo "Should print match three times"
 
-ppmmake -maxval 511 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote format ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all    ${infile} | cmptarget
+ppmmake -maxval 511 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all    ${infile} | cmptarget
 
 
 echo
@@ -333,26 +331,26 @@ infile=${test127_ppm}
 
 echo "Should print match five times"
 
-ppmmake -maxval 127 ${BLACK} 1 1 > ${target_pnm}
+ppmmake -maxval 127 black 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 
 echo "Should print match four times"
 
-ppmmake -maxval 127 ${WHITE} 1 1 > ${target_pnm}
+ppmmake -maxval 127 white 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 
 echo "Should print match twice"
 
-ppmmake -maxval 127 ${PURPLE} 1 1 > ${target_pnm}
-ppmmake -maxval 127 ${PURPLE} 1 2 | pnmpad ${ptop} -extend-edge | cmptarget
-ppmmake -maxval 127 ${PURPLE} 1 2 | pnmpad ${ptop} -detect-background | cmptarget
+ppmmake -maxval 127 purple 1 1 > ${target_pnm}
+ppmmake -maxval 127 purple 1 2 | pnmpad ${ptop} -extend-edge | cmptarget
+ppmmake -maxval 127 purple 1 2 | pnmpad ${ptop} -detect-background | cmptarget
 
 echo "Should print match twice"
 
@@ -368,8 +366,8 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote format ${infile} | cmptarget
 
 echo "Should print match once"
 
-ppmmake -maxval 127 ${PURPLE} 1 1 > ${target_pnm} 
-pnmpad ${ptop} -color ${PURPLE} -promote none ${infile} | cmptarget
+ppmmake -maxval 127 purple 1 1 > ${target_pnm} 
+pnmpad ${ptop} -color purple -promote none ${infile} | cmptarget
 
 echo "Should print match twice"
 
@@ -385,9 +383,9 @@ pnmpad ${ptop} -color ${DARKGRAY} -promote all ${infile} | cmptarget
 
 echo "Should print match twice"
 
-ppmmake -maxval 255 ${PURPLE} 1 1 > ${target_pnm}
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all ${infile} | cmptarget
+ppmmake -maxval 255 purple 1 1 > ${target_pnm}
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all ${infile} | cmptarget
 
 echo
 echo "Test 7. PPM maxval 511 infile"
@@ -396,30 +394,30 @@ infile=${test511_ppm}
 
 echo "Should print match five times"
 
-ppmmake -maxval 511 ${BLACK} 1 1 > ${target_pnm}
+ppmmake -maxval 511 black 1 1 > ${target_pnm}
 pnmpad ${ptop} ${infile} | cmptarget
 pnmpad ${ptop} -black ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${BLACK} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color black ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color black -promote format ${infile} | cmptarget
 
 echo "Should print match four times"
 
-ppmmake -maxval 511 ${WHITE} 1 1 > ${target_pnm}
+ppmmake -maxval 511 white 1 1 > ${target_pnm}
 pnmpad ${ptop} -white ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote none   ${infile} | cmptarget
-pnmpad ${ptop} -color ${WHITE} -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color white ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote none   ${infile} | cmptarget
+pnmpad ${ptop} -color white -promote format ${infile} | cmptarget
 
 echo "Should print match six times"
 
-ppmmake -maxval 511 ${PURPLE} 1 1 > ${target_pnm}
-ppmmake -maxval 511 ${PURPLE} 1 5 | pnmpad ${ptop} -extend-edge | cmptarget
-ppmmake -maxval 511 ${PURPLE} 1 5 | pnmpad ${ptop} -detect-background | cmptarget
-pnmpad ${ptop} -color ${PURPLE} ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote none ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote format ${infile} | cmptarget
-pnmpad ${ptop} -color ${PURPLE} -promote all    ${infile} | cmptarget
+ppmmake -maxval 511 purple 1 1 > ${target_pnm}
+ppmmake -maxval 511 purple 1 5 | pnmpad ${ptop} -extend-edge | cmptarget
+ppmmake -maxval 511 purple 1 5 | pnmpad ${ptop} -detect-background | cmptarget
+pnmpad ${ptop} -color purple ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote none ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote format ${infile} | cmptarget
+pnmpad ${ptop} -color purple -promote all    ${infile} | cmptarget
 
 echo "Should print match twice"
 
diff --git a/test/pnmpad-format.test b/test/pnmpad-format.test
index 73ea6d2b..8d29952a 100755
--- a/test/pnmpad-format.test
+++ b/test/pnmpad-format.test
@@ -4,30 +4,28 @@
 
 tmpdir=${tmpdir:-/tmp}
 
-white_pbm=${tmpdir}/white.pbm
-#black_pbm=${tmpdir}/black.pbm
-test127_pgm=${tmpdir}/testimg1.pgm
-test255_pgm=${tmpdir}/testimg2.pgm
-test511_pgm=${tmpdir}/testimg3.pgm
-test127_ppm=${tmpdir}/testimg1.ppm
-test255_ppm=${tmpdir}/testimg2.ppm
-test511_ppm=${tmpdir}/testimg3.ppm
-
-BLACK="rgbi:0.0/0.0/0.0"
-WHITE="rgbi:1.0/1.0/1.0"
+white_pbm="${tmpdir}"/white.pbm
+#black_pbm="${tmpdir}"/black.pbm
+test127_pgm="${tmpdir}"/testimg1.pgm
+test255_pgm="${tmpdir}"/testimg2.pgm
+test511_pgm="${tmpdir}"/testimg3.pgm
+test127_ppm="${tmpdir}"/testimg1.ppm
+test255_ppm="${tmpdir}"/testimg2.ppm
+test511_ppm="${tmpdir}"/testimg3.ppm
+
+RGBDEF=./rgbt.txt
+
 LIGHTGRAY="rgbi:0.6/0.6/0.6"
 LIGHTGRAYv=0.6
 DARKGRAY="rgbi:0.01/0.01/0.01"
 DARKGRAYv=0.01
-PURPLE="rgb:A0/20/F0"
-YELLOW="rgb:FF/FF/00"
 
 pbmmake -w 3 1 > ${white_pbm}
 #pbmmake -b 3 1 > ${black_pbm}
 pgmmake 0.2 3 1 -maxval 127 > ${test127_pgm}
 pgmmake 0.2 3 1 -maxval 255 > ${test255_pgm}
-ppmmake ${YELLOW} 3 1 -maxval 127 > ${test127_ppm}
-ppmmake ${YELLOW} 3 1 -maxval 511 > ${test511_ppm}
+ppmmake yellow 3 1 -maxval 127 > ${test127_ppm}
+ppmmake yellow 3 1 -maxval 511 > ${test511_ppm}
 
 # define function
 ckfmt() { pamfile || echo "failure"; }
@@ -46,17 +44,17 @@ pnmpad ${size} -white ${infile} | ckfmt
 pnmpad ${size} -extend-edge ${infile} | ckfmt
 pnmpad ${size} -detect-background ${infile} | ckfmt
 
-pnmpad ${size} -color ${BLACK} ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote format ${infile} | ckfmt
+pnmpad ${size} -color black ${infile} | ckfmt
+pnmpad ${size} -color black -promote none   ${infile} | ckfmt
+pnmpad ${size} -color black -promote format ${infile} | ckfmt
 
-pnmpad ${size} -color ${WHITE} ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color white ${infile} | ckfmt
+pnmpad ${size} -color white -promote none   ${infile} | ckfmt
+pnmpad ${size} -color white -promote format ${infile} | ckfmt
 
 pnmpad ${size} -color ${LIGHTGRAY} -promote none ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote none ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE}   -promote none ${infile} | ckfmt
+pnmpad ${size} -color purple   -promote none ${infile} | ckfmt
 
 echo "Should print: PGM raw, 8 by 1  maxval 1 twice"
 
@@ -70,12 +68,12 @@ pnmpad ${size} -color ${DARKGRAY} ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 1 once"
 
-pnmpad ${size} -color ${PURPLE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color purple -promote format ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 255 twice"
 
-pnmpad ${size} -color ${PURPLE} ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote all ${infile} | ckfmt
+pnmpad ${size} -color purple ${infile} | ckfmt
+pnmpad ${size} -color purple -promote all ${infile} | ckfmt
 
 rm ${infile}
 
@@ -92,13 +90,13 @@ pnmpad ${size} -white ${infile} | ckfmt
 pnmpad ${size} -extend-edge ${infile} | ckfmt
 pnmpad ${size} -detect-background ${infile} | ckfmt
 
-pnmpad ${size} -color ${BLACK} ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote format ${infile} | ckfmt
+pnmpad ${size} -color black ${infile} | ckfmt
+pnmpad ${size} -color black -promote none   ${infile} | ckfmt
+pnmpad ${size} -color black -promote format ${infile} | ckfmt
 
-pnmpad ${size} -color ${WHITE} ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color white ${infile} | ckfmt
+pnmpad ${size} -color white -promote none   ${infile} | ckfmt
+pnmpad ${size} -color white -promote format ${infile} | ckfmt
 
 pnmpad ${size} -color ${LIGHTGRAY} -promote none ${infile} | ckfmt
 pnmpad ${size} -color ${LIGHTGRAY} -promote format ${infile} | ckfmt
@@ -106,7 +104,7 @@ pnmpad ${size} -color ${LIGHTGRAY} -promote format ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote none ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote format ${infile} | ckfmt
 
-pnmpad ${size} -color ${PURPLE}   -promote none ${infile} | ckfmt
+pnmpad ${size} -color purple   -promote none ${infile} | ckfmt
 
 echo "Should print: PGM raw, 8 by 1  maxval 255 four times"
 
@@ -117,12 +115,12 @@ pnmpad ${size} -color ${DARKGRAY}  -promote all ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 127 once"
 
-pnmpad ${size} -color ${PURPLE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color purple -promote format ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 255 twice"
 
-pnmpad ${size} -color ${PURPLE} ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote all ${infile} | ckfmt
+pnmpad ${size} -color purple ${infile} | ckfmt
+pnmpad ${size} -color purple -promote all ${infile} | ckfmt
 
 rm ${infile}
 
@@ -139,10 +137,10 @@ pnmpad ${size} -white ${infile} | ckfmt
 pnmpad ${size} -extend-edge ${infile} | ckfmt
 pnmpad ${size} -detect-background ${infile} | ckfmt
 
-pnmpad ${size} -color ${BLACK} ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote all    ${infile} | ckfmt
+pnmpad ${size} -color black ${infile} | ckfmt
+pnmpad ${size} -color black -promote none   ${infile} | ckfmt
+pnmpad ${size} -color black -promote format ${infile} | ckfmt
+pnmpad ${size} -color black -promote all    ${infile} | ckfmt
 
 pnmpad ${size} -color ${LIGHTGRAY} ${infile} | ckfmt
 pnmpad ${size} -color ${LIGHTGRAY} -promote none   ${infile} | ckfmt
@@ -155,14 +153,14 @@ pnmpad ${size} -color ${DARKGRAY} -promote none   ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote format ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote all    ${infile} | ckfmt
 
-pnmpad ${size} -color ${PURPLE}   -promote none   ${infile} | ckfmt
+pnmpad ${size} -color purple   -promote none   ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 255 three times"
 
-pnmpad ${size} -color ${PURPLE} ${infile} | ckfmt
+pnmpad ${size} -color purple ${infile} | ckfmt
 
-pnmpad ${size} -color ${PURPLE} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote all    ${infile} | ckfmt
+pnmpad ${size} -color purple -promote format ${infile} | ckfmt
+pnmpad ${size} -color purple -promote all    ${infile} | ckfmt
 
 rm ${infile}
 
@@ -179,28 +177,28 @@ pnmpad ${size} -white ${infile} | ckfmt
 pnmpad ${size} -extend-edge ${infile} | ckfmt
 pnmpad ${size} -detect-background ${infile} | ckfmt
 
-pnmpad ${size} -color ${BLACK} ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color black ${infile} | ckfmt
+pnmpad ${size} -color black -promote none   ${infile} | ckfmt
+pnmpad ${size} -color black -promote format ${infile} | ckfmt
+pnmpad ${size} -color white ${infile} | ckfmt
+pnmpad ${size} -color white -promote none   ${infile} | ckfmt
+pnmpad ${size} -color white -promote format ${infile} | ckfmt
 
 pnmpad ${size} -color ${LIGHTGRAY} -promote none   ${infile} | ckfmt
 pnmpad ${size} -color ${LIGHTGRAY} -promote format ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote none   ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote format ${infile} | ckfmt
 
-pnmpad ${size} -color ${PURPLE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote format ${infile} | ckfmt
+pnmpad ${size} -color purple -promote none   ${infile} | ckfmt
+pnmpad ${size} -color purple -promote format ${infile} | ckfmt
 
 echo "Should print: PPM raw, 8 by 1  maxval 255 five times"
 
 pnmpad ${size} -color ${LIGHTGRAY} ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY}  ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE}    ${infile} | ckfmt
+pnmpad ${size} -color purple    ${infile} | ckfmt
 pnmpad ${size} -color ${LIGHTGRAY} -promote all ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE}    -promote all ${infile} | ckfmt
+pnmpad ${size} -color purple    -promote all ${infile} | ckfmt
 
 rm ${infile}
 
@@ -217,15 +215,15 @@ pnmpad ${size} -white ${infile} | ckfmt
 pnmpad ${size} -extend-edge ${infile} | ckfmt
 pnmpad ${size} -detect-background ${infile} | ckfmt
 
-pnmpad ${size} -color ${BLACK} ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${BLACK} -promote all    ${infile} | ckfmt
+pnmpad ${size} -color black ${infile} | ckfmt
+pnmpad ${size} -color black -promote none   ${infile} | ckfmt
+pnmpad ${size} -color black -promote format ${infile} | ckfmt
+pnmpad ${size} -color black -promote all    ${infile} | ckfmt
 
-pnmpad ${size} -color ${WHITE} ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${WHITE} -promote all    ${infile} | ckfmt
+pnmpad ${size} -color white ${infile} | ckfmt
+pnmpad ${size} -color white -promote none   ${infile} | ckfmt
+pnmpad ${size} -color white -promote format ${infile} | ckfmt
+pnmpad ${size} -color white -promote all    ${infile} | ckfmt
 
 pnmpad ${size} -color ${LIGHTGRAY} ${infile} | ckfmt
 pnmpad ${size} -color ${LIGHTGRAY} -promote none   ${infile} | ckfmt
@@ -237,9 +235,9 @@ pnmpad ${size} -color ${DARKGRAY} -promote none   ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote format ${infile} | ckfmt
 pnmpad ${size} -color ${DARKGRAY} -promote all    ${infile} | ckfmt
 
-pnmpad ${size} -color ${PURPLE} ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote none   ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote format ${infile} | ckfmt
-pnmpad ${size} -color ${PURPLE} -promote all    ${infile} | ckfmt
+pnmpad ${size} -color purple ${infile} | ckfmt
+pnmpad ${size} -color purple -promote none   ${infile} | ckfmt
+pnmpad ${size} -color purple -promote format ${infile} | ckfmt
+pnmpad ${size} -color purple -promote all    ${infile} | ckfmt
 
 rm ${infile}
diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test
index 6ea05aed..e1d9d4f0 100755
--- a/test/pnmpsnr.test
+++ b/test/pnmpsnr.test
@@ -27,7 +27,7 @@ pnmpsnr  testimg.ppm  testimg.ppm -target1=1000 -target2=1000 -target3=1000
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pnmpsnr ${b_pbm} ${w_pbm} ${b_pbm}    "
 invCmd "pnmpsnr ${b_pbm}                      "
diff --git a/test/pnmtile.test b/test/pnmtile.test
index 35addbec..93f45f60 100755
--- a/test/pnmtile.test
+++ b/test/pnmtile.test
@@ -21,7 +21,7 @@ echo ${PIPESTATUS[@]} ":" $?
 
 rm ${testimg2_ppm} ${testimg4_ppm}
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pnmtile 100 testgrid.pbm"
 invCmd "pnmtile 100 0 testgrid.pbm"
diff --git a/test/ppmbrighten.test b/test/ppmbrighten.test
index 8ae1d744..45b60ae5 100755
--- a/test/ppmbrighten.test
+++ b/test/ppmbrighten.test
@@ -23,7 +23,7 @@ ppmbrighten -v 100 -normalize testimg.ppm | pamsumm --mean | \
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "pambrighten -v -120 testimg.ppm"
 invCmd "pambrighten -s -120 testimg.ppm"
diff --git a/test/ppmchange.test b/test/ppmchange.test
index a579631b..039a4a81 100755
--- a/test/ppmchange.test
+++ b/test/ppmchange.test
@@ -2,45 +2,38 @@
 # This script tests: ppmchange
 # Also requires: ppmrainbow pgmramp ppmhist
 
-
 #  Failure message
 ## If this test fails and ppmchange-roundtrip.test succeeds,
 ## the probable cause is a problem with one of the options of
 ## ppmchange: -closeness or -remainder.
 
 tmpdir=${tmpdir:-/tmp}
-rainbow_ppm=${tmpdir}/rainbow.ppm
-changed_ppm=${tmpdir}/changed.ppm
+rainbow_ppm="${tmpdir}"/rainbow.ppm
+changed_ppm="${tmpdir}"/changed.ppm
 
-# Explicit values for intermediate colors: rgb.txt may not be the one
-# Netpbm provides; they may be defined in unusual ways.
+RGBDEF=./rgbt.txt
 
-brown=rgb:67/43/00
-cyan=rgb:00/ff/ff
-yellow=rgb:ff/ff/00
 gray=rgb:7f/7f/7f
 
-
 # Test 1. Should print 22488533 203
-pgmramp -lr 8 8 | ppmchange black black  white white  $gray $gray \
+pgmramp -lr 8 8 | ppmchange black black  white white ${gray} ${gray} \
   -close=10 -remainder=blue | cksum
 
 
 # Test 2. Should print 1008787190 613
 
-ppmrainbow -tmpdir=$tmpdir -width=200 -height=1 red green blue | \
+ppmrainbow -tmpdir="${tmpdir}" -width=200 -height=1 red green blue | \
   tee ${rainbow_ppm} | \
-  ppmchange red $brown   green $brown   blue $brown | cksum
+  ppmchange red brown   green brown   blue brown | cksum
 
 # Validate ${rainbow_ppm}
 # Should print 1983174784 613
 
 cat ${rainbow_ppm} | cksum
 
-
 # Test 3. Should print 2146447222 613
 
-ppmchange red $brown   green $cyan   blue $yellow \
+ppmchange red brown   green cyan   blue yellow \
   -closeness=25 ${rainbow_ppm} | cksum
 
 
diff --git a/test/ppmforge-parameters.test b/test/ppmforge-parameters.test
index 0525e7af..5a5b4be9 100755
--- a/test/ppmforge-parameters.test
+++ b/test/ppmforge-parameters.test
@@ -24,7 +24,7 @@ echo "Test Invalid"
 tmpdir=${tmpdir:-/tmp}
 test_out=${tmpdir}/test_out
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "ppmforge -seed=0 -night -dimension=0"
 invCmd "ppmforge -seed=0 -dimension=10"
diff --git a/test/ppmhist.test b/test/ppmhist.test
index 1e814eb7..bc2cfc02 100755
--- a/test/ppmhist.test
+++ b/test/ppmhist.test
@@ -27,7 +27,7 @@ ppmpat -madras --color=rgb:00/00/00,rgb:31/58/a3,rgb:ff/ff/ff 25 25 | \
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "ppmhist -hexcolor -float testimg.ppm"
 invCmd "ppmhist -hexcolor -map   testimg.ppm"
diff --git a/test/ppmmake.test b/test/ppmmake.test
index 295e0bf4..35275110 100755
--- a/test/ppmmake.test
+++ b/test/ppmmake.test
@@ -12,7 +12,7 @@ ppmmake red 50 50  | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "ppmmake rgb:gg/00/00  2 2"
 invCmd "ppmmake rgb:ff/ff/00  2"
diff --git a/test/ppmpat.test b/test/ppmpat.test
index 00f8421e..acc44bdb 100755
--- a/test/ppmpat.test
+++ b/test/ppmpat.test
@@ -41,7 +41,7 @@ ppmpat -argyle2 --color=rgb:00/00/00,rgb:ff/80/80,rgb:e0/e0/e0 12 18 | cksum
 
 echo "Test Invalid"
 
-. ${srcdir}/test-invalid.inc
+. ./test-invalid.inc
 
 invCmd "ppmpat -g2 -g3 10 10"
 invCmd "ppmpat -madras -tartan 10 10"
diff --git a/test/rgbt.txt b/test/rgbt.txt
new file mode 100644
index 00000000..96145e00
--- /dev/null
+++ b/test/rgbt.txt
@@ -0,0 +1,16 @@
+# This is a small color name dictionary file for test purposes.
+# Values extracted from lib/rgb.txt .
+  0   0   0 Black
+255 255 255 White
+255   0   0 Red
+  0 255   0 Green
+  0   0 255 Blue
+  0 255 255 Cyan
+255   0 255 Magenta  
+255 255   0 Yellow
+255 138   0 Orange
+160  32 240 Purple
+103  67   0 Brown
+128 128 128 Gray
+
+