Debian Codegraph @

tests/makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # Regression-test suite for the giflib library and tools
2 # All utilities have tests except gifbg, gifcolor, and gifhisto.
3
4 .SUFFIXES: .gif .rgb
5
6 # This is what to do by default
7 test:
8 @$(MAKE) --quiet tap | ./tapview
9
10 tap:
11 @$(MAKE) --quiet tapstream | tee taplog$$$$; echo "1..$$(grep ok taplog$$$$ | wc -l)"; rm taplog$$$$
12
13 tapstream: render-regress \
14 gif2rgb-regress \
15 gifbuild-regress \
16 gifclrmp-regress \
17 gifecho-regress \
18 giffilter-regress \
19 giffix-regress \
20 gifinto-regress \
21 gifsponge-regress \
22 giftext-regress \
23 giftool-regress \
24 gifwedge-regress
25
26 rebuild: render-rebuild \
27 gif2rgb-rebuild \
28 gifclrmp-rebuild \
29 gifecho-rebuild \
30 giffix-rebuild \
31 gifinto-rebuild \
32 giftext-rebuild \
33 gifwedge-rebuild
34
35 UTILS = ..
36 PICS = ../pic
37 GIF2RGB = ../gif2rgb
38
39 $(GIF2RGB):
40 @$(MAKE) -C .. gif2rgb
41
42 GIFS := $(shell ls ../pic/*.gif)
43
44 # Test decompression and rendering by unpacking images,
45 # converting them to RGB, and comparing that result to a check file.
46 render-regress: $(GIF2RGB)
47 @for test in $(GIFS); \
48 do \
49 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
50 $(UTILS)/gif2rgb -1 <$${test} | ./cmpdiffer "gif2rgb: test of $${test}" $${stem}.rgb; \
51 done
52 render-rebuild: $(GIF2RGB)
53 @for test in $(GIFS); do \
54 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
55 echo "Remaking $${stem}.rgb"; \
56 $(UTILS)/gif2rgb -1 -o $${stem}.rgb $${test}; \
57 done
58
59 gif2rgb-regress: $(GIF2RGB)
60 @$(UTILS)/gif2rgb -c 3 -s 100 100 <gifgrid.rgb | $(UTILS)/gifbuild -d | sed "/sort flag/s/off/on/" | ./tapdiffer "checking gif2rgb idempotency" gifgrid.ico
61 gif2rgb-rebuild: $(GIF2RGB)
62 @echo "Rebuilding gif2rgb checkfile."
63 @$(UTILS)/gif2rgb -c 3 -s 100 100 <gifgrid.rgb | $(UTILS)/gifbuild -d >gifgrid.ico
64
65 gifbuild-regress:
66 @$(UTILS)/gifbuild -d <$(PICS)/treescap.gif | ./tapdiffer "gifbuild: basic sanity check" treescap.ico
67 @$(UTILS)/gifbuild <$(PICS)/sample.ico | $(UTILS)/gifbuild -d > [email protected]; $(UTILS)/gifbuild < [email protected] | $(UTILS)/gifbuild -d > [email protected];
68 @./tapdiffer <[email protected] "gifbuild: Checking idempotency on an icon file." [email protected]; rm [email protected]?.ico
69 @$(UTILS)/gifbuild -d <$(PICS)/fire.gif > [email protected]
70 @$(UTILS)/gifbuild < [email protected] > [email protected]
71 @$(UTILS)/gifbuild -d < [email protected] > [email protected]
72 @./tapdiffer <[email protected] "gifbuild: Checking idempotency on an animation." [email protected]
73 @rm -f [email protected] [email protected] [email protected]
74
75 gifclrmp-regress:
76 @for test in $(GIFS); \
77 do \
78 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
79 if ! $(UTILS)/gifclrmp <$${test} > $@.$${stem}.regress 2>&1; \
80 then \
81 echo "not ok - gifclrmap: crashed on $${test}"; \
82 else \
83 ./tapdiffer <$@.$${stem}.regress "gifclrmap: Checking colormap of $${test}" $${stem}.map; \
84 fi \
85 done
86 @rm -f $@.*.regress
87 gifclrmp-rebuild:
88 @for test in $(GIFS); do \
89 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
90 echo "Remaking $${stem}.map"; \
91 $(UTILS)/gifclrmp <$${test} >$${stem}.map; \
92 done
93
94 gifecho-rebuild:
95 @echo "Rebuilding gifecho test."
96 @$(UTILS)/gifecho -t "foobar" | $(UTILS)/gifbuild -d >foobar.ico
97 gifecho-regress:
98 @$(UTILS)/gifecho -t "foobar" | $(UTILS)/gifbuild -d | ./tapdiffer "gifecho: Testing gifecho behavior" foobar.ico
99
100 giffilter-regress: $(GIF2RGB)
101 @for test in $(GIFS); \
102 do \
103 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
104 $(UTILS)/giffilter <$${test} | $(UTILS)/gif2rgb | ./cmpdiffer "giffiltr: copy of $${test}" "$${stem}.rgb"; \
105 done
106
107 giffix-rebuild:
108 @echo "Rebuilding giffix test."
109 @head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d >giffixed.ico
110 giffix-regress:
111 @head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d | ./tapdiffer "giffix: Testing giffix behavior" giffixed.ico
112
113 gifinto-regress:
114 @rm -f [email protected]
115 @$(UTILS)/gifinto <$(PICS)/porsche.gif [email protected]
116 @if test ! -f [email protected]; then echo "not ok - gifinto failed to create a file when it should have."; fi
117 @rm -f [email protected]
118 @echo "0123456789" | $(UTILS)/gifinto [email protected] 2>/dev/null
119 @if test -f [email protected]; \
120 then \
121 echo "not ok - gifinto created a file when it shouldn't have."; \
122 else \
123 echo "ok - gifinto correctly refrained from file creation."; \
124 fi
125 @rm -f [email protected]
126
127 gifsponge-regress: $(GIF2RGB)
128 @for test in $(GIFS); \
129 do \
130 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
131 $(UTILS)/gifsponge <$${test} | $(UTILS)/gif2rgb | ./cmpdiffer "gifsponge: sink of $${test}" $${stem}.rgb; \
132 done
133
134 giftext-regress:
135 @for test in $(GIFS); \
136 do \
137 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
138 $(UTILS)/giftext <$${test} | ./cmpdiffer "text dump of $${test}" $${stem}.dmp; \
139 done
140 giftext-rebuild:
141 @for test in $(GIFS); do \
142 stem=`basename $${test} | sed -e "s/.gif$$//"`; \
143 echo "Remaking $${stem}.dmp"; \
144 $(UTILS)/giftext <$${test} >$${stem}.dmp; \
145 done
146
147 giftool-regress: $(GIF2RGB)
148 @$(UTILS)/giftool <$(PICS)/gifgrid.gif | $(UTILS)/gif2rgb | ./cmpdiffer "giftool: expensive copy via giftool" gifgrid.rgb
149 @$(UTILS)/giftool -i on <$(PICS)/treescap-interlaced.gif | $(UTILS)/gif2rgb | ./cmpdiffer "giftool: deinterlace" treescap.rgb
150 @$(UTILS)/giftool -i off <$(PICS)/treescap.gif | $(UTILS)/gif2rgb | ./cmpdiffer "giftool: interlace" treescap-interlaced.rgb
151
152 gifwedge-rebuild:
153 @echo "Remaking the gifwedge test."
154 @$(UTILS)/gifwedge >wedge.gif
155 gifwedge-regress:
156 @$(UTILS)/gifwedge | ./cmpdiffer "gifwedge: wedge generation." wedge.gif