Lines Matching +full:fail +full:- +full:fast
2 # LZ4 programs - Makefile
3 # Copyright (C) Yann Collet 2011-present
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 # - LZ4 homepage : http://www.lz4.org
23 # - LZ4 source repository : https://github.com/lz4/lz4
37 DEBUGFLAGS = -g -DLZ4_DEBUG=$(DEBUGLEVEL)
38 CFLAGS ?= -O3 # can select custom optimization flags. For example : CFLAGS=-O2 make
39 CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow \
40 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \
41 -Wpointer-arith -Wstrict-aliasing=1
43 CPPFLAGS+= -I$(LZ4DIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
53 FUZZER_TIME := -T90s
54 NB_LOOPS ?= -i1
60 all32: CFLAGS+=-m32
64 $(MAKE) -C $(PRGDIR) $@ CFLAGS="$(CFLAGS)"
67 $(MAKE) -C $(LZ4DIR) $@ CFLAGS="$(CFLAGS)"
72 lz4c32: # create a 32-bits version for 32/64 interop tests
73 $(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)"
76 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
80 $(CC) $(FLAGS) $^ -o $@$(EXT)
83 $(MAKE) -C $(LZ4DIR) liblz4.a
85 fullbench-lib: fullbench.c $(LZ4DIR)/liblz4.a
86 $(CC) $(FLAGS) $^ -o $@$(EXT)
88 fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
89 $(MAKE) -C $(LZ4DIR) liblz4
90 $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/$(LIBLZ4).dll
93 $(CC) $(FLAGS) $^ -o $@$(EXT)
96 $(CC) $(FLAGS) $^ -o $@$(EXT)
99 $(CC) $(FLAGS) $^ -o $@$(EXT)
102 $(CC) $(FLAGS) -I$(PRGDIR) $^ -o $@$(EXT)
105 $(CC) $(FLAGS) $^ -o $@$(EXT)
108 @$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
109 @$(MAKE) -C $(PRGDIR) $@ > $(VOID)
110 @$(RM) -rf core *.o *.test tmp* \
111 fullbench-dll$(EXT) fullbench-lib$(EXT) \
118 @$(RM) -rf $(TESTDIR)
123 $(PYTHON) test-lz4-versions.py
127 QEMU_SYS=$(QEMU_SYS) $(PYTHON) test-lz4-list.py
130 $(CC) $(FLAGS) $< -o $@$(EXT)
132 #-----------------------------------------------------------------------------
134 #-----------------------------------------------------------------------------
139 MD5:=md5 -r
153 …-pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make …
156 test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install test-amalgamation l…
159 test32: CFLAGS+=-m32
162 test-amalgamation: lz4_all.o
165 $(CC) $(CFLAGS) $(CPPFLAGS) -c $^ -o $@
170 test-install: lz4 lib liblz4.pc
173 test-lz4-sparse: lz4 datagen
174 @echo "\n ---- test sparse file support ----"
175 ./datagen -g5M -P100 > tmplsdg5M
176 $(LZ4) -B4D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB4
177 $(DIFF) -s tmplsdg5M tmplscB4
178 $(LZ4) -B5D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB5
179 $(DIFF) -s tmplsdg5M tmplscB5
180 $(LZ4) -B6D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB6
181 $(DIFF) -s tmplsdg5M tmplscB6
182 $(LZ4) -B7D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB7
183 $(DIFF) -s tmplsdg5M tmplscB7
184 $(LZ4) tmplsdg5M -c | $(LZ4) -dv --no-sparse > tmplsnosparse
185 $(DIFF) -s tmplsdg5M tmplsnosparse
186 ls -ls tmpls*
187 …./datagen -s1 -g1200007 -P100 | $(LZ4) | $(LZ4) -dv --sparse > tmplsodd # Odd size file (to gene…
188 ./datagen -s1 -g1200007 -P100 | $(DIFF) -s - tmplsodd
189 ls -ls tmplsodd
192 echo "Hello World 1 !" | $(LZ4) | $(LZ4) -d -c
193 echo "Hello World 2 !" | $(LZ4) | $(LZ4) -d | cat
194 echo "Hello World 3 !" | $(LZ4) --no-frame-crc | $(LZ4) -d -c
196 ./datagen -P100 -g1M > tmplsdg1M
198 $(LZ4) -B5 -v tmplsdg1M tmplsc
199 $(LZ4) -d -v tmplsc tmplsr
200 $(LZ4) -d -v tmplsc -c >> tmplsr
201 ls -ls tmp*
205 test-lz4-contentSize: lz4 datagen
206 @echo "\n ---- test original size support ----"
207 ./datagen -g15M > tmplc1
208 $(LZ4) -v tmplc1 -c | $(LZ4) -t
209 $(LZ4) -v --content-size tmplc1 -c | $(LZ4) -d > tmplc2
210 $(DIFF) -s tmplc1 tmplc2
213 test-lz4-frame-concatenation: lz4 datagen
214 @echo "\n ---- test frame concatenation ----"
215 @echo -n > tmp-lfc-empty
216 @echo hi > tmp-lfc-nonempty
217 cat tmp-lfc-nonempty tmp-lfc-empty tmp-lfc-nonempty > tmp-lfc-src
218 $(LZ4) -zq tmp-lfc-empty -c > tmp-lfc-empty.lz4
219 $(LZ4) -zq tmp-lfc-nonempty -c > tmp-lfc-nonempty.lz4
220 cat tmp-lfc-nonempty.lz4 tmp-lfc-empty.lz4 tmp-lfc-nonempty.lz4 > tmp-lfc-concat.lz4
221 $(LZ4) -d tmp-lfc-concat.lz4 -c > tmp-lfc-result
222 $(CMP) tmp-lfc-src tmp-lfc-result
223 @$(RM) tmp-lfc-*
226 test-lz4-multiple: lz4 datagen
227 @echo "\n ---- test multiple files ----"
228 @./datagen -s1 > tmp-tlm1 2> $(VOID)
229 @./datagen -s2 -g100K > tmp-tlm2 2> $(VOID)
230 @./datagen -s3 -g200K > tmp-tlm3 2> $(VOID)
232 $(LZ4) -f -m tmp-tlm*
233 test -f tmp-tlm1.lz4
234 test -f tmp-tlm2.lz4
235 test -f tmp-tlm3.lz4
237 mv tmp-tlm1 tmp-tlm1-orig
238 mv tmp-tlm2 tmp-tlm2-orig
239 mv tmp-tlm3 tmp-tlm3-orig
240 $(LZ4) -d -f -m tmp-tlm*.lz4
241 $(CMP) tmp-tlm1 tmp-tlm1-orig # must be identical
242 $(CMP) tmp-tlm2 tmp-tlm2-orig
243 $(CMP) tmp-tlm3 tmp-tlm3-orig
245 cat tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 > tmp-tlm-concat1
247 $(LZ4) -m tmp-tlm1 tmp-tlm2 tmp-tlm3 -c > tmp-tlm-concat2
248 test ! -f tmp-tlm1.lz4 # must not create .lz4 artefact
249 $(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
251 $(RM) tmp-tlm-concat1 tmp-tlm-concat2
252 $(LZ4) -f -m tmp-tlm1 tmp-tlm2 tmp-tlm3 # generate .lz4 to decompress
253 cat tmp-tlm1 tmp-tlm2 tmp-tlm3 > tmp-tlm-concat1 # create concatenated reference
254 $(RM) tmp-tlm1 tmp-tlm2 tmp-tlm3
255 $(LZ4) -d -m tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 -c > tmp-tlm-concat2
256 test ! -f tmp-tlm1 # must not create file artefact
257 $(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
258 # compress multiple files, one of which is absent (must fail)
259 ! $(LZ4) -f -m tmp-tlm-concat1 notHere tmp-tlm-concat2 # must fail : notHere not present
260 @$(RM) tmp-tlm*
262 test-lz4-basic: lz4 datagen unlz4 lz4cat
263 @echo "\n ---- test lz4 basic compression/decompression ----"
264 ./datagen -g0 | $(LZ4) -v | $(LZ4) -t
265 ./datagen -g16KB | $(LZ4) -9 | $(LZ4) -t
266 ./datagen -g20KB > tmp-tlb-dg20k
267 $(LZ4) < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
268 $(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
269 $(LZ4) --no-frame-crc < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
270 $(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
271 ./datagen | $(LZ4) -BI | $(LZ4) -t
272 ./datagen -g6M -P99 | $(LZ4) -9BD | $(LZ4) -t
273 ./datagen -g17M | $(LZ4) -9v | $(LZ4) -qt
274 ./datagen -g33M | $(LZ4) --no-frame-crc | $(LZ4) -t
275 ./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
276 @echo "hello world" > tmp-tlb-hw
277 $(LZ4) --rm -f tmp-tlb-hw tmp-tlb-hw.lz4
278 test ! -f tmp-tlb-hw # must fail (--rm)
279 test -f tmp-tlb-hw.lz4
280 $(PRGDIR)/lz4cat tmp-tlb-hw.lz4 # must display hello world
281 test -f tmp-tlb-hw.lz4
282 $(PRGDIR)/unlz4 --rm tmp-tlb-hw.lz4 tmp-tlb-hw
283 test -f tmp-tlb-hw
284 test ! -f tmp-tlb-hw.lz4 # must fail (--rm)
285 test ! -f tmp-tlb-hw.lz4.lz4 # must fail (unlz4)
286 $(PRGDIR)/lz4cat tmp-tlb-hw # pass-through mode
287 test -f tmp-tlb-hw
288 test ! -f tmp-tlb-hw.lz4 # must fail (lz4cat)
289 $(LZ4) tmp-tlb-hw tmp-tlb-hw.lz4 # creates tmp-tlb-hw.lz4
290 $(PRGDIR)/lz4cat < tmp-tlb-hw.lz4 > tmp-tlb3 # checks lz4cat works with stdin (#285)
291 $(DIFF) -q tmp-tlb-hw tmp-tlb3
292 $(PRGDIR)/lz4cat < tmp-tlb-hw > tmp-tlb2 # checks lz4cat works in pass-through mode
293 $(DIFF) -q tmp-tlb-hw tmp-tlb2
294 cp tmp-tlb-hw ./-d
295 $(LZ4) --rm -- -d -d.lz4 # compresses ./d into ./-d.lz4
296 test -f ./-d.lz4
297 test ! -f ./-d
298 mv ./-d.lz4 ./-z
299 $(LZ4) -d --rm -- -z tmp-tlb4 # uncompresses ./-z into tmp-tlb4
300 test ! -f ./-z
301 $(DIFF) -q tmp-tlb-hw tmp-tlb4
302 $(LZ4) -f tmp-tlb-hw
303 $(LZ4) --list tmp-tlb-hw.lz4 # test --list on valid single-frame file
304 cat tmp-tlb-hw >> tmp-tlb-hw.lz4
305 $(LZ4) -f tmp-tlb-hw.lz4 # uncompress valid frame followed by invalid data
306 $(LZ4) -BX tmp-tlb-hw -c -q | $(LZ4) -tv # test block checksum
307 # ./datagen -g20KB generates the same file every single time
308 …annot save output of ./datagen -g20KB as input file to lz4 because the following shell commands ar…
309 …est "$(shell ./datagen -g20KB | $(LZ4) -c --fast | wc -c)" -lt "$(shell ./datagen -g20KB | $(LZ4) …
310 …test "$(shell ./datagen -g20KB | $(LZ4) -c -1 | wc -c)" -lt "$(shell ./datagen -g20KB| $(LZ4) -c -…
311 …./datagen -g20KB | $(LZ4) -c --fast=1 | wc -c)" -eq "$(shell ./datagen -g20KB| $(LZ4) -c --fast| w…
312 ! $(LZ4) -c --fast=0 tmp-tlb-dg20K # lz4 should fail when fast=0
313 ! $(LZ4) -c --fast=-1 tmp-tlb-dg20K # lz4 should fail when fast=-1
315 @echo "TEST" > tmp-tlb-test
316 $(LZ4) -m tmp-tlb-test
317 $(LZ4) tmp-tlb-test.lz4 tmp-tlb-test2
318 $(DIFF) -q tmp-tlb-test tmp-tlb-test2
319 @$(RM) tmp-tlb*
323 test-lz4-dict: lz4 datagen
324 @echo "\n ---- test lz4 compression/decompression with dictionary ----"
325 ./datagen -g16KB > tmp-dict
326 ./datagen -g32KB > tmp-dict-sample-32k
327 < tmp-dict-sample-32k $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-32k
328 ./datagen -g128MB > tmp-dict-sample-128m
329 < tmp-dict-sample-128m $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-128m
330 touch tmp-dict-sample-0
331 < tmp-dict-sample-0 $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-0
333 …< tmp-dict-sample-32k $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict…
334 …< tmp-dict-sample-0 $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-s…
336 @echo "\n ---- test lz4 dictionary loading ----"
337 ./datagen -g128KB > tmp-dict-data-128KB
338 set -e; \
340 ./datagen -g$$l > tmp-dict-$$l; \
341 …$(DD) if=tmp-dict-$$l of=tmp-dict-$$l-tail bs=1 count=65536 skip=$$((l > 65536 ? l - 65536 : 0)); \
342 …< tmp-dict-$$l $(LZ4) -D stdin tmp-dict-data-128KB -c | $(LZ4) -dD tmp-dict-$$l-tail | $(DIFF…
343 …< tmp-dict-$$l-tail $(LZ4) -D stdin tmp-dict-data-128KB -c | $(LZ4) -dD tmp-dict-$$l | $(DIFF…
346 @$(RM) tmp-dict*
348 test-lz4-hugefile: lz4 datagen
349 @echo "\n ---- test huge files compression/decompression ----"
350 ./datagen -g6GB | $(LZ4) -vB5D | $(LZ4) -qt
351 ./datagen -g5GB | $(LZ4) -v4BD | $(LZ4) -qt
352 # test large file size [2-4] GB
353 @./datagen -g3G -P100 | $(LZ4) -vv | $(LZ4) --decompress --force --sparse - tmphf1
354 @ls -ls tmphf1
355 …@./datagen -g3G -P100 | $(LZ4) --quiet --content-size | $(LZ4) --verbose --decompress --force --sp…
356 @ls -ls tmphf2
357 $(DIFF) -s tmphf1 tmphf2
360 test-lz4-testmode: lz4 datagen
361 @echo "\n ---- bench mode ----"
362 $(LZ4) -bi1
363 @echo "\n ---- test mode ----"
364 ! ./datagen | $(LZ4) -t
365 ! ./datagen | $(LZ4) -tf
366 @echo "\n ---- pass-through mode ----"
367 @echo "Why hello there " > tmp-tlt2.lz4
368 ! $(LZ4) -f tmp-tlt2.lz4 > $(VOID)
369 ! ./datagen | $(LZ4) -dc > $(VOID)
370 ! ./datagen | $(LZ4) -df > $(VOID)
371 ./datagen | $(LZ4) -dcf > $(VOID)
372 @echo "Hello World !" > tmp-tlt1
373 $(LZ4) -dcf tmp-tlt1
374 @echo "from underground..." > tmp-tlt2
375 $(LZ4) -dcfm tmp-tlt1 tmp-tlt2
376 @echo "\n ---- non-existing source ----"
377 ! $(LZ4) file-does-not-exist
378 ! $(LZ4) -f file-does-not-exist
379 ! $(LZ4) -t file-does-not-exist
380 ! $(LZ4) -fm file1-dne file2-dne
381 @$(RM) tmp-tlt tmp-tlt1 tmp-tlt2 tmp-tlt2.lz4
383 test-lz4-opt-parser: lz4 datagen
384 @echo "\n ---- test opt-parser ----"
385 ./datagen -g16KB | $(LZ4) -12 | $(LZ4) -t
386 ./datagen -P10 | $(LZ4) -12B4 | $(LZ4) -t
387 ./datagen -g256K | $(LZ4) -12B4D | $(LZ4) -t
388 ./datagen -g512K -P25 | $(LZ4) -12BD | $(LZ4) -t
389 ./datagen -g1M | $(LZ4) -12B5 | $(LZ4) -t
390 ./datagen -g2M -P99 | $(LZ4) -11B4D | $(LZ4) -t
391 ./datagen -g4M | $(LZ4) -11vq | $(LZ4) -qt
392 ./datagen -g8M | $(LZ4) -11B4 | $(LZ4) -t
393 ./datagen -g16M -P90 | $(LZ4) -11B5 | $(LZ4) -t
394 ./datagen -g32M -P10 | $(LZ4) -11B5D | $(LZ4) -t
396 test-lz4-essentials : lz4 datagen test-lz4-basic test-lz4-multiple \
397 test-lz4-frame-concatenation test-lz4-testmode \
398 test-lz4-contentSize test-lz4-dict
401 test-lz4: lz4 datagen test-lz4-essentials test-lz4-opt-parser \
402 test-lz4-sparse test-lz4-hugefile test-lz4-dict
405 test-lz4c: lz4c datagen
406 @echo "\n ---- test lz4c variant ----"
407 ./datagen -g256MB | $(LZ4)c -l -v | $(LZ4)c -t
409 test-lz4c32: CFLAGS+=-m32
410 test-lz4c32: test-lz4
412 test-interop-32-64: lz4 lz4c32 datagen
413 @echo "\n ---- test interoperability 32-bits -vs- 64 bits ----"
414 ./datagen -g16KB | $(LZ4)c32 -9 | $(LZ4) -t
415 ./datagen -P10 | $(LZ4) -9B4 | $(LZ4)c32 -t
416 ./datagen | $(LZ4)c32 | $(LZ4) -t
417 ./datagen -g1M | $(LZ4) -3B5 | $(LZ4)c32 -t
418 ./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4) -qt
419 ./datagen -g1G -P90 | $(LZ4) | $(LZ4)c32 -t
420 ./datagen -g6GB | $(LZ4)c32 -vq9BD | $(LZ4) -qt
422 test-lz4c32-basic: lz4c32 datagen
423 @echo "\n ---- test lz4c32 32-bits version ----"
424 ./datagen -g16KB | $(LZ4)c32 -9 | $(LZ4)c32 -t
425 ./datagen | $(LZ4)c32 | $(LZ4)c32 -t
426 ./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4)c32 -qt
427 ./datagen -g6GB | $(LZ4)c32 -vqB5D | $(LZ4)c32 -qt
429 test-platform:
430 @echo "\n ---- test lz4 $(QEMU_SYS) platform ----"
431 $(QEMU_SYS) ./datagen -g16KB | $(QEMU_SYS) $(LZ4) -9 | $(QEMU_SYS) $(LZ4) -t
432 $(QEMU_SYS) ./datagen | $(QEMU_SYS) $(LZ4) | $(QEMU_SYS) $(LZ4) -t
433 $(QEMU_SYS) ./datagen -g256MB | $(QEMU_SYS) $(LZ4) -vqB4D | $(QEMU_SYS) $(LZ4) -qt
434 ifneq ($(QEMU_SYS),qemu-arm-static)
435 $(QEMU_SYS) ./datagen -g3GB | $(QEMU_SYS) $(LZ4) -vqB5D | $(QEMU_SYS) $(LZ4) -qt
438 test-fullbench: fullbench
439 ./fullbench --no-prompt $(NB_LOOPS) $(TEST_FILES)
441 test-fullbench32: CFLAGS += -m32
442 test-fullbench32: test-fullbench
444 test-fuzzer: fuzzer
447 test-fuzzer32: CFLAGS += -m32
448 test-fuzzer32: test-fuzzer
450 test-frametest: frametest
451 ./frametest -v $(FUZZER_TIME)
453 test-frametest32: CFLAGS += -m32
454 test-frametest32: test-frametest
456 test-mem: lz4 datagen fuzzer frametest fullbench
457 @echo "\n ---- valgrind tests : memory analyzer ----"
458 valgrind --leak-check=yes --error-exitcode=1 ./datagen -g50M > $(VOID)
459 ./datagen -g16KB > ftmdg16K
460 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -BD -f ftmdg16K $(VOID)
461 ./datagen -g16KB -s2 > ftmdg16K2
462 ./datagen -g16KB -s3 > ftmdg16K3
463 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --force --multiple ftmdg16K ftmdg16K2 ftmdg16K3
464 ./datagen -g7MB > ftmdg7M
465 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -B5D -f ftmdg7M ftmdg16K2
466 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -t ftmdg16K2
467 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -bi1 ftmdg7M
468 valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1 ftmdg7M ftmdg16K2
469 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -B4D -f -vq ftmdg7M $(VOID)
470 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --list -m ftm*.lz4
471 valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --list -m -v ftm*.lz4
473 valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i64 -t1
474 valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256
476 test-mem32: lz4c32 datagen
477 # unfortunately, valgrind doesn't seem to work with non-native binary...