]> granicus.if.org Git - imagemagick/blob - tests/cli-pipe.tap
(no commit message)
[imagemagick] / tests / cli-pipe.tap
1 #!/bin/sh
2 #
3 #  Copyright 1999-2015 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 . ./common.shi
20 . ${srcdir}/tests/common.shi
21 echo "1..17"
22
23 ${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"
31
32 # IMv7 "magick" testing
33 # -read option
34 ${MAGICK} -read ${SRCDIR}/rose.pnm info: && echo "ok" || echo "not ok"
35 # -exit can be used insted of implicit write
36 ${MAGICK} ${SRCDIR}/rose.pnm -write info: -exit && echo "ok" || echo "not ok"
37 # null: does not require an image during write
38 ${MAGICK} -write null: -exit && echo "ok" || echo "not ok"
39 # implied write null: without image
40 ${MAGICK} ${SRCDIR}/rose.pnm -write info: +delete null: && echo "ok" || echo "not ok"
41 # Write to file decriptor
42 ${MAGICK} ${SRCDIR}/rose.pnm fd:6  6>&1 | ${IDENTIFY} - && echo "ok" || echo "not ok"
43 # Read from file decriptor
44 exec 5<${SRCDIR}/rose.pnm
45 ${MAGICK} fd:5 info: && echo "ok" || echo "not ok"
46 exec 5<&-
47 # pipelined magick script
48 echo "-read ${SRCDIR}/rose.pnm -write info:" | ${MAGICK} -script - && echo "ok" || echo "not ok"
49 # pipelined magick script, input image pre-read
50 echo "-write info:" | ${MAGICK} ${SRCDIR}/rose.pnm -script - && echo "ok" || echo "not ok"
51 # pipelined script from file descriptor, read image from stdin
52 echo "-read pnm:- -write info:" |\
53    ${MAGICK} -script fd:5 5<&0 <${SRCDIR}/rose.pnm && echo "ok" || echo "not ok"
54 :