summaryrefslogtreecommitdiff
path: root/media-libs/netpbm/files/netpbm-10.76.00-test.patch
blob: 870998bc98a8af46add8978659fa815a93a4f22b (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
automatically skip tests of disabled tools

--- GNUmakefile
+++ GNUmakefile
@@ -455,6 +458,21 @@ deb:
 .PHONY: check-package
 .PHONY: check-install
 
+# Variables from the make env we pass down to the test scripts.
+CHECK_VARS = \
+	BUILDDIR=$(BUILDDIR) \
+	RGBDEF=$(RGBDEF) \
+	BUILD_FIASCO=$(BUILD_FIASCO) \
+	JASPERLIB="$(JASPERLIB)" \
+	JBIGLIB="$(JBIGLIB)" \
+	JPEGLIB="$(JPEGLIB)" \
+	PNGLIB="$(PNGLIB)" \
+	TIFFLIB="$(TIFFLIB)" \
+	URTLIB="$(URTLIB)" \
+	X11LIB="$(X11LIB)" \
+	XML2_LIBS="$(XML2_LIBS)" \
+	ZLIB="$(ZLIB)"
+
 # Test files in source tree.
 
 check-tree : BUILDBINDIRS :=./analyzer \
@@ -525,10 +543,10 @@ resultdir-backup: FORCE
 
 check-tree: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=tree \
-	  PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
+	  PBM_TEST_PATH=$(PBM_TEST_PATH) \
 	  LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 # Execute-Tests needs to know BUILDDIR in order to locate testrandom.
@@ -545,19 +563,18 @@ check: check-package
 
 check-package: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=package \
-	  PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
+	  PBM_TEST_PATH=$(PBM_TEST_PATH) \
 	  LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 
 # Check after install
 check-install: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=install \
-	  BUILDDIR=$(BUILDDIR) \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 
--- test/all-in-place.test
+++ test/all-in-place.test
@@ -367,11 +367,62 @@ ordinary_testprogs="\
   zeisstopnm \
 "
 
+enabled_testprog() {
+    case $1 in
+      fiascotopnm|\
+      pnmtofiasco)
+        [ "${BUILD_FIASCO}" = "N" ] && return 1 ;;
+
+      jpeg2ktopam|\
+      pamtojpeg2k)
+        [ "${JASPERLIB}" = "NONE" ] && return 1 ;;
+
+      jbigtopnm|\
+      pnmtojbig)
+        [ "${JBIGLIB}" = "NONE" ] && return 1 ;;
+
+      jpegtopnm|\
+      pnmtojpeg|\
+      ppmtojpeg)
+        [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
+
+      pamtopng|\
+      pngtopam|\
+      pnmtopng)
+        [ "${PNGLIB}" = "NONE" ] && return 1 ;;
+
+      svgtopam)
+        [ "${PNGLIB}" = "NONE" ] && return 1
+        [ "${XML2_LIBS}" = "NONE" ] && return 1
+        ;;
+
+      pamtotiff|\
+      pnmtotiffcmyk|\
+      tifftopnm)
+        [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
+
+      pnmtorle|\
+      rletopnm)
+        [ "${URTLIB}" = "NONE" ] && return 1 ;;
+
+      pamx)
+        [ "${X11LIB}" = "NONE" ] && return 1 ;;
+    esac
+
+    return 0
+}
+
 # The string "fiascotopnm" has to be filtered out by egrep for fiascotopnm
 # has a slightly different version report format.
 
 for i in $ordinary_testprogs
   do
+    # Stub out programs that aren't built.
+    if ! enabled_testprog "$i"; then
+      echo "$i: ok"
+      continue
+    fi
+
     $i --version  2>&1 | \
     egrep -v -e fiascotopnm -e \
     "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
--- test/fiasco-roundtrip.test
+++ test/fiasco-roundtrip.test
@@ -2,6 +2,10 @@
 # This script tests: pnmtofiasco fiascotopnm
 # Also requires: pnmpad
 
+if [ "${BUILD_FIASCO}" = "N" ]; then
+  exit 80
+fi
+
 # Should print 215556145 102615
 
 pnmpad --black --bottom 1 --left 1 testimg.ppm | \
--- test/jbig-roundtrip.test
+++ test/jbig-roundtrip.test
@@ -2,6 +2,9 @@
 # This script tests: pnmtojbig jbigtopnm
 # Also requires: pamchannel pamtopnm
 
+if [ "${JBIGLIB}" = "NONE" ]; then
+  exit 80
+fi
 
 # Test 1.  Should print 2425386270 41
 pnmtojbig testgrid.pbm | jbigtopnm | cksum
--- test/legacy-names.test
+++ test/legacy-names.test
@@ -94,8 +94,30 @@ ordinary_testprogs="\
   ppmtouil \
 "
 
+enabled_testprog() {
+    case $1 in
+      ppmtojpeg)
+        [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
+
+      pamrgbatopng|\
+      pngtopnm)
+        [ "${PNGLIB}" = "NONE" ] && return 1 ;;
+
+      pnmtotiff)
+        [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
+    esac
+
+    return 0
+}
+
 for i in $ordinary_testprogs
   do
+    # Stub out programs that aren't built.
+    if ! enabled_testprog "$i"; then
+      echo "$i: ok"
+      continue
+    fi
+
     $i --version  2>&1 | \
     egrep -v \
     "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
--- test/png-roundtrip.test
+++ test/png-roundtrip.test
@@ -6,6 +6,10 @@
 ## If this test fails and pnm-roundtrip2.test succeeds, it indicates
 ## some problem with pnmtopng.
 
+if [ "${PNGLIB}" = "NONE" ]; then
+  exit 80
+fi
+
 # Test 1.  Should print 1926073387 101484 18 times
 for flags in "" -interlace \
   -gamma=.45 \
--- test/png-roundtrip2.test
+++ test/png-roundtrip2.test
@@ -9,6 +9,10 @@
 ## If both tests fail, the likely cause is a problem with pngtopam.
 ## It is also possible that there is some problem in libpng.
 
+if [ "${PNGLIB}" = "NONE" ]; then
+  exit 80
+fi
+
 # Test 1.  Should print 1926073387 101484 twice
 for flags in "" -gamma=.45
   do
--- test/ps-roundtrip.test
+++ test/ps-roundtrip.test
@@ -8,6 +8,10 @@
 ## (1) zlib was not linked.
 ## (2) ghostscript is not available.
 
+if [ "${ZLIB}" = "NONE" ]; then
+  exit 80
+fi
+
 tmpdir=${tmpdir:-/tmp}
 
 # pstopnm does not use libnetpbm functions for output.
--- test/tiff-roundtrip.test
+++ test/tiff-roundtrip.test
@@ -2,6 +2,9 @@
 # This script tests: pamtotiff tifftopnm
 # Also requires:
 
+if [ "${TIFFLIB}" = "NONE" ]; then
+  exit 80
+fi
 
 # Failure message
 ## Second test fails if Netpbm was built without the flate library
--- test/utahrle-roundtrip.test
+++ test/utahrle-roundtrip.test
@@ -2,6 +2,9 @@
 # This script tests: pnmtorle rletopnm
 # Also requires: pamchannel pamtopnm
 
+if [ "${URTLIB}" = "NONE" ]; then
+  exit 80
+fi
 
 #Test 1.  Should produce 1571496937 33838, cksum of testimg.red
 pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \