1 # ################################################################
2 # Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
5 # This source code is licensed under both the BSD-style license (found in the
6 # LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 # in the COPYING file in the root directory of this source tree).
8 # ################################################################
9 # datagen : Synthetic and parametrable data generator, for tests
10 # fullbench : Precisely measure speed for each zstd inner functions
11 # fullbench32: Same as fullbench, but forced to compile in 32-bits mode
12 # fuzzer : Test tool, to check zstd integrity on target platform
13 # fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
14 # paramgrill : parameter tester for zstd
15 # test-zstd-speed.py : script for testing zstd speed difference between commits
16 # versionsTest : compatibility test between zstd versions stored on Github (v0.1+)
17 # zstreamtest : Fuzzer test tool for zstd streaming API
18 # zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
19 # ##########################################################################
24 TESTARTEFACT := versionsTest
27 DEBUGFLAGS = -g -DDEBUGLEVEL=$(DEBUGLEVEL)
28 CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
29 -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
30 ifeq ($(OS),Windows_NT) # MinGW assumed
31 CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
34 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
35 -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
36 -Wstrict-prototypes -Wundef \
37 -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
38 -Wredundant-decls -Wmissing-prototypes
39 CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
40 FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
43 ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
44 ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c
45 ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
46 ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
47 ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c
48 ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c
50 ZSTD_F1 := $(wildcard $(ZSTD_FILES))
51 ZSTD_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdm_,$(ZSTD_F1))
52 ZSTD_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdc_,$(ZSTD_OBJ1))
53 ZSTD_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdd_,$(ZSTD_OBJ2))
54 ZSTD_OBJECTS := $(ZSTD_OBJ3:.c=.o)
56 ZSTDMT_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdmt_m_,$(ZSTD_F1))
57 ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1))
58 ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
59 ZSTDMT_OBJECTS := $(ZSTDMT_OBJ3:.c=.o)
61 # Define *.exe as extension for Windows systems
62 ifneq (,$(filter Windows%,$(OS)))
64 MULTITHREAD_CPP = -DZSTD_MULTITHREAD
68 MULTITHREAD_CPP = -DZSTD_MULTITHREAD
69 MULTITHREAD_LD = -pthread
71 MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
74 ZSTREAM_TESTTIME ?= -T90s
76 ZSTDRTTEST = --test-large-data
77 DECODECORPUS_TESTTIME ?= -T30
79 .PHONY: default all all32 allnothread dll clean test test32 test-all versionsTest
82 @echo $(ZSTDMT_OBJECTS)
84 all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus roundTripCrash \
85 fullbench-lib poolTests
87 all32: fullbench32 fuzzer32 zstreamtest32
89 allnothread: MULTITHREAD_CPP=
90 allnothread: MULTITHREAD_LD=
91 allnothread: fullbench fuzzer paramgrill datagen decodecorpus
93 dll: fuzzer-dll zstreamtest-dll
95 PHONY: zstd zstd32 zstd-nolegacy # must be phony, only external makefile knows how to build them, or if they need an update
96 zstd zstd32 zstd-nolegacy:
97 $(MAKE) -C $(PRGDIR) $@ MOREFLAGS+="$(DEBUGFLAGS)"
100 $(MAKE) -C $(PRGDIR) zstd HAVE_ZLIB=1 MOREFLAGS+="$(DEBUGFLAGS)"
104 $(MAKE) -C $(ZSTDDIR) libzstd
106 .PHONY: zstd-staticLib
108 $(MAKE) -C $(ZSTDDIR) libzstd.a
110 zstdm_%.o : $(ZSTDDIR)/common/%.c
111 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
113 zstdc_%.o : $(ZSTDDIR)/compress/%.c
114 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
116 zstdd_%.o : $(ZSTDDIR)/decompress/%.c
117 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
119 zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP)
121 zstdmt_m_%.o : $(ZSTDDIR)/common/%.c
122 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
124 zstdmt_c_%.o : $(ZSTDDIR)/compress/%.c
125 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
127 zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.c
128 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
130 fullbench32: CPPFLAGS += -m32
131 fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP)
132 fullbench fullbench32 : LDFLAGS += $(MULTITHREAD_LD)
133 fullbench fullbench32 : DEBUGFLAGS = -DNDEBUG # turn off assert() for speed measurements
134 fullbench fullbench32 : $(ZSTD_FILES)
135 fullbench fullbench32 : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
136 $(CC) $(FLAGS) $^ -o $@$(EXT)
138 fullbench-lib : CPPFLAGS += -DXXH_NAMESPACE=ZSTD_
139 fullbench-lib : zstd-staticLib
140 fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
141 $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) $(ZSTDDIR)/libzstd.a
143 # note : broken : requires unavailable symbols
144 fullbench-dll : zstd-dll
145 fullbench-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
146 fullbench-dll: $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/benchfn.c $(PRGDIR)/timefn.c fullbench.c
147 # $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll
148 $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT)
150 fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
151 fuzzer : LDFLAGS += $(MULTITHREAD_LD)
152 fuzzer32: CFLAGS += -m32
153 fuzzer : $(ZSTDMT_OBJECTS)
154 fuzzer32: $(ZSTD_FILES)
155 fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
156 $(CC) $(FLAGS) $^ -o $@$(EXT)
158 fuzzer-dll : zstd-dll
159 fuzzer-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
160 fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
161 $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
163 zbufftest zbufftest32 zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated
164 zbufftest zbufftest32 zbufftest-dll : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings
165 zbufftest32 : CFLAGS += -m32
166 zbufftest zbufftest32 : $(ZSTD_OBJECTS) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
167 $(CC) $(FLAGS) $^ -o $@$(EXT)
169 zbufftest-dll : zstd-dll
170 zbufftest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
171 zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
172 $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
174 ZSTREAM_LOCAL_FILES := $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c seqgen.c zstreamtest.c
175 ZSTREAM_PROPER_FILES := $(ZDICT_FILES) $(ZSTREAM_LOCAL_FILES)
176 ZSTREAMFILES := $(ZSTD_FILES) $(ZSTREAM_PROPER_FILES)
177 zstreamtest32 : CFLAGS += -m32
178 zstreamtest zstreamtest32 : CPPFLAGS += $(MULTITHREAD_CPP)
179 zstreamtest zstreamtest32 : LDFLAGS += $(MULTITHREAD_LD)
180 zstreamtest : $(ZSTDMT_OBJECTS) $(ZSTREAM_PROPER_FILES)
181 zstreamtest32 : $(ZSTREAMFILES)
182 zstreamtest zstreamtest32 :
183 $(CC) $(FLAGS) $^ -o $@$(EXT)
185 zstreamtest_asan : CFLAGS += -fsanitize=address
186 zstreamtest_asan : $(ZSTREAMFILES)
187 $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
189 zstreamtest_tsan : CFLAGS += -fsanitize=thread
190 zstreamtest_tsan : $(ZSTREAMFILES)
191 $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
193 zstreamtest-dll : zstd-dll
194 zstreamtest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
195 zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c # xxh symbols not exposed from dll
196 zstreamtest-dll : $(ZSTREAM_LOCAL_FILES)
197 $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
199 paramgrill : DEBUGFLAGS = # turn off assert() by default for speed measurements
200 paramgrill : $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(PRGDIR)/benchzstd.c $(PRGDIR)/datagen.c paramgrill.c
201 $(CC) $(FLAGS) $^ -lm -o $@$(EXT)
203 datagen : $(PRGDIR)/datagen.c datagencli.c
204 $(CC) $(FLAGS) $^ -o $@$(EXT)
206 roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c
207 $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
209 longmatch : $(ZSTD_OBJECTS) longmatch.c
210 $(CC) $(FLAGS) $^ -o $@$(EXT)
212 bigdict: $(ZSTDMT_OBJECTS) $(PRGDIR)/datagen.c bigdict.c
213 $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
215 invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c
216 $(CC) $(FLAGS) $^ -o $@$(EXT)
218 legacy : CPPFLAGS += -I$(ZSTDDIR)/legacy -DZSTD_LEGACY_SUPPORT=4
219 legacy : $(ZSTD_FILES) $(wildcard $(ZSTDDIR)/legacy/*.c) legacy.c
220 $(CC) $(FLAGS) $^ -o $@$(EXT)
222 decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c
223 $(CC) $(FLAGS) $^ -o $@$(EXT) -lm
225 symbols : symbols.c zstd-dll
226 ifneq (,$(filter Windows%,$(OS)))
227 cp $(ZSTDDIR)/dll/libzstd.dll .
228 $(CC) $(FLAGS) $< -o $@$(EXT) -DZSTD_DLL_IMPORT=1 libzstd.dll
230 $(CC) $(FLAGS) $< -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so # broken on Mac
233 poolTests : $(PRGDIR)/util.c $(PRGDIR)/timefn.c poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c
234 $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
238 $(PYTHON) test-zstd-versions.py
240 checkTag: checkTag.c $(ZSTDDIR)/zstd.h
241 $(CC) $(FLAGS) $< -o $@$(EXT)
244 $(MAKE) -C $(ZSTDDIR) clean
245 $(MAKE) -C $(PRGDIR) clean
246 @$(RM) -fR $(TESTARTEFACT)
247 @$(RM) -rf tmp* # some test directories are named tmp*
248 @$(RM) core *.o *.tmp result* *.gcda dictionary *.zst \
249 $(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \
250 fullbench$(EXT) fullbench32$(EXT) \
251 fullbench-lib$(EXT) fullbench-dll$(EXT) \
252 fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \
253 fuzzer-dll$(EXT) zstreamtest-dll$(EXT) zbufftest-dll$(EXT) \
254 zstreamtest$(EXT) zstreamtest32$(EXT) \
255 datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \
256 symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \
257 decodecorpus$(EXT) checkTag$(EXT) bigdict$(EXT)
258 @echo Cleaning completed
261 #----------------------------------------------------------------------------------
262 # valgrind tests are validated only for some posix platforms
263 #----------------------------------------------------------------------------------
264 ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
267 valgrindTest: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
268 valgrindTest: zstd datagen fuzzer fullbench
269 @echo "\n ---- valgrind tests : memory analyzer ----"
270 $(VALGRIND) ./datagen -g50M > $(VOID)
271 $(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi
272 ./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID)
273 ./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
274 ./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp
275 $(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID)
276 ./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
278 $(VALGRIND) ./fuzzer -T1mn -t1
279 $(VALGRIND) ./fullbench -i1
284 ifneq (,$(filter MINGW% MSYS%,$(shell uname)))
289 #-----------------------------------------------------------------------------
290 # make tests validated only for below targets
291 #-----------------------------------------------------------------------------
292 ifneq (,$(filter $(HOST_OS),MSYS POSIX))
295 ifneq (,$(filter $(shell uname),SunOS))
301 @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
304 shortest: ZSTDRTTEST=
308 fuzztest: test-fuzzer test-zstream test-decodecorpus
311 test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus
316 test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32
318 test-all: test test32 valgrindTest test-decodecorpus-cli
321 .PHONY: test-zstd test-zstd32 test-zstd-nolegacy test-zstdgrep
322 test-zstd: ZSTD = $(PRGDIR)/zstd
325 test-zstd32: ZSTD = $(PRGDIR)/zstd32
328 test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy
329 test-zstd-nolegacy: zstd-nolegacy
331 test-zstd test-zstd32 test-zstd-nolegacy: datagen
333 ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST)
337 $(PRGDIR)/zstd -f README.md test-zstd-speed.py
338 gzip -f README.md test-zstd-speed.py
339 cat README.md.zst test-zstd-speed.py.gz >zstd_gz.zst
340 cat README.md.gz test-zstd-speed.py.zst >gz_zstd.gz
341 $(PRGDIR)/zstd -df README.md.gz -o README2.md
342 $(PRGDIR)/zstd -df README.md.gz test-zstd-speed.py.gz
343 $(PRGDIR)/zstd -df zstd_gz.zst gz_zstd.gz
344 $(DIFF) -q zstd_gz gz_zstd
345 echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst
346 echo Hello World GZIP | gzip -c - >hello.gz
347 echo Hello World TEXT >hello.txt
348 cat hello.zst hello.gz hello.txt >hello_zst_gz_txt.gz
349 $(PRGDIR)/zstd -dcf hello.*
350 $(PRGDIR)/zstd -dcf - <hello_zst_gz_txt.gz
351 $(RM) *.gz *.zst README2.md gz_zstd zstd_gz hello.txt
354 -[ -f /tmp/zstdcat ] || ln -s $(PWD)/$(PRGDIR)/zstd /tmp/zstdcat
355 echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep a
356 echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep b && return 1 || return 0
357 -echo 'hello world' > test.txt && $(PRGDIR)/zstd test.txt
358 env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep hello test.txt.zst
359 env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep weird test.txt.zst && return 1 || return 0
360 -echo 'hello' > pattern.txt
361 env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep -f pattern.txt test.txt.zst
362 $(RM) test.txt test.txt.zst pattern.txt
364 test-fullbench: fullbench datagen
365 $(QEMU_SYS) ./fullbench -i1
366 $(QEMU_SYS) ./fullbench -i1 -P0
368 test-fullbench32: fullbench32 datagen
369 $(QEMU_SYS) ./fullbench32 -i1
370 $(QEMU_SYS) ./fullbench32 -i1 -P0
373 $(QEMU_SYS) ./fuzzer -v $(FUZZERTEST) $(FUZZER_FLAGS)
375 test-fuzzer-stackmode: MOREFLAGS += -DZSTD_HEAPMODE=0
376 test-fuzzer-stackmode: test-fuzzer
378 test-fuzzer32: fuzzer32
379 $(QEMU_SYS) ./fuzzer32 -v $(FUZZERTEST) $(FUZZER_FLAGS)
381 test-zbuff: zbufftest
382 $(QEMU_SYS) ./zbufftest $(ZSTREAM_TESTTIME)
384 test-zbuff32: zbufftest32
385 $(QEMU_SYS) ./zbufftest32 $(ZSTREAM_TESTTIME)
387 test-zstream: zstreamtest
388 $(QEMU_SYS) ./zstreamtest -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
389 $(QEMU_SYS) ./zstreamtest --mt -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
390 $(QEMU_SYS) ./zstreamtest --newapi -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
392 test-zstream32: zstreamtest32
393 $(QEMU_SYS) ./zstreamtest32 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
395 test-longmatch: longmatch
396 $(QEMU_SYS) ./longmatch
398 test-bigdict: bigdict
399 $(QEMU_SYS) ./bigdict
401 test-invalidDictionaries: invalidDictionaries
402 $(QEMU_SYS) ./invalidDictionaries
404 test-symbols: symbols
405 $(QEMU_SYS) ./symbols
410 test-decodecorpus: decodecorpus
411 $(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME)
413 test-decodecorpus-cli: decodecorpus
414 @echo "\n ---- decodecorpus basic cli tests ----"
416 ./decodecorpus -n5 -otestdir -ptestdir
418 $(ZSTD) -d z000000.zst -o tmp0 && \
419 $(ZSTD) -d z000001.zst -o tmp1 && \
420 $(ZSTD) -d z000002.zst -o tmp2 && \
421 $(ZSTD) -d z000003.zst -o tmp3 && \
422 $(ZSTD) -d z000004.zst -o tmp4 && \
423 diff z000000 tmp0 && \
424 diff z000001 tmp1 && \
425 diff z000002 tmp2 && \
426 diff z000003 tmp3 && \
427 diff z000004 tmp4 && \
430 @echo "\n ---- decodecorpus dictionary cli tests ----"
431 ./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
433 $(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \
434 $(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \
435 $(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \
436 $(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \
437 $(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \
438 diff z000000 tmp0 && \
439 diff z000001 tmp1 && \
440 diff z000002 tmp2 && \
441 diff z000003 tmp3 && \
442 diff z000004 tmp4 && \
447 $(QEMU_SYS) ./poolTests
449 test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd
450 test-lz4: ZSTD_LZ4 = LD_LIBRARY_PATH=/usr/local/lib ./lz4
451 test-lz4: ZSTD_UNLZ4 = LD_LIBRARY_PATH=/usr/local/lib ./unlz4
452 test-lz4: zstd decodecorpus datagen
453 [ -f lz4 ] || ln -s $(PRGDIR)/zstd lz4
454 [ -f unlz4 ] || ln -s $(PRGDIR)/zstd unlz4
465 $(ZSTD) --format=lz4 < tmp | \
468 $(ZSTD_LZ4) < tmp | \
472 $(ZSTD) --format=lz4 < tmp | \
480 ./datagen -g384KB | $(ZSTD) --format=lz4 | $(ZSTD) -d > /dev/null