about summary refs log tree commit diff
path: root/test/stdin-ppm1.test
blob: 67d5da4984d866ca80446e86f25ffb55ee03dc2b (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
#! /bin/sh
# This script tests: ppmchange ppmcolormask ppmdim ppmdist ppmdither ppmflash
# This script tests: ppmglobe ppmhist ppmlabel ppmntsc ppmrelief ppmshadow
# This script tests: ppmshift ppmspread ppmtv
# Also requires: ppmpat

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

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

for testprog in  \
        ppmchange \
        "ppmcolormask -color=rgb:0/0/ff " \
        "ppmdim 0.5 " \
        ppmdist \
        ppmdither \
        "ppmflash 0.5 " \
        "ppmglobe 12 " \
        ppmhist \
        ppmlabel \
        ppmntsc \
        ppmrelief \
        ppmshadow \
        "ppmshift 2 -seed=1 " \
        "ppmspread 2 -randomseed=1 " \
        "ppmtv 0.5 "
  do
  ${testprog} ${test_ppm} > ${out1};      status1=$?
  ${testprog} < ${test_ppm} > ${out2};    status2=$?
  cmp -s ${out1} ${out2}
  echo ${testprog}": "${status1} ${status2} $?
  rm ${out1} ${out2}
  done

rm ${test_ppm}

# These utlities do not have a counterpart "ppmto*" program

# Gouldtoppm
# Imgtoppm
# Mtvtoppm
# Pc1toppm
# Pgmtoppm
# Qrttoppm
# Rawtoppm
# Sldtoppm
# Spctoppm
# Ximtoppm

# Tgatoppm -> Pamtotga
# Xvminitoppm -> Pamtoxvmini

# Ppm3d and Ppmmix require input two files
# Ppmfade produces a series of output files