Home | History | Annotate | Download | only in tests
      1 # ##########################################################################
      2 # LZ4 programs - Makefile
      3 # Copyright (C) Yann Collet 2011-present
      4 #
      5 # GPL v2 License
      6 #
      7 # This program is free software; you can redistribute it and/or modify
      8 # it under the terms of the GNU General Public License as published by
      9 # the Free Software Foundation; either version 2 of the License, or
     10 # (at your option) any later version.
     11 #
     12 # This program is distributed in the hope that it will be useful,
     13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 # GNU General Public License for more details.
     16 #
     17 # You should have received a copy of the GNU General Public License along
     18 # with this program; if not, write to the Free Software Foundation, Inc.,
     19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     20 #
     21 # You can contact the author at :
     22 #  - LZ4 homepage : http://www.lz4.org
     23 #  - LZ4 source repository : https://github.com/lz4/lz4
     24 # ##########################################################################
     25 # fuzzer  : Test tool, to check lz4 integrity on target platform
     26 # frametest  : Test tool, to check lz4frame integrity on target platform
     27 # fullbench  : Precisely measure speed for each LZ4 function variant
     28 # datagen : generates synthetic data samples for tests & benchmarks
     29 # ##########################################################################
     30 
     31 LZ4DIR  := ../lib
     32 PRGDIR  := ../programs
     33 TESTDIR := versionsTest
     34 PYTHON  ?= python3
     35 
     36 DEBUGLEVEL?= 1
     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
     42 CFLAGS  += $(DEBUGFLAGS) $(MOREFLAGS)
     43 CPPFLAGS+= -I$(LZ4DIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
     44 FLAGS    = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
     45 
     46 
     47 # Define *.exe as extension for Windows systems
     48 ifneq (,$(filter Windows%,$(OS)))
     49 EXT  =.exe
     50 VOID = nul
     51 else
     52 EXT  =
     53 VOID = /dev/null
     54 endif
     55 LZ4 := $(PRGDIR)/lz4$(EXT)
     56 
     57 
     58 # Default test parameters
     59 TEST_FILES   := COPYING
     60 FUZZER_TIME  := -T90s
     61 NB_LOOPS     ?= -i1
     62 
     63 
     64 default: all
     65 
     66 all: fullbench fuzzer frametest roundTripTest datagen
     67 
     68 all32: CFLAGS+=-m32
     69 all32: all
     70 
     71 lz4:
     72 	$(MAKE) -C $(PRGDIR) $@ CFLAGS="$(CFLAGS)"
     73 
     74 lib liblz4.pc:
     75 	$(MAKE) -C $(LZ4DIR) $@ CFLAGS="$(CFLAGS)"
     76 
     77 lz4c unlz4 lz4cat: lz4
     78 	ln -sf $(LZ4) $(PRGDIR)/$@
     79 
     80 lz4c32:   # create a 32-bits version for 32/64 interop tests
     81 	$(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)"
     82 
     83 %.o : $(LZ4DIR)/%.c $(LZ4DIR)/%.h
     84 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
     85 
     86 fullbench : DEBUGLEVEL=0
     87 fullbench : lz4.o lz4hc.o lz4frame.o xxhash.o fullbench.c
     88 	$(CC) $(FLAGS) $^ -o $@$(EXT)
     89 
     90 $(LZ4DIR)/liblz4.a:
     91 	$(MAKE) -C $(LZ4DIR) liblz4.a
     92 
     93 fullbench-lib: fullbench.c $(LZ4DIR)/liblz4.a
     94 	$(CC) $(FLAGS) $^ -o $@$(EXT)
     95 
     96 fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
     97 	$(MAKE) -C $(LZ4DIR) liblz4
     98 	$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.dll
     99 
    100 fuzzer  : lz4.o lz4hc.o xxhash.o fuzzer.c
    101 	$(CC) $(FLAGS) $^ -o $@$(EXT)
    102 
    103 frametest: lz4frame.o lz4.o lz4hc.o xxhash.o frametest.c
    104 	$(CC) $(FLAGS) $^ -o $@$(EXT)
    105 
    106 roundTripTest : lz4.o lz4hc.o xxhash.o roundTripTest.c
    107 	$(CC) $(FLAGS) $^ -o $@$(EXT)
    108 
    109 datagen : $(PRGDIR)/datagen.c datagencli.c
    110 	$(CC) $(FLAGS) -I$(PRGDIR) $^ -o $@$(EXT)
    111 
    112 clean:
    113 	@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
    114 	@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
    115 	@$(RM) core *.o *.test tmp* \
    116         fullbench-dll$(EXT) fullbench-lib$(EXT) \
    117         fullbench$(EXT) fullbench32$(EXT) \
    118         fuzzer$(EXT) fuzzer32$(EXT) \
    119         frametest$(EXT) frametest32$(EXT) \
    120         fasttest$(EXT) roundTripTest$(EXT) \
    121         datagen$(EXT) checkTag$(EXT)
    122 	@rm -fR $(TESTDIR)
    123 	@echo Cleaning completed
    124 
    125 .PHONY: versionsTest
    126 versionsTest:
    127 	$(PYTHON) test-lz4-versions.py
    128 
    129 checkTag: checkTag.c $(LZ4DIR)/lz4.h
    130 	$(CC) $(FLAGS) $< -o $@$(EXT)
    131 
    132 
    133 #-----------------------------------------------------------------------------
    134 # validated only for Linux, OSX, BSD, Hurd and Solaris targets
    135 #-----------------------------------------------------------------------------
    136 ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD))
    137 
    138 MD5:=md5sum
    139 ifneq (,$(filter $(shell uname), Darwin ))
    140 MD5:=md5 -r
    141 endif
    142 
    143 DIFF:=diff
    144 ifneq (,$(filter $(shell uname),SunOS))
    145 DIFF:=gdiff
    146 endif
    147 
    148 DD:=dd
    149 
    150 
    151 test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install
    152 
    153 test32: CFLAGS+=-m32
    154 test32: test
    155 
    156 test-install: lz4 lib liblz4.pc
    157 	lz4_root=.. ./test_install.sh
    158 
    159 test-lz4-sparse: lz4 datagen
    160 	@echo "\n ---- test sparse file support ----"
    161 	./datagen -g5M  -P100 > tmplsdg5M
    162 	$(LZ4) -B4D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB4
    163 	$(DIFF) -s tmplsdg5M tmplscB4
    164 	$(LZ4) -B5D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB5
    165 	$(DIFF) -s tmplsdg5M tmplscB5
    166 	$(LZ4) -B6D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB6
    167 	$(DIFF) -s tmplsdg5M tmplscB6
    168 	$(LZ4) -B7D tmplsdg5M | $(LZ4) -dv --sparse > tmplscB7
    169 	$(DIFF) -s tmplsdg5M tmplscB7
    170 	$(LZ4) tmplsdg5M | $(LZ4) -dv --no-sparse > tmplsnosparse
    171 	$(DIFF) -s tmplsdg5M tmplsnosparse
    172 	ls -ls tmpls*
    173 	./datagen -s1 -g1200007 -P100 | $(LZ4) | $(LZ4) -dv --sparse > tmplsodd   # Odd size file (to generate non-full last block)
    174 	./datagen -s1 -g1200007 -P100 | $(DIFF) -s - tmplsodd
    175 	ls -ls tmplsodd
    176 	@$(RM) tmpls*
    177 	@echo "\n Compatibility with Console :"
    178 	echo "Hello World 1 !" | $(LZ4) | $(LZ4) -d -c
    179 	echo "Hello World 2 !" | $(LZ4) | $(LZ4) -d | cat
    180 	echo "Hello World 3 !" | $(LZ4) --no-frame-crc | $(LZ4) -d -c
    181 	@echo "\n Compatibility with Append :"
    182 	./datagen -P100 -g1M > tmplsdg1M
    183 	cat tmplsdg1M tmplsdg1M > tmpls2M
    184 	$(LZ4) -B5 -v tmplsdg1M tmplsc
    185 	$(LZ4) -d -v tmplsc tmplsr
    186 	$(LZ4) -d -v tmplsc >> tmplsr
    187 	ls -ls tmp*
    188 	$(DIFF) tmpls2M tmplsr
    189 	@$(RM) tmpls*
    190 
    191 test-lz4-contentSize: lz4 datagen
    192 	@echo "\n ---- test original size support ----"
    193 	./datagen -g15M > tmplc1
    194 	$(LZ4) -v tmplc1 | $(LZ4) -t
    195 	$(LZ4) -v --content-size tmplc1 | $(LZ4) -d > tmplc2
    196 	$(DIFF) -s tmplc1 tmplc2
    197 	@$(RM) tmplc*
    198 
    199 test-lz4-frame-concatenation: lz4 datagen
    200 	@echo "\n ---- test frame concatenation ----"
    201 	@echo -n > tmp-lfc-empty
    202 	@echo hi > tmp-lfc-nonempty
    203 	cat tmp-lfc-nonempty tmp-lfc-empty tmp-lfc-nonempty > tmp-lfc-src
    204 	@$(LZ4) -zq tmp-lfc-empty > tmp-lfc-empty.lz4
    205 	@$(LZ4) -zq tmp-lfc-nonempty > tmp-lfc-nonempty.lz4
    206 	cat tmp-lfc-nonempty.lz4 tmp-lfc-empty.lz4 tmp-lfc-nonempty.lz4 > tmp-lfc-concat.lz4
    207 	$(LZ4) -d tmp-lfc-concat.lz4 > tmp-lfc-result
    208 	sdiff tmp-lfc-src tmp-lfc-result
    209 	@$(RM) tmp-lfc-*
    210 	@echo frame concatenation test completed
    211 
    212 test-lz4-multiple: lz4 datagen
    213 	@echo "\n ---- test multiple files ----"
    214 	@./datagen -s1        > tmp-tlm1 2> $(VOID)
    215 	@./datagen -s2 -g100K > tmp-tlm2 2> $(VOID)
    216 	@./datagen -s3 -g1M   > tmp-tlm3 2> $(VOID)
    217 	$(LZ4) -f -m tmp-tlm*
    218 	ls -ls tmp-tlm*
    219 	@$(RM) tmp-tlm1 tmp-tlm2 tmp-tlm3
    220 	$(LZ4) -df -m tmp-tlm*.lz4
    221 	ls -ls tmp-tlm*
    222 	$(LZ4) -f -m tmp-tlm1 notHere tmp-tlm2; echo $$?
    223 	@$(RM) tmp-tlm*
    224 
    225 test-lz4-basic: lz4 datagen unlz4 lz4cat
    226 	@echo "\n ---- test lz4 basic compression/decompression ----"
    227 	./datagen -g0       | $(LZ4) -v     | $(LZ4) -t
    228 	./datagen -g16KB    | $(LZ4) -9     | $(LZ4) -t
    229 	./datagen -g20KB > tmp-tlb-dg20k
    230 	$(LZ4) < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
    231 	$(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
    232 	$(LZ4) --no-frame-crc < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
    233 	$(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
    234 	./datagen           | $(LZ4)        | $(LZ4) -t
    235 	./datagen -g6M -P99 | $(LZ4) -9BD   | $(LZ4) -t
    236 	./datagen -g17M     | $(LZ4) -9v    | $(LZ4) -qt
    237 	./datagen -g33M     | $(LZ4) --no-frame-crc | $(LZ4) -t
    238 	./datagen -g256MB   | $(LZ4) -vqB4D | $(LZ4) -t
    239 	@echo "hello world" > tmp-tlb-hw
    240 	$(LZ4) --rm -f tmp-tlb-hw tmp-tlb-hw.lz4
    241 	test ! -f tmp-tlb-hw                      # must fail (--rm)
    242 	test   -f tmp-tlb-hw.lz4
    243 	$(PRGDIR)/lz4cat tmp-tlb-hw.lz4           # must display hello world
    244 	test   -f tmp-tlb-hw.lz4
    245 	$(PRGDIR)/unlz4 --rm tmp-tlb-hw.lz4 tmp-tlb-hw
    246 	test   -f tmp-tlb-hw
    247 	test ! -f tmp-tlb-hw.lz4                  # must fail (--rm)
    248 	test ! -f tmp-tlb-hw.lz4.lz4              # must fail (unlz4)
    249 	$(PRGDIR)/lz4cat tmp-tlb-hw               # pass-through mode
    250 	test   -f tmp-tlb-hw
    251 	test ! -f tmp-tlb-hw.lz4                  # must fail (lz4cat)
    252 	$(LZ4) tmp-tlb-hw tmp-tlb-hw.lz4          # creates tmp-tlb-hw.lz4
    253 	$(PRGDIR)/lz4cat < tmp-tlb-hw.lz4 > tmp-tlb3  # checks lz4cat works with stdin (#285)
    254 	$(DIFF) -q tmp-tlb-hw tmp-tlb3
    255 	$(PRGDIR)/lz4cat < tmp-tlb-hw > tmp-tlb2      # checks lz4cat works in pass-through mode
    256 	$(DIFF) -q tmp-tlb-hw tmp-tlb2
    257 	cp tmp-tlb-hw ./-d
    258 	$(LZ4) --rm -- -d -d.lz4               # compresses ./d into ./-d.lz4
    259 	test   -f ./-d.lz4
    260 	test ! -f ./-d
    261 	mv ./-d.lz4 ./-z
    262 	$(LZ4) -d --rm -- -z tmp-tlb4          # uncompresses ./-z into tmp-tlb4
    263 	test ! -f ./-z
    264 	$(DIFF) -q tmp-tlb-hw tmp-tlb4
    265 	$(LZ4) -f tmp-tlb-hw
    266 	cat tmp-tlb-hw >> tmp-tlb-hw.lz4
    267 	$(LZ4) -f tmp-tlb-hw.lz4               # uncompress valid frame followed by invalid data
    268 	$(LZ4) -BX tmp-tlb-hw -c -q | $(LZ4) -tv  # test block checksum
    269 	# ./datagen -g20KB generates the same file every single time
    270 	# cannot save output of ./datagen -g20KB as input file to lz4 because the following shell commands are run before ./datagen -g20KB
    271 	test "$(shell ./datagen -g20KB | $(LZ4) -c --fast | wc -c)" -lt "$(shell ./datagen -g20KB | $(LZ4) -c --fast=9 | wc -c)" # -1 vs -9
    272 	test "$(shell ./datagen -g20KB | $(LZ4) -c -1 | wc -c)" -lt "$(shell ./datagen -g20KB| $(LZ4) -c --fast=1 | wc -c)" # 1 vs -1
    273 	test "$(shell ./datagen -g20KB | $(LZ4) -c --fast=1 | wc -c)" -eq "$(shell ./datagen -g20KB| $(LZ4) -c --fast| wc -c)" # checks default fast compression is -1
    274 	! $(LZ4) -c --fast=0 tmp-tlb-dg20K # lz4 should fail when fast=0
    275 	! $(LZ4) -c --fast=-1 tmp-tlb-dg20K # lz4 should fail when fast=-1
    276 	@$(RM) tmp-tlb*
    277 
    278 
    279 
    280 test-lz4-dict: lz4 datagen
    281 	@echo "\n ---- test lz4 compression/decompression with dictionary ----"
    282 	./datagen -g16KB > tmp-dict
    283 	./datagen -g32KB > tmp-dict-sample-32k
    284 	< tmp-dict-sample-32k $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-32k
    285 	./datagen -g128MB > tmp-dict-sample-128m
    286 	< tmp-dict-sample-128m $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-128m
    287 	touch tmp-dict-sample-0
    288 	< tmp-dict-sample-0 $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-0
    289 
    290 	< tmp-dict-sample-32k $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-sample-32k
    291 	< tmp-dict-sample-0 $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-sample-0
    292 
    293 	@echo "\n ---- test lz4 dictionary loading ----"
    294 	./datagen -g128KB > tmp-dict-data-128KB
    295 	set -e; \
    296 	for l in 0 1 4 128 32767 32768 32769 65535 65536 65537 98303 98304 98305 131071 131072 131073; do \
    297 		./datagen -g$$l > tmp-dict-$$l; \
    298 		$(DD) if=tmp-dict-$$l of=tmp-dict-$$l-tail bs=1 count=65536 skip=$$((l > 65536 ? l - 65536 : 0)); \
    299 		< tmp-dict-$$l      $(LZ4) -D stdin tmp-dict-data-128KB | $(LZ4) -dD tmp-dict-$$l-tail | $(DIFF) - tmp-dict-data-128KB; \
    300 		< tmp-dict-$$l-tail $(LZ4) -D stdin tmp-dict-data-128KB | $(LZ4) -dD tmp-dict-$$l      | $(DIFF) - tmp-dict-data-128KB; \
    301 	done
    302 
    303 	@$(RM) tmp-dict*
    304 
    305 test-lz4-hugefile: lz4 datagen
    306 	@echo "\n ---- test huge files compression/decompression ----"
    307 	./datagen -g6GB   | $(LZ4) -vB5D  | $(LZ4) -qt
    308 	./datagen -g6GB   | $(LZ4) -v5BD  | $(LZ4) -qt
    309 	# test large file size [2-4] GB
    310 	@./datagen -g3G -P100 | $(LZ4) -vv | $(LZ4) --decompress --force --sparse - tmphf1
    311 	@ls -ls tmphf1
    312 	@./datagen -g3G -P100 | $(LZ4) --quiet --content-size | $(LZ4) --verbose --decompress --force --sparse - tmphf2
    313 	@ls -ls tmphf2
    314 	$(DIFF) -s tmphf1 tmphf2
    315 	@$(RM) tmphf*
    316 
    317 test-lz4-testmode: lz4 datagen
    318 	@echo "\n ---- bench mode ----"
    319 	$(LZ4) -bi1
    320 	@echo "\n ---- test mode ----"
    321 	! ./datagen | $(LZ4) -t
    322 	! ./datagen | $(LZ4) -tf
    323 	@echo "\n ---- pass-through mode ----"
    324 	! ./datagen | $(LZ4) -d  > $(VOID)
    325 	./datagen | $(LZ4) -df > $(VOID)
    326 	@echo "Hello World !" > tmp-tlt1
    327 	$(LZ4) -dcf tmp-tlt1
    328 	@echo "from underground..." > tmp-tlt2
    329 	$(LZ4) -dcfm tmp-tlt1 tmp-tlt2
    330 	@echo "\n ---- non-existing source ----"
    331 	! $(LZ4)     file-does-not-exist
    332 	! $(LZ4) -f  file-does-not-exist
    333 	! $(LZ4) -fm file1-dne file2-dne
    334 	@$(RM) tmp-tlt
    335 
    336 test-lz4-opt-parser: lz4 datagen
    337 	@echo "\n ---- test opt-parser ----"
    338 	./datagen -g16KB      | $(LZ4) -12      | $(LZ4) -t
    339 	./datagen -P10        | $(LZ4) -12B4    | $(LZ4) -t
    340 	./datagen -g256K      | $(LZ4) -12B4D   | $(LZ4) -t
    341 	./datagen -g512K -P25 | $(LZ4) -12BD    | $(LZ4) -t
    342 	./datagen -g1M        | $(LZ4) -12B5    | $(LZ4) -t
    343 	./datagen -g2M -P99   | $(LZ4) -11B4D   | $(LZ4) -t
    344 	./datagen -g4M        | $(LZ4) -11vq    | $(LZ4) -qt
    345 	./datagen -g8M        | $(LZ4) -11B4    | $(LZ4) -t
    346 	./datagen -g16M -P90  | $(LZ4) -11B5    | $(LZ4) -t
    347 	./datagen -g32M -P10  | $(LZ4) -11B5D   | $(LZ4) -t
    348 
    349 test-lz4-essentials : lz4 datagen test-lz4-basic test-lz4-multiple \
    350                       test-lz4-frame-concatenation test-lz4-testmode \
    351                       test-lz4-contentSize test-lz4-dict
    352 	@$(RM) tmp*
    353 
    354 test-lz4: lz4 datagen test-lz4-essentials test-lz4-opt-parser \
    355           test-lz4-sparse test-lz4-hugefile test-lz4-dict
    356 	@$(RM) tmp*
    357 
    358 test-lz4c: lz4c datagen
    359 	@echo "\n ---- test lz4c variant ----"
    360 	./datagen -g256MB | $(LZ4)c -l -v    | $(LZ4)c   -t
    361 
    362 test-lz4c32: CFLAGS+=-m32
    363 test-lz4c32: test-lz4
    364 
    365 test-interop-32-64: lz4 lz4c32 datagen
    366 	@echo "\n ---- test interoperability 32-bits -vs- 64 bits ----"
    367 	./datagen -g16KB  | $(LZ4)c32 -9     | $(LZ4)    -t
    368 	./datagen -P10    | $(LZ4)    -9B4   | $(LZ4)c32 -t
    369 	./datagen         | $(LZ4)c32        | $(LZ4)    -t
    370 	./datagen -g1M    | $(LZ4)    -3B5   | $(LZ4)c32 -t
    371 	./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4)    -qt
    372 	./datagen -g1G -P90 | $(LZ4)         | $(LZ4)c32 -t
    373 	./datagen -g6GB   | $(LZ4)c32 -vq9BD | $(LZ4)    -qt
    374 
    375 test-lz4c32-basic: lz4c32 datagen
    376 	@echo "\n ---- test lz4c32 32-bits version ----"
    377 	./datagen -g16KB  | $(LZ4)c32 -9     | $(LZ4)c32 -t
    378 	./datagen         | $(LZ4)c32        | $(LZ4)c32 -t
    379 	./datagen -g256MB | $(LZ4)c32 -vqB4D | $(LZ4)c32 -qt
    380 	./datagen -g6GB   | $(LZ4)c32 -vqB5D | $(LZ4)c32 -qt
    381 
    382 test-platform:
    383 	@echo "\n ---- test lz4 $(QEMU_SYS) platform ----"
    384 	$(QEMU_SYS) ./datagen -g16KB  | $(QEMU_SYS) $(LZ4) -9     | $(QEMU_SYS) $(LZ4) -t
    385 	$(QEMU_SYS) ./datagen         | $(QEMU_SYS) $(LZ4)        | $(QEMU_SYS) $(LZ4) -t
    386 	$(QEMU_SYS) ./datagen -g256MB | $(QEMU_SYS) $(LZ4) -vqB4D | $(QEMU_SYS) $(LZ4) -qt
    387 ifneq ($(QEMU_SYS),qemu-arm-static)
    388 	$(QEMU_SYS) ./datagen -g3GB   | $(QEMU_SYS) $(LZ4) -vqB5D | $(QEMU_SYS) $(LZ4) -qt
    389 endif
    390 
    391 test-fullbench: fullbench
    392 	./fullbench --no-prompt $(NB_LOOPS) $(TEST_FILES)
    393 
    394 test-fullbench32: CFLAGS += -m32
    395 test-fullbench32: test-fullbench
    396 
    397 test-fuzzer: fuzzer
    398 	./fuzzer $(FUZZER_TIME)
    399 
    400 test-fuzzer32: CFLAGS += -m32
    401 test-fuzzer32: test-fuzzer
    402 
    403 test-frametest: frametest
    404 	./frametest $(FUZZER_TIME)
    405 
    406 test-frametest32: CFLAGS += -m32
    407 test-frametest32: test-frametest
    408 
    409 test-mem: lz4 datagen fuzzer frametest fullbench
    410 	@echo "\n ---- valgrind tests : memory analyzer ----"
    411 	valgrind --leak-check=yes --error-exitcode=1 ./datagen -g50M > $(VOID)
    412 	./datagen -g16KB > ftmdg16K
    413 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -BD -f ftmdg16K $(VOID)
    414 	./datagen -g16KB -s2 > ftmdg16K2
    415 	./datagen -g16KB -s3 > ftmdg16K3
    416 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --force --multiple ftmdg16K ftmdg16K2 ftmdg16K3
    417 	./datagen -g7MB > ftmdg7M
    418 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -B5D -f ftmdg7M ftmdg16K2
    419 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -t ftmdg16K2
    420 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -bi1 ftmdg7M
    421 	valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1 ftmdg7M ftmdg16K2
    422 	valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -B4D -f -vq ftmdg7M $(VOID)
    423 	$(RM) ftm*
    424 	valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i64 -t1
    425 	valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256
    426 
    427 test-mem32: lz4c32 datagen
    428 # unfortunately, valgrind doesn't seem to work with non-native binary...
    429 
    430 endif
    431