3 # Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
4 # dedicated to making software imaging solutions freely available.
6 # You may not use this file except in compliance with the License. You may
7 # obtain a copy of the License at
9 # http://www.imagemagick.org/script/license.php
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Test for 'validate' utility.
19 set -e # Exit on any error
20 [ "X$srcdir" = "X" ] && srcdir=`pwd`
21 . ${srcdir}/tests/common.shi
24 ${MAGICK} pnm:- null: < ${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
25 ${MAGICK} pnm:- info: < ${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
26 ${MAGICK} pnm:- miff:- < ${SRCDIR}/rose.pnm | ${IDENTIFY} - && echo "ok" || echo "not ok"
27 ${MAGICK} pnm:- - < ${SRCDIR}/rose.pnm | ${IDENTIFY} - && echo "ok" || echo "not ok"
28 ${MAGICK} ${SRCDIR}/rose.pnm -write null: null: && echo "ok" || echo "not ok"
29 ${MAGICK} ${SRCDIR}/rose.pnm -write info: null: && echo "ok" || echo "not ok"
30 ${MAGICK} ${SRCDIR}/rose.pnm -write miff:- null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
31 ${MAGICK} ${SRCDIR}/rose.pnm -write - null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
33 # IMv7 "magick" testing
35 ${MAGICK} -read ${SRCDIR}/rose.pnm info: && echo "ok" || echo "not ok"
36 # -exit can be used insted of implicit write
37 ${MAGICK} ${SRCDIR}/rose.pnm -write info: -exit && echo "ok" || echo "not ok"
38 # null: does not require an image during write
39 ${MAGICK} -write null: -exit && echo "ok" || echo "not ok"
40 # implied write null: without image
41 ${MAGICK} ${SRCDIR}/rose.pnm -write info: +delete null: && echo "ok" || echo "not ok"
42 # Write to file decriptor
43 ${MAGICK} ${SRCDIR}/rose.pnm fd:6 6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok"
44 # Read from file decriptor
45 exec 5<${SRCDIR}/rose.pnm
46 ${MAGICK} fd:5 info: && echo "ok" || echo "not ok"
48 # pipelined magick script
49 echo "-read ${SRCDIR}/rose.pnm -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok"
50 # pipelined magick script, input image pre-read
51 echo "-write info:" | ${MAGICK} ${SRCDIR}/rose.pnm -script - && echo "ok" || echo "not ok"
52 # pipelined script from file descriptor, read image from stdin
53 echo "-read pnm:- -write info:" |\
54 ${MAGICK} -script fd:5 5<&0 <${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"