cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 1 | #!/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 | # |
| 19 | set -e # Exit on any error |
| 20 | [ "X$srcdir" = "X" ] && srcdir=`pwd` |
| 21 | . ${srcdir}/tests/common.shi |
cristy | 8391c6a | 2012-08-21 15:25:07 +0000 | [diff] [blame] | 22 | echo "1..17" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 23 | |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 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" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 32 | |
| 33 | # IMv7 "magick" testing |
| 34 | # -read option |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 35 | ${MAGICK} -read ${SRCDIR}/rose.pnm info: && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 36 | # -exit can be used insted of implicit write |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 37 | ${MAGICK} ${SRCDIR}/rose.pnm -write info: -exit && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 38 | # null: does not require an image during write |
cristy | 8391c6a | 2012-08-21 15:25:07 +0000 | [diff] [blame] | 39 | ${MAGICK} -write null: -exit && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 40 | # implied write null: without image |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 41 | ${MAGICK} ${SRCDIR}/rose.pnm -write info: +delete null: && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 42 | # Write to file decriptor |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 43 | ${MAGICK} ${SRCDIR}/rose.pnm fd:6 6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 44 | # Read from file decriptor |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 45 | exec 5<${SRCDIR}/rose.pnm |
cristy | 8391c6a | 2012-08-21 15:25:07 +0000 | [diff] [blame] | 46 | ${MAGICK} fd:5 info: && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 47 | exec 5<&- |
| 48 | # pipelined magick script |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 49 | echo "-read ${SRCDIR}/rose.pnm -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 50 | # pipelined magick script, input image pre-read |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 51 | echo "-write info:" | ${MAGICK} ${SRCDIR}/rose.pnm -script - && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 52 | # pipelined script from file descriptor, read image from stdin |
| 53 | echo "-read pnm:- -write info:" |\ |
cristy | 7359776 | 2012-10-06 01:03:59 +0000 | [diff] [blame^] | 54 | ${MAGICK} -script fd:5 5<&0 <${SRCDIR}/rose.pnm && echo "ok" || echo "not ok" |
cristy | 19a2b0d | 2012-08-21 11:46:58 +0000 | [diff] [blame] | 55 | : |