blob: 49fa69c3716b3aed475f77059b627382edc87294 [file] [log] [blame]
cristy19a2b0d2012-08-21 11:46:58 +00001#!/bin/sh
2#
3# Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
4# dedicated to making software imaging solutions freely available.
5#
6# You may not use this file except in compliance with the License. You may
7# obtain a copy of the License at
8#
9# http://www.imagemagick.org/script/license.php
10#
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.
16#
17# Test for 'validate' utility.
18#
19set -e # Exit on any error
20[ "X$srcdir" = "X" ] && srcdir=`pwd`
21. ${srcdir}/tests/common.shi
cristy8391c6a2012-08-21 15:25:07 +000022echo "1..17"
cristy19a2b0d2012-08-21 11:46:58 +000023
cristy73597762012-10-06 01:03:59 +000024${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"
cristy19a2b0d2012-08-21 11:46:58 +000032
33# IMv7 "magick" testing
34# -read option
cristy73597762012-10-06 01:03:59 +000035${MAGICK} -read ${SRCDIR}/rose.pnm info: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000036# -exit can be used insted of implicit write
cristy73597762012-10-06 01:03:59 +000037${MAGICK} ${SRCDIR}/rose.pnm -write info: -exit && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000038# null: does not require an image during write
cristy8391c6a2012-08-21 15:25:07 +000039${MAGICK} -write null: -exit && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000040# implied write null: without image
cristy73597762012-10-06 01:03:59 +000041${MAGICK} ${SRCDIR}/rose.pnm -write info: +delete null: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000042# Write to file decriptor
cristy73597762012-10-06 01:03:59 +000043${MAGICK} ${SRCDIR}/rose.pnm fd:6 6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000044# Read from file decriptor
cristy73597762012-10-06 01:03:59 +000045exec 5<${SRCDIR}/rose.pnm
cristy8391c6a2012-08-21 15:25:07 +000046${MAGICK} fd:5 info: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000047exec 5<&-
48# pipelined magick script
cristy73597762012-10-06 01:03:59 +000049echo "-read ${SRCDIR}/rose.pnm -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000050# pipelined magick script, input image pre-read
cristy73597762012-10-06 01:03:59 +000051echo "-write info:" | ${MAGICK} ${SRCDIR}/rose.pnm -script - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000052# pipelined script from file descriptor, read image from stdin
53echo "-read pnm:- -write info:" |\
cristy73597762012-10-06 01:03:59 +000054 ${MAGICK} -script fd:5 5<&0 <${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000055: