diff options
Diffstat (limited to 'test')
90 files changed, 749 insertions, 350 deletions
diff --git a/test/411toppm.test b/test/411toppm.test index ce374f29..335cdcc8 100755 --- a/test/411toppm.test +++ b/test/411toppm.test @@ -2,6 +2,9 @@ # This script tests: 411toppm # Also requires: + alias 411toppm="${PBM_TESTPREFIX}411toppm" + shopt -s expand_aliases + # Test 1. should produce: 240376509 9229 # The above value is what 411toppm has been always producing. # 411toppm's author Steve Allen says he was not able to obtain accurate @@ -9,4 +12,4 @@ # # See comment at head of source file 411toppm.c. -head -c 4608 /dev/zero | ${PBM_TESTPREFIX}411toppm -quiet | cksum +head -c 4608 /dev/zero | 411toppm -quiet | cksum diff --git a/test/atk-roundtrip.test b/test/atk-roundtrip.test index f64b0c3c..3d15eec4 100755 --- a/test/atk-roundtrip.test +++ b/test/atk-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtoatk atktopbm # Also requires: + alias atktopbm="${PBM_TESTPREFIX}atktopbm" + alias pbmtoatk="${PBM_TESTPREFIX}pbmtoatk" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtoatk testgrid.pbm | ${PBM_TESTPREFIX}atktopbm | cksum +pbmtoatk testgrid.pbm | atktopbm | cksum diff --git a/test/avs-roundtrip.test b/test/avs-roundtrip.test index 33f9e581..44b4d8a4 100755 --- a/test/avs-roundtrip.test +++ b/test/avs-roundtrip.test @@ -2,6 +2,11 @@ # This script tests: pamtoavs avstopam # Also requires: pamtopnm + alias avstopam="${PBM_TESTPREFIX}avstopam" + alias pamtoavs="${PBM_TESTPREFIX}pamtoavs" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + shopt -s expand_aliases + # Should produce 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pamtoavs testimg.ppm | \ - ${PBM_TESTPREFIX}avstopam | ${PBM_BINPREFIX}pamtopnm | cksum +pamtoavs testimg.ppm | \ + avstopam | pamtopnm | cksum diff --git a/test/bmp-roundtrip.test b/test/bmp-roundtrip.test index af0e6948..291f2669 100755 --- a/test/bmp-roundtrip.test +++ b/test/bmp-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: bmptopnm ppmtobmp # Also requires: -${PBM_TESTPREFIX}ppmtobmp testimg.ppm | ${PBM_TESTPREFIX}bmptopnm | cksum -${PBM_TESTPREFIX}ppmtobmp testgrid.pbm | ${PBM_TESTPREFIX}bmptopnm | cksum \ No newline at end of file + alias bmptopnm="${PBM_TESTPREFIX}bmptopnm" + alias ppmtobmp="${PBM_TESTPREFIX}ppmtobmp" + shopt -s expand_aliases + +ppmtobmp testimg.ppm | bmptopnm | cksum +ppmtobmp testgrid.pbm | bmptopnm | cksum diff --git a/test/cmuw-roundtrip.test b/test/cmuw-roundtrip.test index 85de9706..ebb5eecf 100755 --- a/test/cmuw-roundtrip.test +++ b/test/cmuw-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtocmuwm cmuwmtopbm # Also requires: + alias cmuwmtopbm="${PBM_TESTPREFIX}cmuwmtopbm" + alias pbmtocmuwm="${PBM_TESTPREFIX}pbmtocmuwm" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtocmuwm testgrid.pbm | ${PBM_TESTPREFIX}cmuwmtopbm | cksum +pbmtocmuwm testgrid.pbm | cmuwmtopbm | cksum diff --git a/test/cut-paste-roundtrip.test b/test/cut-paste-roundtrip.test index d5d5989f..15e53219 100755 --- a/test/cut-paste-roundtrip.test +++ b/test/cut-paste-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pamcut pnmpaste # Also requires: -${PBM_TESTPREFIX}pamcut 50 40 100 70 testimg.ppm | \ -${PBM_TESTPREFIX}pnmpaste -replace - 50 40 testimg.ppm | cksum + alias pamcut="${PBM_TESTPREFIX}pamcut" + alias pnmpaste="${PBM_TESTPREFIX}pnmpaste" + shopt -s expand_aliases + +pamcut 50 40 100 70 testimg.ppm | \ +pnmpaste -replace - 50 40 testimg.ppm | cksum diff --git a/test/eyuvtoppm.test b/test/eyuvtoppm.test index 5009d3ba..79c30237 100755 --- a/test/eyuvtoppm.test +++ b/test/eyuvtoppm.test @@ -2,6 +2,9 @@ # This script tests: eyuvtoppm # Also requires: + alias eyuvtoppm="${PBM_TESTPREFIX}eyuvtoppm" + shopt -s expand_aliases + # Should produce 1719878124 253455 -head -c 126720 /dev/zero | ${PBM_TESTPREFIX}eyuvtoppm -quiet | cksum +head -c 126720 /dev/zero | eyuvtoppm -quiet | cksum diff --git a/test/facesaver-roundtrip.test b/test/facesaver-roundtrip.test index 410ba897..362edaf5 100755 --- a/test/facesaver-roundtrip.test +++ b/test/facesaver-roundtrip.test @@ -2,7 +2,12 @@ # This script tests: pgmtofs fstopgm # Also requires: ppmtopgm + alias fstopgm="${PBM_TESTPREFIX}fstopgm" + alias pgmtofs="${PBM_TESTPREFIX}pgmtofs" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Should produce 2871603838 33838, cksum of testimg.pgm -${PBM_BINPREFIX}ppmtopgm testimg.ppm | \ - ${PBM_TESTPREFIX}pgmtofs | ${PBM_TESTPREFIX}fstopgm | cksum \ No newline at end of file +ppmtopgm testimg.ppm | \ + pgmtofs | fstopgm | cksum diff --git a/test/fits-roundtrip.test b/test/fits-roundtrip.test index 0c244c5a..65589823 100755 --- a/test/fits-roundtrip.test +++ b/test/fits-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pamtofits fitstopnm # Also requires: + alias fitstopnm="${PBM_TESTPREFIX}fitstopnm" + alias pamtofits="${PBM_TESTPREFIX}pamtofits" + shopt -s expand_aliases + # Should produce 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pamtofits testimg.ppm | ${PBM_TESTPREFIX}fitstopnm | cksum +pamtofits testimg.ppm | fitstopnm | cksum diff --git a/test/g3-roundtrip.test b/test/g3-roundtrip.test index e00997f6..323a26bf 100755 --- a/test/g3-roundtrip.test +++ b/test/g3-roundtrip.test @@ -2,14 +2,19 @@ # This script tests: g3topbm pbmtog3 # Also requires: pnmcrop -${PBM_TESTPREFIX}pbmtog3 -nofixedwidth testgrid.pbm | \ -${PBM_TESTPREFIX}g3topbm -width=14 | cmp -s - testgrid.pbm + alias g3topbm="${PBM_TESTPREFIX}g3topbm" + alias pbmtog3="${PBM_TESTPREFIX}pbmtog3" + alias pnmcrop="${PBM_BINPREFIX}pnmcrop" + shopt -s expand_aliases + +pbmtog3 -nofixedwidth testgrid.pbm | \ +g3topbm -width=14 | cmp -s - testgrid.pbm echo $? -${PBM_TESTPREFIX}pbmtog3 -nofixedwidth -reversebits testgrid.pbm | \ -${PBM_TESTPREFIX}g3topbm -width=14 -reversebits | cmp -s - testgrid.pbm +pbmtog3 -nofixedwidth -reversebits testgrid.pbm | \ +g3topbm -width=14 -reversebits | cmp -s - testgrid.pbm echo $? -${PBM_TESTPREFIX}pbmtog3 testgrid.pbm | \ -${PBM_TESTPREFIX}g3topbm | ${PBM_BINPREFIX}pnmcrop -white -right -bottom | \ +pbmtog3 testgrid.pbm | \ +g3topbm | pnmcrop -white -right -bottom | \ cmp -s - testgrid.pbm ; echo $? diff --git a/test/gem-roundtrip.test b/test/gem-roundtrip.test index 05f1d28c..97f894c2 100755 --- a/test/gem-roundtrip.test +++ b/test/gem-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtogem gemtopbm # Also requires: gemtopnm + alias gemtopbm="${PBM_TESTPREFIX}gemtopbm" + alias pbmtogem="${PBM_TESTPREFIX}pbmtogem" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtogem testgrid.pbm | ${PBM_TESTPREFIX}gemtopbm | cksum +pbmtogem testgrid.pbm | gemtopbm | cksum diff --git a/test/gif-quant-roundtrip.test b/test/gif-quant-roundtrip.test index 5e093b29..b5f69edd 100755 --- a/test/gif-quant-roundtrip.test +++ b/test/gif-quant-roundtrip.test @@ -2,12 +2,17 @@ # This script tests: giftopnm pamtogif pnmquant # Also requires: pnmcolormap pnmremap + alias giftopnm="${PBM_TESTPREFIX}giftopnm" + alias pamtogif="${PBM_TESTPREFIX}pamtogif" + alias pnmquant="${PBM_TESTPREFIX}pnmquant" + shopt -s expand_aliases + # Should print 0 colors=15 # any value between 2 - 256 works -${PBM_TESTPREFIX}pnmquant $colors testimg.ppm > ${tmpdir}/quant.ppm && -${PBM_TESTPREFIX}pamtogif ${tmpdir}/quant.ppm | ${PBM_TESTPREFIX}giftopnm | \ +pnmquant $colors testimg.ppm > ${tmpdir}/quant.ppm && +pamtogif ${tmpdir}/quant.ppm | giftopnm | \ cmp -s - ${tmpdir}/quant.ppm > /dev/null echo $? diff --git a/test/gif-roundtrip.test b/test/gif-roundtrip.test index a32d574a..709edbb6 100755 --- a/test/gif-roundtrip.test +++ b/test/gif-roundtrip.test @@ -2,11 +2,19 @@ # This script tests: giftopnm pamtogif # Also requires: ppmtopgm ppmtorgb3 rgb3toppm pbmmake + alias giftopnm="${PBM_TESTPREFIX}giftopnm" + alias pamtogif="${PBM_TESTPREFIX}pamtogif" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + alias ppmtorgb3="${PBM_BINPREFIX}ppmtorgb3" + alias rgb3toppm="${PBM_BINPREFIX}rgb3toppm" + shopt -s expand_aliases + # Test 1. Should produce 2871603838 33838 # which is the result of ppmtopgm testimg.ppm | cksum -${PBM_BINPREFIX}ppmtopgm testimg.ppm | \ - ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm | cksum +ppmtopgm testimg.ppm | \ + pamtogif | giftopnm | cksum # Test 2. Break up input image into three monochrome planes, # maxval 255. Transform each plane to gif and back to pgm. @@ -14,26 +22,26 @@ ${PBM_BINPREFIX}ppmtopgm testimg.ppm | \ # Should print 1926073387 101484 cp testimg.ppm ${tmpdir} && -${PBM_BINPREFIX}ppmtorgb3 ${tmpdir}/testimg.ppm && -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.red | \ - ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.red && -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.grn | - ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.grn && -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.blu | \ - ${PBM_TESTPREFIX}giftopnm | \ - ${PBM_BINPREFIX}rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \ +ppmtorgb3 ${tmpdir}/testimg.ppm && +pamtogif ${tmpdir}/testimg.red | \ + giftopnm > ${tmpdir}/out.red && +pamtogif ${tmpdir}/testimg.grn | + giftopnm > ${tmpdir}/out.grn && +pamtogif ${tmpdir}/testimg.blu | \ + giftopnm | \ + rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \ cksum rm ${tmpdir}/testimg.{ppm,red,grn,blu} ${tmpdir}/out.{red,grn} # Test 3. Should produce 2425386270 41 -${PBM_TESTPREFIX}pamtogif testgrid.pbm | ${PBM_TESTPREFIX}giftopnm | cksum +pamtogif testgrid.pbm | giftopnm | cksum # Test 4. # In this gif file the code length changes after the last image data. # Image data: 3 bits, end code 4 bits. # Should produce P1 4 1 0 1 0 1 -${PBM_BINPREFIX}pbmmake -g 4 1 | \ - ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm -plain | \ +pbmmake -g 4 1 | \ + pamtogif | giftopnm -plain | \ tr '\n' ' ' diff --git a/test/hdiff-roundtrip.test b/test/hdiff-roundtrip.test index dbe74701..3a27a955 100755 --- a/test/hdiff-roundtrip.test +++ b/test/hdiff-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: hdifftopam pamtohdiff # Also requires: -${PBM_TESTPREFIX}pamtohdiff testimg.ppm | \ - ${PBM_TESTPREFIX}hdifftopam -pnm | cksum \ No newline at end of file + alias hdifftopam="${PBM_TESTPREFIX}hdifftopam" + alias pamtohdiff="${PBM_TESTPREFIX}pamtohdiff" + shopt -s expand_aliases + +pamtohdiff testimg.ppm | \ + hdifftopam -pnm | cksum diff --git a/test/leaf-roundtrip.test b/test/leaf-roundtrip.test index 6fb7547c..f8ac11d4 100755 --- a/test/leaf-roundtrip.test +++ b/test/leaf-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: ppmtoleaf leaftoppm # Also requires: + alias leaftoppm="${PBM_TESTPREFIX}leaftoppm" + alias ppmtoleaf="${PBM_TESTPREFIX}ppmtoleaf" + shopt -s expand_aliases + # Should produce 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}ppmtoleaf testimg.ppm | ${PBM_TESTPREFIX}leaftoppm | cksum +ppmtoleaf testimg.ppm | leaftoppm | cksum diff --git a/test/mgr-roundtrip.test b/test/mgr-roundtrip.test index 2ca3d4b3..4f5fdd81 100755 --- a/test/mgr-roundtrip.test +++ b/test/mgr-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtomgr mgrtopbm # Also requires: + alias mgrtopbm="${PBM_TESTPREFIX}mgrtopbm" + alias pbmtomgr="${PBM_TESTPREFIX}pbmtomgr" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtomgr testgrid.pbm | ${PBM_TESTPREFIX}mgrtopbm | cksum +pbmtomgr testgrid.pbm | mgrtopbm | cksum diff --git a/test/mrf-roundtrip.test b/test/mrf-roundtrip.test index 80dca546..5b9f77f4 100755 --- a/test/mrf-roundtrip.test +++ b/test/mrf-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtomrf mrftopbm # Also requires: + alias mrftopbm="${PBM_TESTPREFIX}mrftopbm" + alias pbmtomrf="${PBM_TESTPREFIX}pbmtomrf" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtomrf testgrid.pbm | ${PBM_TESTPREFIX}mrftopbm | cksum +pbmtomrf testgrid.pbm | mrftopbm | cksum diff --git a/test/pad-crop-roundtrip.test b/test/pad-crop-roundtrip.test index 2b3c777b..ae19f7d5 100755 --- a/test/pad-crop-roundtrip.test +++ b/test/pad-crop-roundtrip.test @@ -2,7 +2,11 @@ # This script tests: pnmcrop pnmmargin # Also requires: pnmpad -${PBM_TESTPREFIX}pnmmargin -white 10 testimg.ppm | \ - ${PBM_TESTPREFIX}pnmcrop | cksum -${PBM_TESTPREFIX}pnmmargin -white 10 testgrid.pbm | \ - ${PBM_TESTPREFIX}pnmcrop | cksum + alias pnmcrop="${PBM_TESTPREFIX}pnmcrop" + alias pnmmargin="${PBM_TESTPREFIX}pnmmargin" + shopt -s expand_aliases + +pnmmargin -white 10 testimg.ppm | \ + pnmcrop | cksum +pnmmargin -white 10 testgrid.pbm | \ + pnmcrop | cksum diff --git a/test/pamchannel.test b/test/pamchannel.test index f83dd3b6..e3da552c 100755 --- a/test/pamchannel.test +++ b/test/pamchannel.test @@ -2,6 +2,10 @@ # This script tests: pamchannel # Also requires: pamtopnm + alias pamchannel="${PBM_TESTPREFIX}pamchannel" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + shopt -s expand_aliases + # Extract planes one by one. # Convert output to pgm to make it identical to ppmtorgb3 output. @@ -16,17 +20,17 @@ # Test 1. red channel # Should produce 1571496937 33838 -${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 0 | \ - ${PBM_BINPREFIX}pamtopnm --assume | cksum +pamchannel -infile testimg.ppm 0 | \ + pamtopnm --assume | cksum # Test 2. green channel # Should produce 394856971 33838 -${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 1 | \ - ${PBM_BINPREFIX}pamtopnm --assume | cksum +pamchannel -infile testimg.ppm 1 | \ + pamtopnm --assume | cksum # Test 3. blue channel # Should produce 3164158573 33838 -${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 2 | \ - ${PBM_BINPREFIX}pamtopnm --assume | cksum +pamchannel -infile testimg.ppm 2 | \ + pamtopnm --assume | cksum diff --git a/test/pamcut.test b/test/pamcut.test index 080bcad8..5a94de46 100755 --- a/test/pamcut.test +++ b/test/pamcut.test @@ -2,13 +2,17 @@ # This script tests: pamcut pbmmake # Also requires: + alias pamcut="${PBM_TESTPREFIX}pamcut" + alias pbmmake="${PBM_TESTPREFIX}pbmmake" + shopt -s expand_aliases + # Test 1. Should print 2958909756 124815 -${PBM_TESTPREFIX}pamcut -top 0 -left 0 -width 260 -height 160 \ +pamcut -top 0 -left 0 -width 260 -height 160 \ -pad testimg.ppm | cksum # Test 2. Should print 1550940962 10933 -${PBM_TESTPREFIX}pamcut -top 200 -left 120 -width 40 -height 40 \ +pamcut -top 200 -left 120 -width 40 -height 40 \ -pad testimg.ppm | cksum # Test 3. Should print 708474423 14 -${PBM_TESTPREFIX}pamcut -top 5 -left 5 -bottom 5 -right 5 testimg.ppm | cksum +pamcut -top 5 -left 5 -bottom 5 -right 5 testimg.ppm | cksum # Test 3. Should print 3412257956 129 -${PBM_TESTPREFIX}pbmmake -g 50 50 | ${PBM_TESTPREFIX}pamcut 5 5 30 30 | cksum +pbmmake -g 50 50 | pamcut 5 5 30 30 | cksum diff --git a/test/pamdepth-roundtrip.test b/test/pamdepth-roundtrip.test index 2795d659..6330aaf9 100755 --- a/test/pamdepth-roundtrip.test +++ b/test/pamdepth-roundtrip.test @@ -2,11 +2,15 @@ # This script tests: pamdepth pgmtopbm # Also requires: + alias pamdepth="${PBM_TESTPREFIX}pamdepth" + alias pgmtopbm="${PBM_TESTPREFIX}pgmtopbm" + shopt -s expand_aliases + for i in 300 500 1023 4095 5000 16383 65535 do -${PBM_TESTPREFIX}pamdepth $i testimg.ppm | \ - ${PBM_TESTPREFIX}pamdepth 255 | cksum +pamdepth $i testimg.ppm | \ + pamdepth 255 | cksum done -${PBM_TESTPREFIX}pamdepth 255 testgrid.pbm | ${PBM_TESTPREFIX}pamdepth 1 | \ - ${PBM_TESTPREFIX}pgmtopbm -th -val=0.5 | cksum +pamdepth 255 testgrid.pbm | pamdepth 1 | \ + pgmtopbm -th -val=0.5 | cksum diff --git a/test/pamdice-roundtrip.test b/test/pamdice-roundtrip.test index 06fef8b2..7319249a 100755 --- a/test/pamdice-roundtrip.test +++ b/test/pamdice-roundtrip.test @@ -2,8 +2,12 @@ # This script tests: pamdice pamundice # Also requires: -${PBM_TESTPREFIX}pamdice testimg.ppm -outstem=${tmpdir}/a -width=50 -height=40 -${PBM_TESTPREFIX}pamundice ${tmpdir}/a_%1d_%1a.ppm -down=4 -across=5 | cksum + alias pamdice="${PBM_TESTPREFIX}pamdice" + alias pamundice="${PBM_TESTPREFIX}pamundice" + shopt -s expand_aliases + +pamdice testimg.ppm -outstem=${tmpdir}/a -width=50 -height=40 +pamundice ${tmpdir}/a_%1d_%1a.ppm -down=4 -across=5 | cksum rm ${tmpdir}/a_?_?.ppm diff --git a/test/pamditherbw.test b/test/pamditherbw.test index 5335f12d..fef71efa 100755 --- a/test/pamditherbw.test +++ b/test/pamditherbw.test @@ -2,30 +2,34 @@ # This script tests: pamditherbw # Also requires: ppmtopgm + alias pamditherbw="${PBM_TESTPREFIX}pamditherbw" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Make test input -${PBM_BINPREFIX}ppmtopgm testimg.ppm >${tmpdir}/testimg.pgm +ppmtopgm testimg.ppm >${tmpdir}/testimg.pgm # Test 1. Simple threshold -${PBM_TESTPREFIX}pamditherbw -threshold -val=0.5 \ +pamditherbw -threshold -val=0.5 \ ${tmpdir}/testimg.pgm | cksum # Test 2. Floyd-Steinberg -#${PBM_TESTPREFIX}pamditherbw -floyd -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -floyd -val=0.5 ${tmpdir}/testimg.pgm | cksum # Test 3. Atkinson -#${PBM_TESTPREFIX}pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum # Test 4. Hilbert -${PBM_TESTPREFIX}pamditherbw -hilbert ${tmpdir}/testimg.pgm | cksum +pamditherbw -hilbert ${tmpdir}/testimg.pgm | cksum # Test 5. Dither-8 -${PBM_TESTPREFIX}pamditherbw -dither8 ${tmpdir}/testimg.pgm | cksum +pamditherbw -dither8 ${tmpdir}/testimg.pgm | cksum # Test 6. Cluster4 -${PBM_TESTPREFIX}pamditherbw -cluster4 ${tmpdir}/testimg.pgm | cksum +pamditherbw -cluster4 ${tmpdir}/testimg.pgm | cksum # Test 7. Atkinson -#${PBM_TESTPREFIX}pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum # Remove test file rm ${tmpdir}/testimg.pgm diff --git a/test/pamedge.test b/test/pamedge.test index da1c0145..d230424b 100755 --- a/test/pamedge.test +++ b/test/pamedge.test @@ -2,6 +2,14 @@ # This script tests: pamedge # Also requires: pbmpscale pbmtext pgmtopbm pgmtopgm ppmtopgm -${PBM_BINPREFIX}pbmtext " F " -nom | ${PBM_BINPREFIX}pbmpscale 5 | \ -${PBM_BINPREFIX}pgmtopgm | ${PBM_TESTPREFIX}pamedge | \ -${PBM_BINPREFIX}ppmtopgm | ${PBM_BINPREFIX}pgmtopbm -th -val=.5 -plain + alias pamedge="${PBM_TESTPREFIX}pamedge" + alias pbmpscale="${PBM_BINPREFIX}pbmpscale" + alias pbmtext="${PBM_BINPREFIX}pbmtext" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias pgmtopgm="${PBM_BINPREFIX}pgmtopgm" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + +pbmtext " F " -nom | pbmpscale 5 | \ +pgmtopgm | pamedge | \ +ppmtopgm | pgmtopbm -th -val=.5 -plain diff --git a/test/pamenlarge.test b/test/pamenlarge.test index c3efc4b2..c1958d14 100755 --- a/test/pamenlarge.test +++ b/test/pamenlarge.test @@ -2,11 +2,15 @@ # This script tests: pamenlarge # Also requires: ppmtopgm + alias pamenlarge="${PBM_TESTPREFIX}pamenlarge" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Test 1. Should print 3424505894 913236 -${PBM_TESTPREFIX}pamenlarge 3 testimg.ppm | cksum +pamenlarge 3 testimg.ppm | cksum # Test 2. Should print 4152147096 304422 -${PBM_BINPREFIX}ppmtopgm testimg.ppm | ${PBM_TESTPREFIX}pamenlarge 3 | cksum +ppmtopgm testimg.ppm | pamenlarge 3 | cksum # Test 3. Should print 3342398172 297 -${PBM_TESTPREFIX}pamenlarge 3 testgrid.pbm | cksum +pamenlarge 3 testgrid.pbm | cksum # Test 4. Should print 237488670 3133413 -${PBM_TESTPREFIX}pamenlarge 3 -plain testimg.ppm | cksum +pamenlarge 3 -plain testimg.ppm | cksum diff --git a/test/pamfile.test b/test/pamfile.test index 36ee557c..689578f1 100755 --- a/test/pamfile.test +++ b/test/pamfile.test @@ -2,6 +2,10 @@ # This script tests: pamfile # Also requires: ppmtopgm -${PBM_TESTPREFIX}pamfile testimg.ppm -${PBM_TESTPREFIX}pamfile testgrid.pbm -${PBM_BINPREFIX}ppmtopgm testimg.ppm | ${PBM_TESTPREFIX}pamfile + alias pamfile="${PBM_TESTPREFIX}pamfile" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + +pamfile testimg.ppm +pamfile testgrid.pbm +ppmtopgm testimg.ppm | pamfile diff --git a/test/pamflip-roundtrip.test b/test/pamflip-roundtrip.test index 7a17359f..2b18eb8d 100755 --- a/test/pamflip-roundtrip.test +++ b/test/pamflip-roundtrip.test @@ -2,33 +2,36 @@ # This script tests: pamflip # Also requires: -${PBM_TESTPREFIX}pamflip -lr testimg.ppm | ${PBM_TESTPREFIX}pamflip -lr | cksum -${PBM_TESTPREFIX}pamflip -tb testimg.ppm | ${PBM_TESTPREFIX}pamflip -tb | cksum -${PBM_TESTPREFIX}pamflip -r180 testimg.ppm | \ - ${PBM_TESTPREFIX}pamflip -r180 | cksum -${PBM_TESTPREFIX}pamflip -xy testimg.ppm | ${PBM_TESTPREFIX}pamflip -xy | cksum -${PBM_TESTPREFIX}pamflip -r90 testimg.ppm | \ - ${PBM_TESTPREFIX}pamflip -r90 | \ - ${PBM_TESTPREFIX}pamflip -r90 | \ - ${PBM_TESTPREFIX}pamflip -r90 | cksum -${PBM_TESTPREFIX}pamflip -r270 testimg.ppm | \ - ${PBM_TESTPREFIX}pamflip -r270 | \ - ${PBM_TESTPREFIX}pamflip -r270 | \ - ${PBM_TESTPREFIX}pamflip -r270 | cksum + alias pamflip="${PBM_TESTPREFIX}pamflip" + shopt -s expand_aliases -${PBM_TESTPREFIX}pamflip -lr testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -lr | cksum -${PBM_TESTPREFIX}pamflip -tb testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -tb | cksum -${PBM_TESTPREFIX}pamflip -r180 testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -r180 | cksum -${PBM_TESTPREFIX}pamflip -xy testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -xy | cksum -${PBM_TESTPREFIX}pamflip -r90 testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -r90 | \ - ${PBM_TESTPREFIX}pamflip -r90 | \ - ${PBM_TESTPREFIX}pamflip -r90 | cksum -${PBM_TESTPREFIX}pamflip -r270 testgrid.pbm | \ - ${PBM_TESTPREFIX}pamflip -r270 | \ - ${PBM_TESTPREFIX}pamflip -r270 | \ - ${PBM_TESTPREFIX}pamflip -r270 | cksum +pamflip -lr testimg.ppm | pamflip -lr | cksum +pamflip -tb testimg.ppm | pamflip -tb | cksum +pamflip -r180 testimg.ppm | \ + pamflip -r180 | cksum +pamflip -xy testimg.ppm | pamflip -xy | cksum +pamflip -r90 testimg.ppm | \ + pamflip -r90 | \ + pamflip -r90 | \ + pamflip -r90 | cksum +pamflip -r270 testimg.ppm | \ + pamflip -r270 | \ + pamflip -r270 | \ + pamflip -r270 | cksum + +pamflip -lr testgrid.pbm | \ + pamflip -lr | cksum +pamflip -tb testgrid.pbm | \ + pamflip -tb | cksum +pamflip -r180 testgrid.pbm | \ + pamflip -r180 | cksum +pamflip -xy testgrid.pbm | \ + pamflip -xy | cksum +pamflip -r90 testgrid.pbm | \ + pamflip -r90 | \ + pamflip -r90 | \ + pamflip -r90 | cksum +pamflip -r270 testgrid.pbm | \ + pamflip -r270 | \ + pamflip -r270 | \ + pamflip -r270 | cksum diff --git a/test/pamflip.test b/test/pamflip.test index 59f8e639..4ea275bd 100755 --- a/test/pamflip.test +++ b/test/pamflip.test @@ -2,15 +2,18 @@ # This script tests: pamflip # Also requires: + alias pamflip="${PBM_TESTPREFIX}pamflip" + shopt -s expand_aliases + # Test 1. Should print 2116496681 101484 -${PBM_TESTPREFIX}pamflip -lr testimg.ppm | cksum +pamflip -lr testimg.ppm | cksum # Test 2. Should print 217037000 101484 -${PBM_TESTPREFIX}pamflip -cw testimg.ppm | cksum +pamflip -cw testimg.ppm | cksum # Test 3. Should print 2052917888 101484 -${PBM_TESTPREFIX}pamflip -tb testimg.ppm | cksum +pamflip -tb testimg.ppm | cksum # Test 4. Should print 3375384165 41 -${PBM_TESTPREFIX}pamflip -lr testgrid.pbm | cksum +pamflip -lr testgrid.pbm | cksum # Test 5. Should print 604323149 41 -${PBM_TESTPREFIX}pamflip -tb testgrid.pbm | cksum +pamflip -tb testgrid.pbm | cksum # Test 6. Should print 490797850 37 -${PBM_TESTPREFIX}pamflip -cw testgrid.pbm | cksum +pamflip -cw testgrid.pbm | cksum diff --git a/test/pamseq.test b/test/pamseq.test index 1c6ae44b..acc5d1b1 100755 --- a/test/pamseq.test +++ b/test/pamseq.test @@ -2,4 +2,7 @@ # This script tests: pamseq # Also requires: -${PBM_TESTPREFIX}pamseq 1 255 | cksum + alias pamseq="${PBM_TESTPREFIX}pamseq" + shopt -s expand_aliases + +pamseq 1 255 | cksum diff --git a/test/pamslice-roundtrip.test b/test/pamslice-roundtrip.test index d7ca657d..5dc74d4d 100755 --- a/test/pamslice-roundtrip.test +++ b/test/pamslice-roundtrip.test @@ -2,6 +2,10 @@ # This script tests: pamslice # Also requires: pnmtopnm pamtopnm + alias pamslice="${PBM_TESTPREFIX}pamslice" + alias pnmtopnm="${PBM_BINPREFIX}pnmtopnm" + shopt -s expand_aliases + # Slice rows, one by one, out of testgrid.pbm. # Add header and reconstruct pbm image. # Note that in pamslice output 0 is white and 1 is black: opposite of PBM @@ -11,12 +15,12 @@ echo "14 16" seq 0 15 | while read i; do - ${PBM_TESTPREFIX}pamslice -row=$i testgrid.pbm | \ + pamslice -row=$i testgrid.pbm | \ awk '{print $2}' | sed 'y/01/10/'; - done ) | ${PBM_BINPREFIX}pnmtopnm | cksum + done ) | pnmtopnm | cksum # Slice rows, one by one, out of testimg.ppm. -# Add header and reconstruct pbm image. +# Add header and reconstruct ppm image. # Should print 1926073387 101484 (echo "P3" @@ -24,6 +28,6 @@ echo "255" seq 0 148 | while read i; do - ${PBM_TESTPREFIX}pamslice -row=$i testimg.ppm | awk '{print $2, $3, $4}'; - done ) | ${PBM_BINPREFIX}pnmtopnm | cksum + pamslice -row=$i testimg.ppm | awk '{print $2, $3, $4}'; + done ) | pnmtopnm | cksum diff --git a/test/pamsumm.test b/test/pamsumm.test index 9c5f1b84..9697a2b9 100755 --- a/test/pamsumm.test +++ b/test/pamsumm.test @@ -2,12 +2,15 @@ # This script tests: pamsumm # Also requires: + alias pamsumm="${PBM_TESTPREFIX}pamsumm" + shopt -s expand_aliases + for type in -sum -min -max -mean do - ${PBM_TESTPREFIX}pamsumm -brief $type testgrid.pbm + pamsumm -brief $type testgrid.pbm done for type in -sum -min -max -mean do - ${PBM_TESTPREFIX}pamsumm -brief $type testimg.ppm + pamsumm -brief $type testimg.ppm done diff --git a/test/pamtopam.test b/test/pamtopam.test index 1a4cdff6..e2ec5adf 100755 --- a/test/pamtopam.test +++ b/test/pamtopam.test @@ -2,8 +2,11 @@ # This script tests: pamtopam # Also requires: -${PBM_TESTPREFIX}pamtopam < testimg.ppm | sed '/ENDHDR/q' -${PBM_TESTPREFIX}pamtopam < testgrid.pbm | sed '/ENDHDR/q' + alias pamtopam="${PBM_TESTPREFIX}pamtopam" + shopt -s expand_aliases -${PBM_TESTPREFIX}pamtopam < testimg.ppm | cksum -${PBM_TESTPREFIX}pamtopam < testgrid.pbm | cksum +pamtopam < testimg.ppm | sed '/ENDHDR/q' +pamtopam < testgrid.pbm | sed '/ENDHDR/q' + +pamtopam < testimg.ppm | cksum +pamtopam < testgrid.pbm | cksum diff --git a/test/pbmclean.test b/test/pbmclean.test index 69081ff9..28242d30 100755 --- a/test/pbmclean.test +++ b/test/pbmclean.test @@ -2,15 +2,21 @@ # This script tests: pbmclean # Also requires: pbmmake pbmpage pnmmargin pnmpad -${PBM_BINPREFIX}pbmmake -g 3 3 | ${PBM_BINPREFIX}pnmmargin -black 2 \ + alias pbmclean="${PBM_TESTPREFIX}pbmclean" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pbmpage="${PBM_BINPREFIX}pbmpage" + alias pnmmargin="${PBM_BINPREFIX}pnmmargin" + shopt -s expand_aliases + +pbmmake -g 3 3 | pnmmargin -black 2 \ >${tmpdir}/test.pbm for n in 1 2 3 4 5 6 7 8 do -${PBM_TESTPREFIX}pbmclean -min=$n -black -plain ${tmpdir}/test.pbm +pbmclean -min=$n -black -plain ${tmpdir}/test.pbm done rm ${tmpdir}/test.pbm # Should print 760076056 4210813 -${PBM_BINPREFIX}pbmpage 1 | ${PBM_TESTPREFIX}pbmclean -black | cksum +pbmpage 1 | pbmclean -black | cksum diff --git a/test/pbmmake.test b/test/pbmmake.test index 82fdb941..eb4b472d 100755 --- a/test/pbmmake.test +++ b/test/pbmmake.test @@ -2,17 +2,20 @@ # This script tests: pbmmake # Also requires: + alias pbmmake="${PBM_TESTPREFIX}pbmmake" + shopt -s expand_aliases + for i in `seq 1 8` do for color in -w -b -g do -${PBM_TESTPREFIX}pbmmake -plain $color $i $i | tr -d '\n'; echo +pbmmake -plain $color $i $i | tr -d '\n'; echo done done for i in `seq 8 5 98` do - ( ${PBM_TESTPREFIX}pbmmake -w $i $i ; - ${PBM_TESTPREFIX}pbmmake -b $i $i ; - ${PBM_TESTPREFIX}pbmmake -g $i $i ) | cksum + ( pbmmake -w $i $i ; + pbmmake -b $i $i ; + pbmmake -g $i $i ) | cksum done diff --git a/test/pbmminkowski.test b/test/pbmminkowski.test index ccb882b1..120441f1 100755 --- a/test/pbmminkowski.test +++ b/test/pbmminkowski.test @@ -2,9 +2,14 @@ # This script tests: pbmminkowski # Also requires: pbmmake pnmmargin pnmpad -${PBM_BINPREFIX}pbmmake -w 1 1 | ${PBM_BINPREFIX}pnmmargin -b 1 | \ - ${PBM_TESTPREFIX}pbmminkowski + alias pbmminkowski="${PBM_TESTPREFIX}pbmminkowski" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pnmmargin="${PBM_BINPREFIX}pnmmargin" + shopt -s expand_aliases + +pbmmake -w 1 1 | pnmmargin -b 1 | \ + pbmminkowski echo -${PBM_BINPREFIX}pbmmake -g 3 3 | ${PBM_TESTPREFIX}pbmminkowski +pbmmake -g 3 3 | pbmminkowski echo -${PBM_TESTPREFIX}pbmminkowski testgrid.pbm \ No newline at end of file +pbmminkowski testgrid.pbm diff --git a/test/pbmpage.test b/test/pbmpage.test index dcf8e688..c03ee8d7 100755 --- a/test/pbmpage.test +++ b/test/pbmpage.test @@ -2,6 +2,9 @@ # This script tests: pbmpage # Also requires: -${PBM_TESTPREFIX}pbmpage 1 | cksum -${PBM_TESTPREFIX}pbmpage 2 | cksum -${PBM_TESTPREFIX}pbmpage 3 | cksum \ No newline at end of file + alias pbmpage="${PBM_TESTPREFIX}pbmpage" + shopt -s expand_aliases + +pbmpage 1 | cksum +pbmpage 2 | cksum +pbmpage 3 | cksum diff --git a/test/pbmpscale.test b/test/pbmpscale.test index e1125fc7..50ae470d 100755 --- a/test/pbmpscale.test +++ b/test/pbmpscale.test @@ -2,10 +2,15 @@ # This script tests: pbmpscale # Also requires: pamenlarge pbmtext -${PBM_BINPREFIX}pbmtext -nomargin "F" | ${PBM_TESTPREFIX}pbmpscale 3 -plain + alias pbmpscale="${PBM_TESTPREFIX}pbmpscale" + alias pamenlarge="${PBM_BINPREFIX}pamenlarge" + alias pbmtext="${PBM_BINPREFIX}pbmtext" + shopt -s expand_aliases + +pbmtext -nomargin "F" | pbmpscale 3 -plain for i in 2 3 4 do -${PBM_BINPREFIX}pamenlarge 2 testgrid.pbm | \ - ${PBM_TESTPREFIX}pbmpscale $i | cksum +pamenlarge 2 testgrid.pbm | \ + pbmpscale $i | cksum done diff --git a/test/pbmtext.test b/test/pbmtext.test index 69fa9b23..21020969 100755 --- a/test/pbmtext.test +++ b/test/pbmtext.test @@ -2,10 +2,13 @@ # This script tests: pbmtext # Also requires: + alias pbmtext="${PBM_TESTPREFIX}pbmtext" + shopt -s expand_aliases + for i in 0123456789 abcdefghijk lmnopqrst uzwxyz ABCDEFGHIJK LMNOPQRST UVWXYZ do for flags in "" "-nom" "-builtin fixed" do -echo $i | ${PBM_TESTPREFIX}pbmtext $flags | cksum +echo $i | pbmtext $flags | cksum done done diff --git a/test/pbmtog3.test b/test/pbmtog3.test index 09b5d784..74b901e3 100755 --- a/test/pbmtog3.test +++ b/test/pbmtog3.test @@ -2,27 +2,31 @@ # This script tests: pbmtog3 # Also requires: pbmmake + alias pbmtog3="${PBM_TESTPREFIX}pbmtog3" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + shopt -s expand_aliases + # Test 1. Should print 3697098186 144 -${PBM_TESTPREFIX}pbmtog3 testgrid.pbm | cksum +pbmtog3 testgrid.pbm | cksum # Test 2. Should print 1248301383 122 -${PBM_TESTPREFIX}pbmtog3 -nofixedwidth testgrid.pbm | cksum +pbmtog3 -nofixedwidth testgrid.pbm | cksum # Test 3. Should print 686713716 144 -${PBM_TESTPREFIX}pbmtog3 -reverse testgrid.pbm | cksum +pbmtog3 -reverse testgrid.pbm | cksum # Test 4. Should print 215463240 122 -${PBM_TESTPREFIX}pbmtog3 -nofixedwidth -reverse testgrid.pbm | cksum +pbmtog3 -nofixedwidth -reverse testgrid.pbm | cksum # Test 5. Should print 28792587 47 -${PBM_BINPREFIX}pbmmake -w 10 10 | ${PBM_TESTPREFIX}pbmtog3 | cksum +pbmmake -w 10 10 | pbmtog3 | cksum # Test 6. Should print 277456854 32 -${PBM_BINPREFIX}pbmmake -w 10 10 | \ - ${PBM_TESTPREFIX}pbmtog3 -nofixedwidth | cksum +pbmmake -w 10 10 | \ + pbmtog3 -nofixedwidth | cksum # Test 7. Should print 28792587 47 -${PBM_BINPREFIX}pbmmake -w 10000 10 | ${PBM_TESTPREFIX}pbmtog3 | cksum +pbmmake -w 10000 10 | pbmtog3 | cksum # Test 8. Should print 871281767 162 -${PBM_BINPREFIX}pbmmake -w 10000 10 | \ - ${PBM_TESTPREFIX}pbmtog3 -nofixedwidth | cksum +pbmmake -w 10000 10 | \ + pbmtog3 -nofixedwidth | cksum # Test 9. Should print 3736247115 62 -${PBM_BINPREFIX}pbmmake -b 10 10 | ${PBM_TESTPREFIX}pbmtog3 | cksum +pbmmake -b 10 10 | pbmtog3 | cksum # Test 10. Should print 2820255307 2191856 -${PBM_BINPREFIX}pbmmake -g 1700 2286 | ${PBM_TESTPREFIX}pbmtog3 | cksum +pbmmake -g 1700 2286 | pbmtog3 | cksum # Test 11. Should print 4159089282 2226575 -${PBM_BINPREFIX}pbmmake -g 1800 2286 | ${PBM_TESTPREFIX}pbmtog3 | cksum +pbmmake -g 1800 2286 | pbmtog3 | cksum diff --git a/test/pbmupc.test b/test/pbmupc.test index 6fa772d7..39e4c10c 100755 --- a/test/pbmupc.test +++ b/test/pbmupc.test @@ -2,7 +2,10 @@ # This script tests: pbmupc # Also requires: + alias pbmupc="${PBM_TESTPREFIX}pbmupc" + shopt -s expand_aliases + for type in -s1 -s2 do -${PBM_TESTPREFIX}pbmupc $type 0 72890 00011 +pbmupc $type 0 72890 00011 done | cksum diff --git a/test/pfm-roundtrip.test b/test/pfm-roundtrip.test index 7cd2693c..650cc4d0 100755 --- a/test/pfm-roundtrip.test +++ b/test/pfm-roundtrip.test @@ -2,6 +2,11 @@ # This script tests: pamtopfm pfmtopam # Also requires: pamtopnm + alias pamtopfm="${PBM_TESTPREFIX}pamtopfm" + alias pfmtopam="${PBM_TESTPREFIX}pfmtopam" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + shopt -s expand_aliases + # Should print 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pamtopfm testimg.ppm | ${PBM_TESTPREFIX}pfmtopam | \ - ${PBM_BINPREFIX}pamtopnm | cksum +pamtopfm testimg.ppm | pfmtopam | \ + pamtopnm | cksum diff --git a/test/pgmcrater.test b/test/pgmcrater.test index e6942cee..ffba435f 100755 --- a/test/pgmcrater.test +++ b/test/pgmcrater.test @@ -1,6 +1,9 @@ #! /bin/bash # This script tests: pgmcrater + alias pgmcrater="${PBM_TESTPREFIX}pgmcrater" + shopt -s expand_aliases + # This test is sensitive to differences in floating point math. # With GCC slight results start to appear with -number 75 in # the following test. Compiler type (GCC, Clang, etc.), @@ -17,7 +20,7 @@ testrandom -q case $? in 81) # Should print: 3828822912 65551 - ${PBM_TESTPREFIX}pgmcrater -quiet -number 25 -randomseed 1 | cksum + pgmcrater -quiet -number 25 -randomseed 1 | cksum ;; 8[02-9] | 90) diff --git a/test/pgmhist.test b/test/pgmhist.test index b3361dc4..32b18189 100755 --- a/test/pgmhist.test +++ b/test/pgmhist.test @@ -2,10 +2,14 @@ # This script tests: pgmhist # Also requires: pgmramp + alias pgmhist="${PBM_TESTPREFIX}pgmhist" + alias pgmramp="${PBM_BINPREFIX}pgmramp" + shopt -s expand_aliases + # Ignore differences in spaces. -${PBM_BINPREFIX}pgmramp -maxval=8 -lr 8 2 | ${PBM_TESTPREFIX}pgmhist | \ +pgmramp -maxval=8 -lr 8 2 | pgmhist | \ sed -e 's/ */ /g' -e 's/ *$//' -${PBM_TESTPREFIX}pgmhist testgrid.pbm | \ - sed -e 's/ */ /g' -e 's/ *$//' \ No newline at end of file +pgmhist testgrid.pbm | \ + sed -e 's/ */ /g' -e 's/ *$//' diff --git a/test/pgmmake.test b/test/pgmmake.test index 0180b502..2c384e1b 100755 --- a/test/pgmmake.test +++ b/test/pgmmake.test @@ -2,9 +2,12 @@ # This script tests: pgmmake # Also requires: -${PBM_TESTPREFIX}pgmmake 1 50 50 | cksum -${PBM_TESTPREFIX}pgmmake .2 50 100 -maxval=5 | cksum + alias pgmmake="${PBM_TESTPREFIX}pgmmake" + shopt -s expand_aliases +pgmmake 1 50 50 | cksum +pgmmake .2 50 100 -maxval=5 | cksum - \ No newline at end of file + + diff --git a/test/pgmnoise.test b/test/pgmnoise.test index 60d06510..a5c1c380 100755 --- a/test/pgmnoise.test +++ b/test/pgmnoise.test @@ -2,6 +2,9 @@ # This script tests: pgmnoise # Also requires: + alias pgmnoise="${PBM_TESTPREFIX}pgmnoise" + shopt -s expand_aliases + # We first check whether random number generator is glibc rand(). # If not, this test is skipped. @@ -10,7 +13,7 @@ testrandom case $? in 81) # Should print: 1663614689 10015 - ${PBM_TESTPREFIX}pgmnoise --randomseed=0 100 100 | cksum ;; + pgmnoise --randomseed=0 100 100 | cksum ;; # Any additional tests go here. diff --git a/test/pgmramp.test b/test/pgmramp.test index cf3d91d7..acfbdb5a 100755 --- a/test/pgmramp.test +++ b/test/pgmramp.test @@ -2,11 +2,14 @@ # This script tests: pgmramp # Also requires: + alias pgmramp="${PBM_TESTPREFIX}pgmramp" + shopt -s expand_aliases + for type in -lr -tb -rect -ell do -${PBM_TESTPREFIX}pgmramp -maxval=3 $type 4 4 -plain +pgmramp -maxval=3 $type 4 4 -plain done for type in -lr -tb -rect -ell -do ${PBM_TESTPREFIX}pgmramp $type 256 256 | cksum +do pgmramp $type 256 256 | cksum done diff --git a/test/pgmtopgm.test b/test/pgmtopgm.test index 638cb68b..388cca93 100755 --- a/test/pgmtopgm.test +++ b/test/pgmtopgm.test @@ -2,4 +2,7 @@ # This script tests: pgmtopgm # Also requires: -${PBM_TESTPREFIX}pgmtopgm < testgrid.pbm | cksum + alias pgmtopgm="${PBM_TESTPREFIX}pgmtopgm" + shopt -s expand_aliases + +pgmtopgm < testgrid.pbm | cksum diff --git a/test/pgmtoppm.test b/test/pgmtoppm.test index b93d7867..cdd53623 100755 --- a/test/pgmtoppm.test +++ b/test/pgmtoppm.test @@ -2,16 +2,22 @@ # This script tests: pgmtoppm # Also requires: pamseq pamtopnm pgmramp -${PBM_BINPREFIX}pgmramp -maxval=5 -lr 256 1 >${tmpdir}/test.pgm -${PBM_BINPREFIX}pamseq 3 5 -tupletype=RGB | ${PBM_BINPREFIX}pamtopnm \ + alias pgmtoppm="${PBM_TESTPREFIX}pgmtoppm" + alias pamseq="${PBM_BINPREFIX}pamseq" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + alias pgmramp="${PBM_BINPREFIX}pgmramp" + shopt -s expand_aliases + +pgmramp -maxval=5 -lr 256 1 >${tmpdir}/test.pgm +pamseq 3 5 -tupletype=RGB | pamtopnm \ >${tmpdir}/palette # Test 1. -${PBM_TESTPREFIX}pgmtoppm green ${tmpdir}/test.pgm | cksum +pgmtoppm green ${tmpdir}/test.pgm | cksum -${PBM_TESTPREFIX}pgmtoppm yellow-blue ${tmpdir}/test.pgm | cksum +pgmtoppm yellow-blue ${tmpdir}/test.pgm | cksum -${PBM_TESTPREFIX}pgmtoppm -map=${tmpdir}/palette ${tmpdir}/test.pgm | cksum +pgmtoppm -map=${tmpdir}/palette ${tmpdir}/test.pgm | cksum rm ${tmpdir}/test.pgm ${tmpdir}/palette diff --git a/test/png-roundtrip.test b/test/png-roundtrip.test index 6f25d1c3..75b0d808 100755 --- a/test/png-roundtrip.test +++ b/test/png-roundtrip.test @@ -2,6 +2,10 @@ # This script tests: pngtopnm pnmtopng # Also requires: -${PBM_TESTPREFIX}pnmtopng testimg.ppm | ${PBM_TESTPREFIX}pngtopnm | cksum -${PBM_TESTPREFIX}pnmtopng testgrid.pbm | ${PBM_TESTPREFIX}pngtopnm | cksum + alias pngtopnm="${PBM_TESTPREFIX}pngtopnm" + alias pnmtopng="${PBM_TESTPREFIX}pnmtopng" + shopt -s expand_aliases + +pnmtopng testimg.ppm | pngtopnm | cksum +pnmtopng testgrid.pbm | pngtopnm | cksum diff --git a/test/pnm-pam-roundtrip.test b/test/pnm-pam-roundtrip.test index 1aef986c..506d25aa 100755 --- a/test/pnm-pam-roundtrip.test +++ b/test/pnm-pam-roundtrip.test @@ -2,6 +2,10 @@ # This script tests: pamtopam pamtopnm # Also requires: -${PBM_TESTPREFIX}pamtopam < testimg.ppm | ${PBM_TESTPREFIX}pamtopnm | cksum -${PBM_TESTPREFIX}pamtopam < testgrid.pbm | ${PBM_TESTPREFIX}pamtopnm | cksum + alias pamtopam="${PBM_TESTPREFIX}pamtopam" + alias pamtopnm="${PBM_TESTPREFIX}pamtopnm" + shopt -s expand_aliases + +pamtopam < testimg.ppm | pamtopnm | cksum +pamtopam < testgrid.pbm | pamtopnm | cksum diff --git a/test/pnm-plain-roundtrip.test b/test/pnm-plain-roundtrip.test index 86dbb2fb..7d0293ee 100755 --- a/test/pnm-plain-roundtrip.test +++ b/test/pnm-plain-roundtrip.test @@ -2,8 +2,11 @@ # This script tests: pnmtopnm # Also requires: pamtopnm -${PBM_TESTPREFIX}pnmtopnm -plain testimg.ppm | \ - ${PBM_TESTPREFIX}pnmtopnm | cksum -${PBM_TESTPREFIX}pnmtopnm -plain testgrid.pbm | \ - ${PBM_TESTPREFIX}pnmtopnm | cksum + alias pnmtopnm="${PBM_TESTPREFIX}pnmtopnm" + shopt -s expand_aliases + +pnmtopnm -plain testimg.ppm | \ + pnmtopnm | cksum +pnmtopnm -plain testgrid.pbm | \ + pnmtopnm | cksum diff --git a/test/pnmcat.test b/test/pnmcat.test index 35efd515..b77c90fd 100755 --- a/test/pnmcat.test +++ b/test/pnmcat.test @@ -2,8 +2,11 @@ # This script tests: pnmcat # Also requires: -${PBM_TESTPREFIX}pnmcat -lr testgrid.pbm testgrid.pbm | cksum -${PBM_TESTPREFIX}pnmcat -tb testgrid.pbm testgrid.pbm | cksum + alias pnmcat="${PBM_TESTPREFIX}pnmcat" + shopt -s expand_aliases -${PBM_TESTPREFIX}pnmcat -lr testimg.ppm testimg.ppm | cksum -${PBM_TESTPREFIX}pnmcat -tb testimg.ppm testimg.ppm | cksum +pnmcat -lr testgrid.pbm testgrid.pbm | cksum +pnmcat -tb testgrid.pbm testgrid.pbm | cksum + +pnmcat -lr testimg.ppm testimg.ppm | cksum +pnmcat -tb testimg.ppm testimg.ppm | cksum diff --git a/test/pnminvert-roundtrip.test b/test/pnminvert-roundtrip.test index 8cdb6c25..eb3e2b35 100755 --- a/test/pnminvert-roundtrip.test +++ b/test/pnminvert-roundtrip.test @@ -2,5 +2,8 @@ # This script tests: pnminvert # Also requires: -${PBM_TESTPREFIX}pnminvert testimg.ppm | ${PBM_TESTPREFIX}pnminvert | cksum -${PBM_TESTPREFIX}pnminvert testgrid.pbm | ${PBM_TESTPREFIX}pnminvert | cksum + alias pnminvert="${PBM_TESTPREFIX}pnminvert" + shopt -s expand_aliases + +pnminvert testimg.ppm | pnminvert | cksum +pnminvert testgrid.pbm | pnminvert | cksum diff --git a/test/pnminvert.test b/test/pnminvert.test index 7fc8523c..eb25d2a0 100755 --- a/test/pnminvert.test +++ b/test/pnminvert.test @@ -2,19 +2,24 @@ # This script tests: pnminvert # Also requires: pbmmake ppmtopgm + alias pnminvert="${PBM_TESTPREFIX}pnminvert" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Test 1. Should print 1240379484 41 -${PBM_TESTPREFIX}pnminvert testgrid.pbm | cksum +pnminvert testgrid.pbm | cksum # Test 2. Should print 1416115901 101484 -${PBM_TESTPREFIX}pnminvert testimg.ppm | cksum +pnminvert testimg.ppm | cksum # Test 3. Should print 2961441369 33838 # printed 4215652354 33838 with older ppmtopgm -${PBM_BINPREFIX}ppmtopgm testimg.ppm | ${PBM_TESTPREFIX}pnminvert | cksum +ppmtopgm testimg.ppm | pnminvert | cksum # Test 4. Should print 2595564405 14 -${PBM_BINPREFIX}pbmmake -w 7 7 | ${PBM_TESTPREFIX}pnminvert | cksum +pbmmake -w 7 7 | pnminvert | cksum # Test 5. Should print 2595564405 14 -${PBM_BINPREFIX}pbmmake -b 7 7 | cksum +pbmmake -b 7 7 | cksum # Test 6. Should print 2595564405 14 -${PBM_BINPREFIX}pbmmake -b 7 7 | ${PBM_TESTPREFIX}pnminvert | \ - ${PBM_TESTPREFIX}pnminvert | cksum +pbmmake -b 7 7 | pnminvert | \ + pnminvert | cksum # Test 7. Should print 2896726098 15 -${PBM_BINPREFIX}pbmmake -g 8 8 | ${PBM_TESTPREFIX}pnminvert | cksum +pbmmake -g 8 8 | pnminvert | cksum diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test index d5aa07f3..da88d70d 100755 --- a/test/pnmpsnr.test +++ b/test/pnmpsnr.test @@ -2,10 +2,14 @@ # This script tests: pnmpsnr # Also requires: pbmmake -${PBM_BINPREFIX}pbmmake -w 10 10 > ${tmpdir}/w.pbm -${PBM_BINPREFIX}pbmmake -b 10 10 > ${tmpdir}/b.pbm -${PBM_TESTPREFIX}pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/b.pbm 2>&1 | \ + alias pnmpsnr="${PBM_TESTPREFIX}pnmpsnr" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + shopt -s expand_aliases + +pbmmake -w 10 10 > ${tmpdir}/w.pbm +pbmmake -b 10 10 > ${tmpdir}/b.pbm +pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/b.pbm 2>&1 | \ awk '{print $(NF-1),$NF}' -${PBM_TESTPREFIX}pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/w.pbm 2>&1 | \ +pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/w.pbm 2>&1 | \ awk '{print $(NF-1),$NF}' rm ${tmpdir}/b.pbm ${tmpdir}/w.pbm diff --git a/test/pnmremap1.test b/test/pnmremap1.test index 1e68c8ad..208be2fb 100755 --- a/test/pnmremap1.test +++ b/test/pnmremap1.test @@ -2,9 +2,15 @@ # This script tests: pnmremap # Also requires: pamdepth pamseq pamtopnm -${PBM_BINPREFIX}pamseq 3 5 -tupletype=RGB | ${PBM_BINPREFIX}pamtopnm \ + alias pnmremap="${PBM_TESTPREFIX}pnmremap" + alias pamdepth="${PBM_BINPREFIX}pamdepth" + alias pamseq="${PBM_BINPREFIX}pamseq" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + shopt -s expand_aliases + +pamseq 3 5 -tupletype=RGB | pamtopnm \ > ${tmpdir}/palette -${PBM_BINPREFIX}pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 +pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 # Test 1. Floyd-Steinberg # This fails with older versions of Netpbm and x86-64. @@ -13,7 +19,7 @@ ${PBM_BINPREFIX}pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 # x86-32: 2667816854 101482 # x86-64: 3602410851 101482 -${PBM_TESTPREFIX}pnmremap -mapfile=${tmpdir}/palette -floyd -norandom \ +pnmremap -mapfile=${tmpdir}/palette -floyd -norandom \ testimg.ppm | cksum rm ${tmpdir}/palette{,255} diff --git a/test/pnmremap2.test b/test/pnmremap2.test index f2fd92e0..3399dc39 100755 --- a/test/pnmremap2.test +++ b/test/pnmremap2.test @@ -2,20 +2,26 @@ # This script tests: pnmremap # Also requires: pamdepth pamseq pamtopnm -${PBM_BINPREFIX}pamseq 3 5 -tupletype=RGB | ${PBM_BINPREFIX}pamtopnm \ + alias pnmremap="${PBM_TESTPREFIX}pnmremap" + alias pamdepth="${PBM_BINPREFIX}pamdepth" + alias pamseq="${PBM_BINPREFIX}pamseq" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + shopt -s expand_aliases + +pamseq 3 5 -tupletype=RGB | pamtopnm \ > ${tmpdir}/palette -${PBM_BINPREFIX}pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 +pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 # Test 2. Default (unmodified quantization) -${PBM_TESTPREFIX}pnmremap -mapfile=${tmpdir}/palette -nofloyd \ +pnmremap -mapfile=${tmpdir}/palette -nofloyd \ testimg.ppm | cksum # Test 3. Use first color in palette for missing colors -${PBM_TESTPREFIX}pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ +pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ -firstisdefault testimg.ppm | cksum # Test 4. Use black for missing colors -${PBM_TESTPREFIX}pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ +pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ -missingcolor=black testimg.ppm | cksum rm ${tmpdir}/palette{,255} diff --git a/test/pnmshear.ok b/test/pnmshear.ok index d701faaf..058ec042 100644 --- a/test/pnmshear.ok +++ b/test/pnmshear.ok @@ -1 +1 @@ -2080980136 22 +598644601 24 diff --git a/test/pnmshear.test b/test/pnmshear.test index 276e3e22..30ab45be 100644 --- a/test/pnmshear.test +++ b/test/pnmshear.test @@ -1,19 +1,26 @@ #! /bin/bash # This script tests: pnmshear -# Also requires: pbmmake +# Also requires: pbmmake pnmpad -# Test. Should produce 2080980136 22 -${PBM_BINPREFIX}pbmmake -g 7 7 | \ - ${PBM_TESTPREFIX}pnmshear 45 -noantialias | cksum + alias pnmshear="${PBM_TESTPREFIX}pnmshear" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pnmpad="${PBM_BINPREFIX}pnmpad" + shopt -s expand_aliases + +# Test. Should produce 598644601 24 + +pbmmake -g 7 7 | pnmpad -white -top 1 | \ + pnmshear 45 -noantialias | cksum # Output of above, in pbm plain format # # P1 -# 14 7 -# 01010101111111 -# 10101011111111 -# 10101010111111 -# 11101010111111 -# 11101010101111 -# 11111010101111 -# 11111010101011 +# 15 8 +# 000000000000000 +# 010101000000000 +# 010101010000000 +# 000101010000000 +# 000101010100000 +# 000001010100000 +# 000001010101000 +# 000000010101000 diff --git a/test/pnmtile.test b/test/pnmtile.test index 0f9d91df..f74bdce3 100755 --- a/test/pnmtile.test +++ b/test/pnmtile.test @@ -2,11 +2,15 @@ # This script tests: pnmtile # Also requires: pnmcat -${PBM_TESTPREFIX}pnmtile 40 50 testgrid.pbm | cksum + alias pnmtile="${PBM_TESTPREFIX}pnmtile" + alias pnmcat="${PBM_BINPREFIX}pnmcat" + shopt -s expand_aliases -${PBM_TESTPREFIX}pnmtile 454 298 testimg.ppm > ${tmpdir}/testimg4.ppm && -${PBM_BINPREFIX}pnmcat -lr testimg.ppm testimg.ppm > ${tmpdir}/testimg2.ppm && -${PBM_BINPREFIX}pnmcat -tb ${tmpdir}/testimg2.ppm ${tmpdir}/testimg2.ppm | \ +pnmtile 40 50 testgrid.pbm | cksum + +pnmtile 454 298 testimg.ppm > ${tmpdir}/testimg4.ppm && +pnmcat -lr testimg.ppm testimg.ppm > ${tmpdir}/testimg2.ppm && +pnmcat -tb ${tmpdir}/testimg2.ppm ${tmpdir}/testimg2.ppm | \ cmp -s - ${tmpdir}/testimg4.ppm echo $? diff --git a/test/pnmtopnm-plain.test b/test/pnmtopnm-plain.test index ff211e40..f4e0749e 100755 --- a/test/pnmtopnm-plain.test +++ b/test/pnmtopnm-plain.test @@ -2,9 +2,14 @@ # This script tests: pnmtopnm # Also requires: pgmtopgm ppmtoppm pamtopnm -${PBM_TESTPREFIX}pnmtopnm -plain testgrid.pbm + alias pnmtopnm="${PBM_TESTPREFIX}pnmtopnm" + alias pgmtopgm="${PBM_BINPREFIX}pgmtopgm" + alias ppmtoppm="${PBM_BINPREFIX}ppmtoppm" + shopt -s expand_aliases -${PBM_BINPREFIX}pgmtopgm < testgrid.pbm | ${PBM_TESTPREFIX}pnmtopnm -plain +pnmtopnm -plain testgrid.pbm -${PBM_BINPREFIX}ppmtoppm < testgrid.pbm | ${PBM_TESTPREFIX}pnmtopnm -plain | \ +pgmtopgm < testgrid.pbm | pnmtopnm -plain + +ppmtoppm < testgrid.pbm | pnmtopnm -plain | \ head -n11 diff --git a/test/ppmbrighten.test b/test/ppmbrighten.test index 72bebff4..29cfeb2c 100755 --- a/test/ppmbrighten.test +++ b/test/ppmbrighten.test @@ -2,6 +2,9 @@ # This script tests: ppmbrighten # Also requires: -${PBM_TESTPREFIX}ppmbrighten -v 100 testimg.ppm | cksum -${PBM_TESTPREFIX}ppmbrighten -v 100 -normalize testimg.ppm | cksum -${PBM_TESTPREFIX}ppmbrighten -s 100 -v -50 testimg.ppm | cksum + alias ppmbrighten="${PBM_TESTPREFIX}ppmbrighten" + shopt -s expand_aliases + +ppmbrighten -v 100 testimg.ppm | cksum +ppmbrighten -v 100 -normalize testimg.ppm | cksum +ppmbrighten -s 100 -v -50 testimg.ppm | cksum diff --git a/test/ppmchange-roundtrip.test b/test/ppmchange-roundtrip.test index c303c11b..a357870e 100755 --- a/test/ppmchange-roundtrip.test +++ b/test/ppmchange-roundtrip.test @@ -2,10 +2,16 @@ # This script tests: ppmchange # Also requires: pgmtopbm pnminvert ppmtopgm -${PBM_TESTPREFIX}ppmchange black white white black testgrid.pbm | \ -${PBM_BINPREFIX}pnminvert | ${PBM_BINPREFIX}ppmtopgm | \ -${PBM_BINPREFIX}pgmtopbm -th -val=0.5 | cksum + alias ppmchange="${PBM_TESTPREFIX}ppmchange" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias pnminvert="${PBM_BINPREFIX}pnminvert" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases -${PBM_TESTPREFIX}ppmchange black white white black testgrid.pbm | \ -${PBM_TESTPREFIX}ppmchange black white white black -plain | \ -${PBM_BINPREFIX}ppmtopgm | ${PBM_BINPREFIX}pgmtopbm -th -val=0.5 | cksum +ppmchange black white white black testgrid.pbm | \ +pnminvert | ppmtopgm | \ +pgmtopbm -th -val=0.5 | cksum + +ppmchange black white white black testgrid.pbm | \ +ppmchange black white white black -plain | \ +ppmtopgm | pgmtopbm -th -val=0.5 | cksum diff --git a/test/ppmcie.test b/test/ppmcie.test index 1e60c848..2584ece4 100755 --- a/test/ppmcie.test +++ b/test/ppmcie.test @@ -2,6 +2,11 @@ # This script tests: ppmcie # Also requires: pamsumm pamsharpness + alias ppmcie="${PBM_TESTPREFIX}ppmcie" + alias pamsharpness="${PBM_BINPREFIX}pamsharpness" + alias pamsumm="${PBM_BINPREFIX}pamsumm" + shopt -s expand_aliases + # Test 1. Should print 955840041 786447 # Without -nolabel -noaxes -nowpoint -noblack older versions of # Netpbm produce slightly different charts. @@ -9,7 +14,7 @@ # v. 10.35.86: 288356530 786447 # v. 10.59.2 : 2292601420 786447 -${PBM_TESTPREFIX}ppmcie -nolabel -noaxes -nowpoint -noblack \ +ppmcie -nolabel -noaxes -nowpoint -noblack \ > ${tmpdir}/ppmcie.ppm # There is a slight difference in the output depending on whether ppmcie @@ -26,7 +31,7 @@ ${PBM_TESTPREFIX}ppmcie -nolabel -noaxes -nowpoint -noblack \ # x86 32 bit: 38.660173 # x86 64 bit: 38.681432 -${PBM_BINPREFIX}pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ +pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ awk '{ if(38.65 < $1 && $1 <38.69) print "ok"; else print $1}' # Test 2. Measure image sharpness @@ -34,7 +39,7 @@ ${PBM_BINPREFIX}pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ # x86 32 bit: 0.002476 # x86 64 bit: 0.002478 -${PBM_BINPREFIX}pamsharpness ${tmpdir}/ppmcie.ppm 2>&1 | \ +pamsharpness ${tmpdir}/ppmcie.ppm 2>&1 | \ awk 'NF==4 && $2=="Sharpness" \ {if (0.002475 < $4 && $4 < 0.002479) print "ok"; else print $4} NF>0 && NF!=4 {print "error"}' diff --git a/test/ppmdfont.test b/test/ppmdfont.test index 027b8f2c..30f74a9c 100755 --- a/test/ppmdfont.test +++ b/test/ppmdfont.test @@ -2,11 +2,16 @@ # This script tests: ppmdmkfont ppmddumpfont ppmdcfont # Also requires: + alias ppmdcfont="${PBM_TESTPREFIX}ppmdcfont" + alias ppmddumpfont="${PBM_TESTPREFIX}ppmddumpfont" + alias ppmdmkfont="${PBM_TESTPREFIX}ppmdmkfont" + shopt -s expand_aliases + # Test 1. Should produce: 2726488777 48129 -${PBM_TESTPREFIX}ppmdmkfont | ${PBM_TESTPREFIX}ppmddumpfont 2>&1 | cksum +ppmdmkfont | ppmddumpfont 2>&1 | cksum # Test 2. Should produce: 2845495212 75033 -${PBM_TESTPREFIX}ppmdmkfont | ${PBM_TESTPREFIX}ppmdcfont | cksum +ppmdmkfont | ppmdcfont | cksum # There is a strange glitch in output when ppmdcfont is compiled by clang: # 3171,3173c3171,3173 diff --git a/test/ppmdim.test b/test/ppmdim.test index e2a1b0df..e528c3ce 100755 --- a/test/ppmdim.test +++ b/test/ppmdim.test @@ -2,6 +2,12 @@ # This script tests: ppmdim # Also requires: pamfunc pnmarith pamarith pamsumm + alias ppmdim="${PBM_TESTPREFIX}ppmdim" + alias pamfunc="${PBM_BINPREFIX}pamfunc" + alias pamsumm="${PBM_BINPREFIX}pamsumm" + alias pnmarith="${PBM_BINPREFIX}pnmarith" + shopt -s expand_aliases + # Compare ppmdim and pamfunc with various dim factors # Due to the difference in rounding methods, pamfunc produces slightly # brighter images, by about 0.5 per pixel. @@ -10,10 +16,10 @@ for i in 0.125 0.25 0.5 0.75 0.1 0.0117 0.2 0.4 0.333 0.666 0.8 0.9 0.95 do - ${PBM_TESTPREFIX}ppmdim $i testimg.ppm > ${tmpdir}/dim1.ppm - ${PBM_BINPREFIX}pamfunc -mult=$i testimg.ppm > ${tmpdir}/dim2.ppm - ${PBM_BINPREFIX}pnmarith -diff ${tmpdir}/dim1.ppm ${tmpdir}/dim2.ppm | \ - ${PBM_BINPREFIX}pamsumm -mean -brief | \ + ppmdim $i testimg.ppm > ${tmpdir}/dim1.ppm + pamfunc -mult=$i testimg.ppm > ${tmpdir}/dim2.ppm + pnmarith -diff ${tmpdir}/dim1.ppm ${tmpdir}/dim2.ppm | \ + pamsumm -mean -brief | \ awk '{print $1<0.75 ? "ok" : "fail"}' done rm ${tmpdir}/dim[12].ppm diff --git a/test/ppmdither.test b/test/ppmdither.test index 5fea0bb4..a93a434a 100755 --- a/test/ppmdither.test +++ b/test/ppmdither.test @@ -2,6 +2,9 @@ # This script tests: ppmdither # Also requires: -${PBM_TESTPREFIX}ppmdither testimg.ppm | cksum -${PBM_TESTPREFIX}ppmdither -red 2 -green 2 -blue 2 testimg.ppm | cksum -${PBM_TESTPREFIX}ppmdither -dim 2 testimg.ppm | cksum + alias ppmdither="${PBM_TESTPREFIX}ppmdither" + shopt -s expand_aliases + +ppmdither testimg.ppm | cksum +ppmdither -red 2 -green 2 -blue 2 testimg.ppm | cksum +ppmdither -dim 2 testimg.ppm | cksum diff --git a/test/ppmforge.test b/test/ppmforge.test index 5ec37e9c..09a66916 100755 --- a/test/ppmforge.test +++ b/test/ppmforge.test @@ -1,6 +1,9 @@ #! /bin/bash # This script tests: ppmforge + alias ppmforge="${PBM_TESTPREFIX}ppmforge" + shopt -s expand_aliases + # Use small x y values to avoid floating point issues. @@ -8,7 +11,7 @@ testrandom -q case $? in 81) # Test 1: Should print: 3634219838 196623 - ${PBM_TESTPREFIX}ppmforge -night -seed 1 | cksum + ppmforge -night -seed 1 | cksum ;; 8[02-9] | 90) diff --git a/test/ppmgauss.test b/test/ppmgauss.test index a75d272c..9dfdd2f6 100755 --- a/test/ppmgauss.test +++ b/test/ppmgauss.test @@ -2,10 +2,13 @@ # This script tests: pamgauss # Also requires: + alias pamgauss="${PBM_TESTPREFIX}pamgauss" + shopt -s expand_aliases + for i in `seq 3 11` do for s in `seq 1 9` do -${PBM_TESTPREFIX}pamgauss $i $i -sigma=.$s | cksum +pamgauss $i $i -sigma=.$s | cksum done done diff --git a/test/ppmhist.test b/test/ppmhist.test index 95fcd2f7..6dcbc762 100755 --- a/test/ppmhist.test +++ b/test/ppmhist.test @@ -2,6 +2,10 @@ # This script tests: ppmhist # Also requires: pgmramp -${PBM_BINPREFIX}pgmramp -maxval=8 -lr 8 2 | ${PBM_TESTPREFIX}ppmhist -sort=rgb -${PBM_TESTPREFIX}ppmhist -map -sort=rgb testimg.ppm | cksum + alias ppmhist="${PBM_TESTPREFIX}ppmhist" + alias pgmramp="${PBM_BINPREFIX}pgmramp" + shopt -s expand_aliases + +pgmramp -maxval=8 -lr 8 2 | ppmhist -sort=rgb +ppmhist -map -sort=rgb testimg.ppm | cksum diff --git a/test/ppmmake.test b/test/ppmmake.test index da23095c..faba1ace 100755 --- a/test/ppmmake.test +++ b/test/ppmmake.test @@ -2,10 +2,13 @@ # This script tests: ppmmake # Also requires: -${PBM_TESTPREFIX}ppmmake rgb:ff/80/80 50 100 -maxval=5 | cksum -${PBM_TESTPREFIX}ppmmake red 50 50 | cksum + alias ppmmake="${PBM_TESTPREFIX}ppmmake" + shopt -s expand_aliases +ppmmake rgb:ff/80/80 50 100 -maxval=5 | cksum +ppmmake red 50 50 | cksum - \ No newline at end of file + + diff --git a/test/ppmmix.test b/test/ppmmix.test index 451aa8be..d24e589d 100755 --- a/test/ppmmix.test +++ b/test/ppmmix.test @@ -3,26 +3,36 @@ # Also requires: pamdepth pamenlarge pamsumm pbmmake # Also requires: pgmtopgm pnminvert ppmtopgm + alias ppmmix="${PBM_TESTPREFIX}ppmmix" + alias pamdepth="${PBM_BINPREFIX}pamdepth" + alias pamenlarge="${PBM_BINPREFIX}pamenlarge" + alias pamsumm="${PBM_BINPREFIX}pamsumm" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pgmtopgm="${PBM_BINPREFIX}pgmtopgm" + alias pnminvert="${PBM_BINPREFIX}pnminvert" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Print a pretty checkerboard pattern -${PBM_BINPREFIX}pbmmake -g 8 8 | \ - ${PBM_BINPREFIX}pgmtopgm > ${tmpdir}/a1.pgm && -${PBM_BINPREFIX}pbmmake -g 2 2 | ${PBM_BINPREFIX}pamenlarge 4 | \ - ${PBM_BINPREFIX}pgmtopgm > ${tmpdir}/a2.pgm && -${PBM_TESTPREFIX}ppmmix 0.75 ${tmpdir}/a1.pgm ${tmpdir}/a2.pgm -plain | \ - ${PBM_BINPREFIX}ppmtopgm | ${PBM_BINPREFIX}pamdepth 3 -plain && +pbmmake -g 8 8 | \ + pgmtopgm > ${tmpdir}/a1.pgm && +pbmmake -g 2 2 | pamenlarge 4 | \ + pgmtopgm > ${tmpdir}/a2.pgm && +ppmmix 0.75 ${tmpdir}/a1.pgm ${tmpdir}/a2.pgm -plain | \ + ppmtopgm | pamdepth 3 -plain && rm ${tmpdir}/a1.pgm ${tmpdir}/a2.pgm # Mix image with itself. # Output should match input regardless of ratio. for i in 0 0.5 0.6 1 do -${PBM_TESTPREFIX}ppmmix $i testimg.ppm testimg.ppm | cksum +ppmmix $i testimg.ppm testimg.ppm | cksum done # Mix image with its own inverse. # Output should be a monotone gray sheet. -${PBM_BINPREFIX}pnminvert testimg.ppm | ${PBM_TESTPREFIX}ppmmix .5 \ +pnminvert testimg.ppm | ppmmix .5 \ testimg.ppm - | tee ${tmpdir}/a3.ppm | \ - ${PBM_BINPREFIX}pamsumm -brief -max && - ${PBM_BINPREFIX}pamsumm -brief -min ${tmpdir}/a3.ppm && + pamsumm -brief -max && + pamsumm -brief -min ${tmpdir}/a3.ppm && rm ${tmpdir}/a3.ppm diff --git a/test/ppmpat.test b/test/ppmpat.test index af0ce956..bf1e9316 100755 --- a/test/ppmpat.test +++ b/test/ppmpat.test @@ -1,6 +1,9 @@ #! /bin/bash # This script tests: ppmpat + alias ppmpat="${PBM_TESTPREFIX}ppmpat" + shopt -s expand_aliases + # TODO: Write tests for squig and poles. It appears that they are # sensitive to differences in floating point math. @@ -8,22 +11,22 @@ testrandom -q case $? in 81) # Test 1. Should print: 4008533639 781 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 16 16 | cksum + ppmpat --randomseed=0 -g2 16 16 | cksum # Test 2. Should print: 2448908863 9613 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 64 50 | cksum + ppmpat --randomseed=0 -g2 64 50 | cksum # Test 3. Should print: 2698433077 1549 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -madras 32 16 | cksum + ppmpat --randomseed=0 -madras 32 16 | cksum # Test 4. Should print: 3705929501 781 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -tartan 16 16 | cksum + ppmpat --randomseed=0 -tartan 16 16 | cksum # Test 5. Should print: 2219119109 36015 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -camo 100 120 | cksum + ppmpat --randomseed=0 -camo 100 120 | cksum # Test 6. Should print: 3436846137 16813 - ${PBM_TESTPREFIX}ppmpat --randomseed=0 -anticamo 80 70 | cksum + ppmpat --randomseed=0 -anticamo 80 70 | cksum ;; 8[02-9] | 90) diff --git a/test/ppmrough.test b/test/ppmrough.test index 92cc02d7..dbe92c29 100755 --- a/test/ppmrough.test +++ b/test/ppmrough.test @@ -1,12 +1,15 @@ #! /bin/bash # This script tests: ppmrough + alias ppmrough="${PBM_TESTPREFIX}ppmrough" + shopt -s expand_aliases + testrandom -q case $? in 81) # Should print: 378403602 30015 - ${PBM_TESTPREFIX}ppmrough -randomseed 1 | cksum + ppmrough -randomseed 1 | cksum ;; 8[02-9] | 90) diff --git a/test/ppmtopgm.test b/test/ppmtopgm.test index 7ab481c6..94e0ae91 100755 --- a/test/ppmtopgm.test +++ b/test/ppmtopgm.test @@ -2,6 +2,9 @@ # This script tests: ppmtopgm # Also requires: + alias ppmtopgm="${PBM_TESTPREFIX}ppmtopgm" + shopt -s expand_aliases + # Test 1. Should produce 2871603838 33838 -${PBM_TESTPREFIX}ppmtopgm testimg.ppm | cksum +ppmtopgm testimg.ppm | cksum diff --git a/test/ppmtoppm.test b/test/ppmtoppm.test index c073ecff..2d84809a 100755 --- a/test/ppmtoppm.test +++ b/test/ppmtoppm.test @@ -2,4 +2,7 @@ # This script tests: ppmtoppm # Also requires: -${PBM_TESTPREFIX}ppmtoppm < testgrid.pbm | cksum \ No newline at end of file + alias ppmtoppm="${PBM_TESTPREFIX}ppmtoppm" + shopt -s expand_aliases + +ppmtoppm < testgrid.pbm | cksum diff --git a/test/ppmwheel.test b/test/ppmwheel.test index 4d786f26..89bab029 100755 --- a/test/ppmwheel.test +++ b/test/ppmwheel.test @@ -2,12 +2,15 @@ # This script tests: ppmwheel # Also requires: + alias ppmwheel="${PBM_TESTPREFIX}ppmwheel" + shopt -s expand_aliases + # For values 6 and above, x86(-32) and x86-64 produce different output. # SSE floating-point math is the probable cause. for i in 4 5 do -${PBM_TESTPREFIX}ppmwheel $i | cksum +ppmwheel $i | cksum done # i 32 bit 64 bit @@ -110,4 +113,4 @@ done - \ No newline at end of file + diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test index 8ce1689d..8c4cfc2a 100755 --- a/test/ps-alt-roundtrip.test +++ b/test/ps-alt-roundtrip.test @@ -2,6 +2,14 @@ # This script tests: pbmtoepsi pbmtopsg3 pbmtolps psidtopgm pstopnm # Also requires: gs pnmtopnm pnmcrop + alias pbmtoepsi="${PBM_TESTPREFIX}pbmtoepsi" + alias pbmtolps="${PBM_TESTPREFIX}pbmtolps" + alias pbmtopsg3="${PBM_TESTPREFIX}pbmtopsg3" + alias psidtopgm="${PBM_TESTPREFIX}psidtopgm" + alias pstopnm="${PBM_TESTPREFIX}pstopnm" + alias pnmcrop="${PBM_BINPREFIX}pnmcrop" + shopt -s expand_aliases + # This script is for testing alternative (or minor) utilities that # read/write Postscript and encapsulated Postscript: # pbmtoepsi, pbmtopsg3, pbmtolps and psidtopgm. @@ -14,33 +22,35 @@ # If ps-roundtrip.test succeeds and this test fails, it is most likely # a problem with one of the minor utilities, and vice versa. +# pstopnm does not use libnetpbm functions for output. +# Output is filtered through pnmtopnm. # Test 1. Should print: 2425386270 41 -${PBM_TESTPREFIX}pbmtopsg3 -dpi=72 testgrid.pbm \ +pbmtopsg3 -dpi=72 testgrid.pbm \ > ${tmpdir}/testgrid1.ps && \ -${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \ +pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \ -dpi=72 -stdout -quiet -pbm ${tmpdir}/testgrid1.ps | \ - ${PBM_BINPREFIX}pnmcrop | cksum + pnmcrop | cksum # Test 2. Should print: 2425386270 41 -${PBM_TESTPREFIX}pbmtolps -dpi 72 testgrid.pbm \ +pbmtolps -dpi 72 testgrid.pbm \ > ${tmpdir}/testgrid2.ps && \ -${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \ +pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \ -quiet ${tmpdir}/testgrid2.ps -pbm | \ - ${PBM_BINPREFIX}pnmcrop | cksum + pnmcrop | cksum # Test 3. Should print: 2916080186 235 # Output is pgm maxval=1 with black and white inverted. # -${PBM_TESTPREFIX}pbmtoepsi testgrid.pbm > ${tmpdir}/testgrid.epsi && \ +pbmtoepsi testgrid.pbm > ${tmpdir}/testgrid.epsi && \ xysizebps=`awk '/BeginPreview/ {print $2,$3,$4}' \ ${tmpdir}/testgrid.epsi` && \ awk '/^%%BeginPreview:/ { p=1; next } /^%%EndImage/ { p=0; next } \ p==1 && /%[ \t0-9a-fA-F]+/ { print substr($0,2); next } \ p==1 {print "!"$0}' \ - ${tmpdir}/testgrid.epsi | ${PBM_TESTPREFIX}psidtopgm $xysizebps | cksum + ${tmpdir}/testgrid.epsi | psidtopgm $xysizebps | cksum rm ${tmpdir}/testgrid[12].ps ${tmpdir}/testgrid.epsi diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index b7aa816c..3aff4274 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -2,41 +2,53 @@ # This script tests: pnmtops pstopnm # Also requires: pnmtopnm pamtopnm gs pbmmake pnmshear pnmpad pnmcat + alias pnmtops="${PBM_TESTPREFIX}pnmtops" + alias pstopnm="${PBM_TESTPREFIX}pstopnm" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pnmcat="${PBM_BINPREFIX}pnmcat" + alias pnmpad="${PBM_BINPREFIX}pnmpad" + alias pnmshear="${PBM_BINPREFIX}pnmshear" + alias pnmtopnm="${PBM_BINPREFIX}pnmtopnm" + shopt -s expand_aliases + +# pstopnm does not use libnetpbm functions for output. +# Output is filtered through pnmtopnm. + # Test 1. Should print: 1926073387 101484 five times # *NOTE* Fifth iteration fails if pnmtops was compiled without zlib # (flate compression) support. for flag in "" "-ps" "-rle" "-ps -ascii" "-ps -flate" do - ${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn \ + pnmtops -nocenter -equalpixels -dpi 72 -noturn \ ${flag} testimg.ppm \ > ${tmpdir}/testimg.ps xysize1=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ ${tmpdir}/testimg.ps` - ${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize1 -stdout \ + pstopnm -xborder=0 -yborder=0 $xysize1 -stdout \ -quiet ${tmpdir}/testimg.ps | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done # Test 2. Should print: 2918318199 62 seven times # Test image designed to detect problems with run-length compression # -${PBM_BINPREFIX}pbmmake -g 2 2 > ${tmpdir}/g.pbm -${PBM_BINPREFIX}pbmmake -g 8 4 | \ - ${PBM_BINPREFIX}pnmshear 45 -noantialias -background=black | \ - ${PBM_BINPREFIX}pnmpad -right 60 | \ - ${PBM_BINPREFIX}pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && +pbmmake -g 2 2 > ${tmpdir}/g.pbm +pbmmake -g 8 4 | \ + pnmshear 45 -noantialias -background=black | \ + pnmpad -right 60 | \ + pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && for flag in "" "-rle" "-ps -rle -ascii" \ "-bitspersample=2 -rle" "-ps -bitspersample=4 -rle" \ "-bitspersample=8 -rle" "-ps -bitspersample=12 -rle -dict" do - ${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn \ + pnmtops -nocenter -equalpixels -dpi 72 -noturn \ ${flag} ${tmpdir}/t.pbm > ${tmpdir}/testgrid.ps && xysize2=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ ${tmpdir}/testgrid.ps` - ${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize2 -stdout \ + pstopnm -xborder=0 -yborder=0 $xysize2 -stdout \ -quiet ${tmpdir}/testgrid.ps -pbm | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done @@ -56,13 +68,13 @@ for flag in "" "-ps" \ "-ps -bitspersample=12 -flate -rle -vmreclaim" do cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \ -${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ +pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ ${flag} > ${tmpdir}/testimg5.ps xysize3=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \ ${tmpdir}/testimg5.ps` -${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize3 \ +pstopnm -xborder=0 -yborder=0 $xysize3 \ -stdout ${tmpdir}/testimg5.ps | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done diff --git a/test/rgb3-roundtrip.test b/test/rgb3-roundtrip.test index d3575b95..829feab4 100755 --- a/test/rgb3-roundtrip.test +++ b/test/rgb3-roundtrip.test @@ -2,13 +2,20 @@ # This script tests: ppmtorgb3 rgb3toppm # Also requires: pgmtopbm pgmtopgm ppmtopgm + alias ppmtorgb3="${PBM_TESTPREFIX}ppmtorgb3" + alias rgb3toppm="${PBM_TESTPREFIX}rgb3toppm" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias pgmtopgm="${PBM_BINPREFIX}pgmtopgm" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Break an image into three monochrome planes, reassemble the # image from them and check whether the resulting output is # identical to the original input. cp testimg.ppm ${tmpdir} && -${PBM_TESTPREFIX}ppmtorgb3 ${tmpdir}/testimg.ppm && -${PBM_TESTPREFIX}rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn \ +ppmtorgb3 ${tmpdir}/testimg.ppm && +rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn \ ${tmpdir}/testimg.blu | cksum cat ${tmpdir}/testimg.red ${tmpdir}/testimg.grn ${tmpdir}/testimg.blu | \ @@ -17,10 +24,10 @@ cat ${tmpdir}/testimg.red ${tmpdir}/testimg.grn ${tmpdir}/testimg.blu | \ rm ${tmpdir}/testimg.{ppm,red,grn,blu} cp testgrid.pbm ${tmpdir} && -${PBM_TESTPREFIX}ppmtorgb3 ${tmpdir}/testgrid.pbm && -${PBM_TESTPREFIX}rgb3toppm ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn \ +ppmtorgb3 ${tmpdir}/testgrid.pbm && +rgb3toppm ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn \ ${tmpdir}/testgrid.blu | \ - ${PBM_BINPREFIX}ppmtopgm | ${PBM_BINPREFIX}pgmtopbm -th -val=0.5 | cksum + ppmtopgm | pgmtopbm -th -val=0.5 | cksum # With PGM or PBM input, the three monochrome planes should be @@ -28,7 +35,7 @@ ${PBM_TESTPREFIX}rgb3toppm ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn \ cmp -s ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn ; echo $? cmp -s ${tmpdir}/testgrid.grn ${tmpdir}/testgrid.blu ; echo $? -${PBM_BINPREFIX}pgmtopgm < testgrid.pbm | cmp -s - ${tmpdir}/testgrid.red +pgmtopgm < testgrid.pbm | cmp -s - ${tmpdir}/testgrid.red echo $? rm ${tmpdir}/testgrid.{pbm,red,grn,blu} diff --git a/test/sunrast-roundtrip.test b/test/sunrast-roundtrip.test index ee5b25e3..78e4ae15 100755 --- a/test/sunrast-roundtrip.test +++ b/test/sunrast-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pnmtorast rasttopnm # Also requires: + alias pnmtorast="${PBM_TESTPREFIX}pnmtorast" + alias rasttopnm="${PBM_TESTPREFIX}rasttopnm" + shopt -s expand_aliases + # Should produce 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pnmtorast testimg.ppm | ${PBM_TESTPREFIX}rasttopnm | cksum +pnmtorast testimg.ppm | rasttopnm | cksum diff --git a/test/targa-roundtrip.test b/test/targa-roundtrip.test index 3fac1630..4a99e0e0 100755 --- a/test/targa-roundtrip.test +++ b/test/targa-roundtrip.test @@ -2,20 +2,26 @@ # This script tests: pamtotga tgatoppm # Also requires: ppmtopgm pgmtopbm + alias pamtotga="${PBM_TESTPREFIX}pamtotga" + alias tgatoppm="${PBM_TESTPREFIX}tgatoppm" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + #Test 1: Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pamtotga -mono testgrid.pbm | \ - ${PBM_TESTPREFIX}tgatoppm | ${PBM_BINPREFIX}ppmtopgm | \ - ${PBM_BINPREFIX}pgmtopbm -threshold -val 0.5 | cksum +pamtotga -mono testgrid.pbm | \ + tgatoppm | ppmtopgm | \ + pgmtopbm -threshold -val 0.5 | cksum #Test 2: Should print 2871603838 33838, cksum of testimg.pgm -${PBM_BINPREFIX}ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm -${PBM_TESTPREFIX}pamtotga -cmap ${tmpdir}/testimg.pgm | \ - ${PBM_TESTPREFIX}tgatoppm | ${PBM_BINPREFIX}ppmtopgm | cksum +ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm +pamtotga -cmap ${tmpdir}/testimg.pgm | \ + tgatoppm | ppmtopgm | cksum rm ${tmpdir}/testimg.pgm #Test 3: Should print 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pamtotga -rgb testimg.ppm | ${PBM_TESTPREFIX}tgatoppm | cksum +pamtotga -rgb testimg.ppm | tgatoppm | cksum diff --git a/test/tiff-roundtrip.test b/test/tiff-roundtrip.test index e7f875cf..09520f14 100755 --- a/test/tiff-roundtrip.test +++ b/test/tiff-roundtrip.test @@ -2,19 +2,23 @@ # This script tests: pamtotiff tifftopnm # Also requires: -${PBM_TESTPREFIX}pamtotiff testimg.ppm 1<>${tmpdir}/test1.tiff && - ${PBM_TESTPREFIX}tifftopnm ${tmpdir}/test1.tiff | cksum + alias pamtotiff="${PBM_TESTPREFIX}pamtotiff" + alias tifftopnm="${PBM_TESTPREFIX}tifftopnm" + shopt -s expand_aliases + +pamtotiff testimg.ppm 1<>${tmpdir}/test1.tiff && + tifftopnm ${tmpdir}/test1.tiff | cksum # test flate compression # Will fail if Netpbm was built without the flate library -${PBM_TESTPREFIX}pamtotiff -flate testimg.ppm 1<>${tmpdir}/test2.tiff && - ${PBM_TESTPREFIX}tifftopnm ${tmpdir}/test2.tiff | cksum +pamtotiff -flate testimg.ppm 1<>${tmpdir}/test2.tiff && + tifftopnm ${tmpdir}/test2.tiff | cksum -${PBM_TESTPREFIX}pamtotiff testgrid.pbm 1<>${tmpdir}/test3.tiff && - ${PBM_TESTPREFIX}tifftopnm ${tmpdir}/test3.tiff | cksum +pamtotiff testgrid.pbm 1<>${tmpdir}/test3.tiff && + tifftopnm ${tmpdir}/test3.tiff | cksum # test G4 compression -${PBM_TESTPREFIX}pamtotiff -g4 testgrid.pbm 1<>${tmpdir}/test4.tiff && - ${PBM_TESTPREFIX}tifftopnm ${tmpdir}/test4.tiff | cksum +pamtotiff -g4 testgrid.pbm 1<>${tmpdir}/test4.tiff && + tifftopnm ${tmpdir}/test4.tiff | cksum rm ${tmpdir}/test[1234].tiff diff --git a/test/utahrle-roundtrip.test b/test/utahrle-roundtrip.test index 7113a2d5..83bc6c90 100755 --- a/test/utahrle-roundtrip.test +++ b/test/utahrle-roundtrip.test @@ -2,13 +2,18 @@ # This script tests: pnmtorle rletopnm # Also requires: ppmtopgm + alias pnmtorle="${PBM_TESTPREFIX}pnmtorle" + alias rletopnm="${PBM_TESTPREFIX}rletopnm" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + #Test 1. Should print 2871603838 33838, cksum of testimg.pgm -${PBM_BINPREFIX}ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm -${PBM_TESTPREFIX}pnmtorle ${tmpdir}/testimg.pgm | \ - ${PBM_TESTPREFIX}rletopnm | cksum +ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm +pnmtorle ${tmpdir}/testimg.pgm | \ + rletopnm | cksum rm ${tmpdir}/testimg.pgm #Test 2. Should print 1926073387 101484, cksum of testimg.ppm -${PBM_TESTPREFIX}pnmtorle testimg.ppm | \ - ${PBM_TESTPREFIX}rletopnm | cksum +pnmtorle testimg.ppm | \ + rletopnm | cksum diff --git a/test/wbmp-roundtrip.test b/test/wbmp-roundtrip.test index bab2b6a5..40988635 100755 --- a/test/wbmp-roundtrip.test +++ b/test/wbmp-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtowbmp wbmptopbm # Also requires: + alias pbmtowbmp="${PBM_TESTPREFIX}pbmtowbmp" + alias wbmptopbm="${PBM_TESTPREFIX}wbmptopbm" + shopt -s expand_aliases + # Should print 2425386270 41, cksum of testgrid.pbm -${PBM_TESTPREFIX}pbmtowbmp testgrid.pbm | ${PBM_TESTPREFIX}wbmptopbm | cksum +pbmtowbmp testgrid.pbm | wbmptopbm | cksum diff --git a/test/winicon-roundtrip.test b/test/winicon-roundtrip.test index f5f2926e..20b0a225 100755 --- a/test/winicon-roundtrip.test +++ b/test/winicon-roundtrip.test @@ -2,12 +2,21 @@ # This script tests: pamtowinicon winicontopam # Also requires: pnmcut pnmtile pamtopnm ppmtopgm pgmtopbm -${PBM_BINPREFIX}pnmcut --left=30 --width=48 --height=48 testimg.ppm | \ -${PBM_TESTPREFIX}pamtowinicon | ${PBM_TESTPREFIX}winicontopam | \ - ${PBM_BINPREFIX}pamtopnm | cksum - -${PBM_BINPREFIX}pnmtile 32 32 testgrid.pbm | \ -${PBM_TESTPREFIX}pamtowinicon | ${PBM_TESTPREFIX}winicontopam | \ - ${PBM_BINPREFIX}pamtopnm | ${PBM_BINPREFIX}ppmtopgm | \ - ${PBM_BINPREFIX}pgmtopbm -th -val=0.5 | cksum + alias pamtowinicon="${PBM_TESTPREFIX}pamtowinicon" + alias winicontopam="${PBM_TESTPREFIX}winicontopam" + alias pamtopnm="${PBM_BINPREFIX}pamtopnm" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias pnmcut="${PBM_BINPREFIX}pnmcut" + alias pnmtile="${PBM_BINPREFIX}pnmtile" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + +pnmcut --left=30 --width=48 --height=48 testimg.ppm | \ +pamtowinicon | winicontopam | \ + pamtopnm | cksum + +pnmtile 32 32 testgrid.pbm | \ +pamtowinicon | winicontopam | \ + pamtopnm | ppmtopgm | \ + pgmtopbm -th -val=0.5 | cksum diff --git a/test/xbm-roundtrip.test b/test/xbm-roundtrip.test index 2dcb5a13..4823adfd 100755 --- a/test/xbm-roundtrip.test +++ b/test/xbm-roundtrip.test @@ -2,5 +2,9 @@ # This script tests: pbmtoxbm xbmtopbm # Also requires: -${PBM_TESTPREFIX}pbmtoxbm testgrid.pbm | ${PBM_TESTPREFIX}xbmtopbm | cksum -${PBM_TESTPREFIX}pbmtoxbm -x10 testgrid.pbm | ${PBM_TESTPREFIX}xbmtopbm | cksum + alias pbmtoxbm="${PBM_TESTPREFIX}pbmtoxbm" + alias xbmtopbm="${PBM_TESTPREFIX}xbmtopbm" + shopt -s expand_aliases + +pbmtoxbm testgrid.pbm | xbmtopbm | cksum +pbmtoxbm -x10 testgrid.pbm | xbmtopbm | cksum diff --git a/test/xpm-roundtrip.test b/test/xpm-roundtrip.test index 310022cc..c3c9894d 100755 --- a/test/xpm-roundtrip.test +++ b/test/xpm-roundtrip.test @@ -2,7 +2,13 @@ # This script tests: ppmtoxpm xpmtoppm # Also requires: pgmtopbm ppmtopgm -#${PBM_TESTPREFIX}ppmtoxpm -hexonly testimg.ppm | \ -# ${PBM_TESTPREFIX}xpmtoppm | cksum -${PBM_TESTPREFIX}ppmtoxpm testgrid.pbm | ${PBM_TESTPREFIX}xpmtoppm | \ - ${PBM_BINPREFIX}ppmtopgm | ${PBM_BINPREFIX}pgmtopbm -th -value=0.5 | cksum + alias ppmtoxpm="${PBM_TESTPREFIX}ppmtoxpm" + alias xpmtoppm="${PBM_TESTPREFIX}xpmtoppm" + alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + +#ppmtoxpm -hexonly testimg.ppm | \ +# xpmtoppm | cksum +ppmtoxpm testgrid.pbm | xpmtoppm | \ + ppmtopgm | pgmtopbm -th -value=0.5 | cksum diff --git a/test/xwd-roundtrip.test b/test/xwd-roundtrip.test index e24db7bc..b5614f01 100755 --- a/test/xwd-roundtrip.test +++ b/test/xwd-roundtrip.test @@ -2,13 +2,21 @@ # This script tests: pnmtoxwd xwdtopnm # Also requires: pamdepth ppmtopgm + alias pnmtoxwd="${PBM_TESTPREFIX}pnmtoxwd" + alias xwdtopnm="${PBM_TESTPREFIX}xwdtopnm" + alias pamdepth="${PBM_BINPREFIX}pamdepth" + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" + shopt -s expand_aliases + # Test 1. Should produce 2871603838 33838 # which is the output of ppmtopgm testimg.ppm | cksum -${PBM_BINPREFIX}ppmtopgm testimg.ppm | ${PBM_TESTPREFIX}pnmtoxwd | \ - ${PBM_TESTPREFIX}xwdtopnm | ${PBM_BINPREFIX}pamdepth 255 | cksum +ppmtopgm testimg.ppm | pnmtoxwd | \ + xwdtopnm | pamdepth 255 | cksum -${PBM_TESTPREFIX}pnmtoxwd --quiet testimg.ppm | \ - ${PBM_TESTPREFIX}xwdtopnm --quiet | ${PBM_BINPREFIX}pamdepth 255 | cksum +# Test 2. Should produce 1926073387 101484 +pnmtoxwd --quiet testimg.ppm | \ + xwdtopnm --quiet | pamdepth 255 | cksum -${PBM_TESTPREFIX}pnmtoxwd --quiet testgrid.pbm | \ - ${PBM_TESTPREFIX}xwdtopnm | cksum +# Test 3. Should produce 2425386270 41 +pnmtoxwd --quiet testgrid.pbm | \ + xwdtopnm | cksum diff --git a/test/yuv-roundtrip.test b/test/yuv-roundtrip.test index 697d86aa..8e0d4f1a 100755 --- a/test/yuv-roundtrip.test +++ b/test/yuv-roundtrip.test @@ -2,8 +2,13 @@ # This script tests: ppmtoyuv yuvtoppm # Also requires: pamgradient + alias ppmtoyuv="${PBM_TESTPREFIX}ppmtoyuv" + alias yuvtoppm="${PBM_TESTPREFIX}yuvtoppm" + alias pamgradient="${PBM_BINPREFIX}pamgradient" + shopt -s expand_aliases + # Should produce 1904478375 253455 -${PBM_BINPREFIX}pamgradient rgb:00/ff/ff rgb:ff/ff/00 \ +pamgradient rgb:00/ff/ff rgb:ff/ff/00 \ rgb:ff/00/00 rgb:00/ff/00 352 240 | \ - ${PBM_TESTPREFIX}ppmtoyuv | ${PBM_TESTPREFIX}yuvtoppm 352 240 | cksum + ppmtoyuv | yuvtoppm 352 240 | cksum |