diff options
Diffstat (limited to 'test/ps-alt-roundtrip.test')
-rwxr-xr-x | test/ps-alt-roundtrip.test | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test index 8c4cfc2a..d61e55d9 100755 --- a/test/ps-alt-roundtrip.test +++ b/test/ps-alt-roundtrip.test @@ -19,38 +19,49 @@ # # pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding. # -# If ps-roundtrip.test succeeds and this test fails, it is most likely -# a problem with one of the minor utilities, and vice versa. +# Failure message +## If ps-roundtrip.test succeeds and this test fails, it is most likely +## a problem with one of the alternate Postscipt utilities: +## pbmtoepsi, pbmtopsg3, pbmtolps or psidtopgm. +## If both tests fail it indicates a problem with pstopnm or gs. # pstopnm does not use libnetpbm functions for output. # Output is filtered through pnmtopnm. # Test 1. Should print: 2425386270 41 +testgrid1_ps=${tmpdir}/testgrid1.ps + pbmtopsg3 -dpi=72 testgrid.pbm \ - > ${tmpdir}/testgrid1.ps && \ + > ${testgrid1_ps} && \ pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \ - -dpi=72 -stdout -quiet -pbm ${tmpdir}/testgrid1.ps | \ + -dpi=72 -stdout -quiet -pbm ${testgrid1_ps} | \ pnmcrop | cksum +rm ${testgrid1_ps} + # Test 2. Should print: 2425386270 41 +testgrid2_ps=${tmpdir}/testgrid2.ps + pbmtolps -dpi 72 testgrid.pbm \ - > ${tmpdir}/testgrid2.ps && \ + > ${testgrid2_ps} && \ pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \ - -quiet ${tmpdir}/testgrid2.ps -pbm | \ + -quiet ${testgrid2_ps} -pbm | \ pnmcrop | cksum +rm ${testgrid2_ps} # Test 3. Should print: 2916080186 235 # Output is pgm maxval=1 with black and white inverted. # -pbmtoepsi testgrid.pbm > ${tmpdir}/testgrid.epsi && \ +testgrid_epsi=${tmpdir}/testgrid.epsi + +pbmtoepsi testgrid.pbm > ${testgrid_epsi} && \ xysizebps=`awk '/BeginPreview/ {print $2,$3,$4}' \ - ${tmpdir}/testgrid.epsi` && \ + ${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 | psidtopgm $xysizebps | cksum - + ${testgrid_epsi} | psidtopgm $xysizebps | cksum -rm ${tmpdir}/testgrid[12].ps ${tmpdir}/testgrid.epsi +rm ${testgrid_epsi} |