blob: ac34d1bd67bb218c836f07cfbf375392608284cd [file] [log] [blame]
cristy19a2b0d2012-08-21 11:46:58 +00001#!/bin/sh
2#
Cristy7ce65e72015-12-12 18:03:16 -05003# Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
cristy19a2b0d2012-08-21 11:46:58 +00004# 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#
cristy3a350cf2012-12-29 22:54:19 +000019. ./common.shi
cristy19a2b0d2012-08-21 11:46:58 +000020. ${srcdir}/tests/common.shi
cristy8391c6a2012-08-21 15:25:07 +000021echo "1..17"
cristy19a2b0d2012-08-21 11:46:58 +000022
cristy73597762012-10-06 01:03:59 +000023${MAGICK} pnm:- null: < ${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
24${MAGICK} pnm:- info: < ${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
25${MAGICK} pnm:- miff:- < ${SRCDIR}/rose.pnm | ${IDENTIFY} - && echo "ok" || echo "not ok"
26${MAGICK} pnm:- - < ${SRCDIR}/rose.pnm | ${IDENTIFY} - && echo "ok" || echo "not ok"
27${MAGICK} ${SRCDIR}/rose.pnm -write null: null: && echo "ok" || echo "not ok"
28${MAGICK} ${SRCDIR}/rose.pnm -write info: null: && echo "ok" || echo "not ok"
29${MAGICK} ${SRCDIR}/rose.pnm -write miff:- null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
30${MAGICK} ${SRCDIR}/rose.pnm -write - null: | ${IDENTIFY} - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000031
32# IMv7 "magick" testing
33# -read option
cristy73597762012-10-06 01:03:59 +000034${MAGICK} -read ${SRCDIR}/rose.pnm info: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000035# -exit can be used insted of implicit write
cristy73597762012-10-06 01:03:59 +000036${MAGICK} ${SRCDIR}/rose.pnm -write info: -exit && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000037# null: does not require an image during write
cristy8391c6a2012-08-21 15:25:07 +000038${MAGICK} -write null: -exit && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000039# implied write null: without image
cristy73597762012-10-06 01:03:59 +000040${MAGICK} ${SRCDIR}/rose.pnm -write info: +delete null: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000041# Write to file decriptor
cristy73597762012-10-06 01:03:59 +000042${MAGICK} ${SRCDIR}/rose.pnm fd:6 6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000043# Read from file decriptor
cristy73597762012-10-06 01:03:59 +000044exec 5<${SRCDIR}/rose.pnm
cristy8391c6a2012-08-21 15:25:07 +000045${MAGICK} fd:5 info: && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000046exec 5<&-
47# pipelined magick script
cristy73597762012-10-06 01:03:59 +000048echo "-read ${SRCDIR}/rose.pnm -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000049# pipelined magick script, input image pre-read
cristy73597762012-10-06 01:03:59 +000050echo "-write info:" | ${MAGICK} ${SRCDIR}/rose.pnm -script - && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000051# pipelined script from file descriptor, read image from stdin
52echo "-read pnm:- -write info:" |\
cristy73597762012-10-06 01:03:59 +000053 ${MAGICK} -script fd:5 5<&0 <${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
cristy19a2b0d2012-08-21 11:46:58 +000054: