]> granicus.if.org Git - imagemagick/commitdiff
Validation tests for magick pipes
authoranthony <anthony@git.imagemagick.org>
Mon, 9 Apr 2012 07:01:45 +0000 (07:01 +0000)
committeranthony <anthony@git.imagemagick.org>
Mon, 9 Apr 2012 07:01:45 +0000 (07:01 +0000)
tests/validate-pipe.sh

index 77c1453045784db5807c4444dc303b268f75e415..ccfd30203e2ac068db2c0ce8078f4bf919a9f715 100755 (executable)
 set -e # Exit on any error
 . ${srcdir}/tests/common.sh
 
-${MAGICK} pnm:- 'null:' < ${REFERENCE_IMAGE}
+${MAGICK} pnm:- null:   < ${REFERENCE_IMAGE}
+${MAGICK} pnm:- info:   < ${REFERENCE_IMAGE}
 ${MAGICK} pnm:- miff:-  < ${REFERENCE_IMAGE} | ${IDENTIFY} -
-${MAGICK} pnm:- -  < ${REFERENCE_IMAGE} | ${IDENTIFY} -
-${MAGICK} - 'null:' < ${REFERENCE_IMAGE}
-${MAGICK} - miff:-  < ${REFERENCE_IMAGE} | ${IDENTIFY} -
-${MAGICK} - -  < ${REFERENCE_IMAGE} | ${IDENTIFY} -
-${MAGICK} ${REFERENCE_IMAGE} - | ${IDENTIFY} -
-${MAGICK} ${REFERENCE_IMAGE} miff:- | ${IDENTIFY} -
+${MAGICK} pnm:- -       < ${REFERENCE_IMAGE} | ${IDENTIFY} -
+${MAGICK} ${REFERENCE_IMAGE} -write null:  null:
+${MAGICK} ${REFERENCE_IMAGE} -write info:  null:
+${MAGICK} ${REFERENCE_IMAGE} -write miff:- null: | ${IDENTIFY} -
+${MAGICK} ${REFERENCE_IMAGE} -write -      null: | ${IDENTIFY} -
+
+# IMv7 "magick" testing
+
+# -exit can be used insted of implicit write
+${MAGICK} ${REFERENCE_IMAGE} -write info: -exit
+# null: does not require an image during write
+${MAGICK} -write null: -exit
+${MAGICK} ${REFERENCE_IMAGE} -write info: +delete null:
+# Using file decriptors (write)
+${MAGICK} ${REFERENCE_IMAGE} fd:6  6>&1 | ${IDENTIFY} -
+# Using file decriptors (read)
+exec 5<${REFERENCE_IMAGE}
+${MAGICK} fd:5 info:
+exec 5<&-
+# pipelined magick script
+echo "-read ${REFERENCE_IMAGE} -write info:" | ${MAGICK} -script -
+# pipelined magick script, input image pre-read
+echo "-write info:" | ${MAGICK} ${REFERENCE_IMAGE} -script -
+# pipelined script from file descriptor, read image from stdin
+echo "-read pnm:- -write info:" |\
+   ${MAGICK} -script fd:5 5<&0 <${REFERENCE_IMAGE}
+