blob: ff4f3830c55dc551ebf2181bcb1eaac5aea32674 [file] [log] [blame]
#!/bin/sh
#
# Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
# dedicated to making software imaging solutions freely available.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://www.imagemagick.org/script/license.php
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Test for 'validate' utility.
#
set -e # Exit on any error
[ "X$srcdir" = "X" ] && srcdir=`pwd`
. ${srcdir}/tests/common.shi
echo "1..17"
${MAGICK} pnm:- null: < ${REFERENCE_IMAGE} && echo "ok" || echo "not ok"
${MAGICK} pnm:- info: < ${REFERENCE_IMAGE} && echo "ok" || echo "not ok"
${MAGICK} pnm:- miff:- < ${REFERENCE_IMAGE} | ${IDENTIFY} - && echo "ok" || echo "not ok"
${MAGICK} pnm:- - < ${REFERENCE_IMAGE} | ${IDENTIFY} - && echo "ok" || echo "not ok"
${MAGICK} ${REFERENCE_IMAGE} -write null: null: && echo "ok" || echo "not ok"
${MAGICK} ${REFERENCE_IMAGE} -write info: null: && echo "ok" || echo "not ok"
${MAGICK} ${REFERENCE_IMAGE} -write miff:- null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
${MAGICK} ${REFERENCE_IMAGE} -write - null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
# IMv7 "magick" testing
# -read option
${MAGICK} -read ${REFERENCE_IMAGE} info: && echo "ok" || echo "not ok"
# -exit can be used insted of implicit write
${MAGICK} ${REFERENCE_IMAGE} -write info: -exit && echo "ok" || echo "not ok"
# null: does not require an image during write
${MAGICK} -write null: -exit && echo "ok" || echo "not ok"
# implied write null: without image
${MAGICK} ${REFERENCE_IMAGE} -write info: +delete null: && echo "ok" || echo "not ok"
# Write to file decriptor
${MAGICK} ${REFERENCE_IMAGE} fd:6 6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok"
# Read from file decriptor
exec 5<${REFERENCE_IMAGE}
${MAGICK} fd:5 info: && echo "ok" || echo "not ok"
exec 5<&-
# pipelined magick script
echo "-read ${REFERENCE_IMAGE} -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok"
# pipelined magick script, input image pre-read
echo "-write info:" | ${MAGICK} ${REFERENCE_IMAGE} -script - && echo "ok" || echo "not ok"
# pipelined script from file descriptor, read image from stdin
echo "-read pnm:- -write info:" |\
${MAGICK} -script fd:5 5<&0 <${REFERENCE_IMAGE} && echo "ok" || echo "not ok"
: