netpbm-10.76.00-test.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. automatically skip tests of disabled tools
  2. --- GNUmakefile
  3. +++ GNUmakefile
  4. @@ -455,6 +458,21 @@ deb:
  5. .PHONY: check-package
  6. .PHONY: check-install
  7. +# Variables from the make env we pass down to the test scripts.
  8. +CHECK_VARS = \
  9. + BUILDDIR=$(BUILDDIR) \
  10. + RGBDEF=$(RGBDEF) \
  11. + BUILD_FIASCO=$(BUILD_FIASCO) \
  12. + JASPERLIB="$(JASPERLIB)" \
  13. + JBIGLIB="$(JBIGLIB)" \
  14. + JPEGLIB="$(JPEGLIB)" \
  15. + PNGLIB="$(PNGLIB)" \
  16. + TIFFLIB="$(TIFFLIB)" \
  17. + URTLIB="$(URTLIB)" \
  18. + X11LIB="$(X11LIB)" \
  19. + XML2_LIBS="$(XML2_LIBS)" \
  20. + ZLIB="$(ZLIB)"
  21. +
  22. # Test files in source tree.
  23. check-tree : BUILDBINDIRS :=./analyzer \
  24. @@ -525,10 +543,10 @@ resultdir-backup: FORCE
  25. check-tree: $(TESTRANDOM) resultdir-backup
  26. cd $(RESULTDIR); \
  27. + $(CHECK_VARS) \
  28. CHECK_TYPE=tree \
  29. - PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
  30. + PBM_TEST_PATH=$(PBM_TEST_PATH) \
  31. LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
  32. - RGBDEF=$(RGBDEF) \
  33. $(SRCDIR)/test/Execute-Tests 2>&1
  34. # Execute-Tests needs to know BUILDDIR in order to locate testrandom.
  35. @@ -545,19 +563,18 @@ check: check-package
  36. check-package: $(TESTRANDOM) resultdir-backup
  37. cd $(RESULTDIR); \
  38. + $(CHECK_VARS) \
  39. CHECK_TYPE=package \
  40. - PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
  41. + PBM_TEST_PATH=$(PBM_TEST_PATH) \
  42. LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
  43. - RGBDEF=$(RGBDEF) \
  44. $(SRCDIR)/test/Execute-Tests 2>&1
  45. # Check after install
  46. check-install: $(TESTRANDOM) resultdir-backup
  47. cd $(RESULTDIR); \
  48. + $(CHECK_VARS) \
  49. CHECK_TYPE=install \
  50. - BUILDDIR=$(BUILDDIR) \
  51. - RGBDEF=$(RGBDEF) \
  52. $(SRCDIR)/test/Execute-Tests 2>&1
  53. --- test/all-in-place.test
  54. +++ test/all-in-place.test
  55. @@ -367,11 +367,62 @@ ordinary_testprogs="\
  56. zeisstopnm \
  57. "
  58. +enabled_testprog() {
  59. + case $1 in
  60. + fiascotopnm|\
  61. + pnmtofiasco)
  62. + [ "${BUILD_FIASCO}" = "N" ] && return 1 ;;
  63. +
  64. + jpeg2ktopam|\
  65. + pamtojpeg2k)
  66. + [ "${JASPERLIB}" = "NONE" ] && return 1 ;;
  67. +
  68. + jbigtopnm|\
  69. + pnmtojbig)
  70. + [ "${JBIGLIB}" = "NONE" ] && return 1 ;;
  71. +
  72. + jpegtopnm|\
  73. + pnmtojpeg|\
  74. + ppmtojpeg)
  75. + [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
  76. +
  77. + pamtopng|\
  78. + pngtopam|\
  79. + pnmtopng)
  80. + [ "${PNGLIB}" = "NONE" ] && return 1 ;;
  81. +
  82. + svgtopam)
  83. + [ "${PNGLIB}" = "NONE" ] && return 1
  84. + [ "${XML2_LIBS}" = "NONE" ] && return 1
  85. + ;;
  86. +
  87. + pamtotiff|\
  88. + pnmtotiffcmyk|\
  89. + tifftopnm)
  90. + [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
  91. +
  92. + pnmtorle|\
  93. + rletopnm)
  94. + [ "${URTLIB}" = "NONE" ] && return 1 ;;
  95. +
  96. + pamx)
  97. + [ "${X11LIB}" = "NONE" ] && return 1 ;;
  98. + esac
  99. +
  100. + return 0
  101. +}
  102. +
  103. # The string "fiascotopnm" has to be filtered out by egrep for fiascotopnm
  104. # has a slightly different version report format.
  105. for i in $ordinary_testprogs
  106. do
  107. + # Stub out programs that aren't built.
  108. + if ! enabled_testprog "$i"; then
  109. + echo "$i: ok"
  110. + continue
  111. + fi
  112. +
  113. $i --version 2>&1 | \
  114. egrep -v -e fiascotopnm -e \
  115. "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
  116. --- test/fiasco-roundtrip.test
  117. +++ test/fiasco-roundtrip.test
  118. @@ -2,6 +2,10 @@
  119. # This script tests: pnmtofiasco fiascotopnm
  120. # Also requires: pnmpad
  121. +if [ "${BUILD_FIASCO}" = "N" ]; then
  122. + exit 80
  123. +fi
  124. +
  125. # Should print 215556145 102615
  126. pnmpad --black --bottom 1 --left 1 testimg.ppm | \
  127. --- test/jbig-roundtrip.test
  128. +++ test/jbig-roundtrip.test
  129. @@ -2,6 +2,9 @@
  130. # This script tests: pnmtojbig jbigtopnm
  131. # Also requires: pamchannel pamtopnm
  132. +if [ "${JBIGLIB}" = "NONE" ]; then
  133. + exit 80
  134. +fi
  135. # Test 1. Should print 2425386270 41
  136. pnmtojbig testgrid.pbm | jbigtopnm | cksum
  137. --- test/legacy-names.test
  138. +++ test/legacy-names.test
  139. @@ -94,8 +94,30 @@ ordinary_testprogs="\
  140. ppmtouil \
  141. "
  142. +enabled_testprog() {
  143. + case $1 in
  144. + ppmtojpeg)
  145. + [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
  146. +
  147. + pamrgbatopng|\
  148. + pngtopnm)
  149. + [ "${PNGLIB}" = "NONE" ] && return 1 ;;
  150. +
  151. + pnmtotiff)
  152. + [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
  153. + esac
  154. +
  155. + return 0
  156. +}
  157. +
  158. for i in $ordinary_testprogs
  159. do
  160. + # Stub out programs that aren't built.
  161. + if ! enabled_testprog "$i"; then
  162. + echo "$i: ok"
  163. + continue
  164. + fi
  165. +
  166. $i --version 2>&1 | \
  167. egrep -v \
  168. "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
  169. --- test/png-roundtrip.test
  170. +++ test/png-roundtrip.test
  171. @@ -6,6 +6,10 @@
  172. ## If this test fails and pnm-roundtrip2.test succeeds, it indicates
  173. ## some problem with pnmtopng.
  174. +if [ "${PNGLIB}" = "NONE" ]; then
  175. + exit 80
  176. +fi
  177. +
  178. # Test 1. Should print 1926073387 101484 18 times
  179. for flags in "" -interlace \
  180. -gamma=.45 \
  181. --- test/png-roundtrip2.test
  182. +++ test/png-roundtrip2.test
  183. @@ -9,6 +9,10 @@
  184. ## If both tests fail, the likely cause is a problem with pngtopam.
  185. ## It is also possible that there is some problem in libpng.
  186. +if [ "${PNGLIB}" = "NONE" ]; then
  187. + exit 80
  188. +fi
  189. +
  190. # Test 1. Should print 1926073387 101484 twice
  191. for flags in "" -gamma=.45
  192. do
  193. --- test/ps-roundtrip.test
  194. +++ test/ps-roundtrip.test
  195. @@ -8,6 +8,10 @@
  196. ## (1) zlib was not linked.
  197. ## (2) ghostscript is not available.
  198. +if [ "${ZLIB}" = "NONE" ]; then
  199. + exit 80
  200. +fi
  201. +
  202. tmpdir=${tmpdir:-/tmp}
  203. # pstopnm does not use libnetpbm functions for output.
  204. --- test/tiff-roundtrip.test
  205. +++ test/tiff-roundtrip.test
  206. @@ -2,6 +2,9 @@
  207. # This script tests: pamtotiff tifftopnm
  208. # Also requires:
  209. +if [ "${TIFFLIB}" = "NONE" ]; then
  210. + exit 80
  211. +fi
  212. # Failure message
  213. ## Second test fails if Netpbm was built without the flate library
  214. --- test/utahrle-roundtrip.test
  215. +++ test/utahrle-roundtrip.test
  216. @@ -2,6 +2,9 @@
  217. # This script tests: pnmtorle rletopnm
  218. # Also requires: pamchannel pamtopnm
  219. +if [ "${URTLIB}" = "NONE" ]; then
  220. + exit 80
  221. +fi
  222. #Test 1. Should produce 1571496937 33838, cksum of testimg.red
  223. pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \