about summary refs log tree commit diff
path: root/test/stdin-pnm1.test
blob: 20902d4135b5478e2cc7df9cb72bc1ea00baec7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/sh
# This script tests: pnmalias pnmcolormap pnmconvol pnmcrop pnmgamma
# This script tests: pnmhisteq pnmhistmap pnminvert pnmmargin pnmmercator
# This script tests: pnmmontage pnmnlfilt pnmnorm pnmpad pnmquant pnmrotate
# This script tests: pnmscalefixed pnmshear pnmsmooth pnmtile pnmtoddif
# This script tests: pnmtopclxl
# Also requires: ppmpat

tmpdir=${tmpdir:-/tmp}
small_ppm=${tmpdir}/test.ppm
out1=${tmpdir}/out1
out2=${tmpdir}/out2

ppmpat -g2 -color=rgb:00/00/ff,rgb:ff/00/00 -mesh 4 4 > ${small_ppm}

for testprog in  \
        pnmalias \
        "pnmcolormap all " \
        "pnmconvol -matrix=-1,3,-1 " \
        pnmcrop \
        "pnmgamma -ungamma 0.5 " \
        pnmhisteq \
        pnmhistmap \
        pnminvert \
        "pnmmargin 2 " \
        pnmmercator \
        pnmmontage \
        "pnmnlfilt 0.5 0.5 " \
        pnmnorm \
        pnmpad \
        "pnmquant 64 " \
        "pnmrotate 90 " \
        "pnmscalefixed 1 " \
        "pnmshear 45 " \
        pnmsmooth \
        "pnmtile 4 4 " \
	pnmtoddif \
	"pnmtopclxl -colorok "
  do
  ${testprog} ${small_ppm} > ${out1};      status1=$?
  ${testprog} < ${small_ppm} > ${out2};    status2=$?
  test -s ${out1};                         status3=$?
  cmp -s ${out1} ${out2}
  echo ${testprog}": "${status1} ${status2} ${status3} $?
  rm ${out1} ${out2}
  done


rm ${small_ppm}

# Pnmquantall: overwrites input files
# Pnmremap: requires -mapfile=file
# Pnmpsnr : compares two input files
# Pnmindex: no input from stdin
# Pnmpaste: requires two input files
# Pnmstitch: requires two input files

# pnmmargin: uses pamflip
# pnmsmooth: uses pnmconvol