1# ################################################################
2# Copyright (c) 2015-2021, Yann Collet, Facebook, Inc.
3# All rights reserved.
4#
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# You may select, at your option, one of the above-listed licenses.
9# ################################################################
10# datagen : Synthetic and parametrable data generator, for tests
11# fullbench  : Precisely measure speed for each zstd inner functions
12# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
13# fuzzer  : Test tool, to check zstd integrity on target platform
14# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
15# paramgrill : parameter tester for zstd
16# test-zstd-speed.py : script for testing zstd speed difference between commits
17# versionsTest : compatibility test between zstd versions stored on Github (v0.1+)
18# zstreamtest : Fuzzer test tool for zstd streaming API
19# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
20# ##########################################################################
21
22ZSTDDIR = ../lib
23PRGDIR  = ../programs
24PYTHON ?= python3
25TESTARTEFACT := versionsTest
26
27DEBUGLEVEL ?= 1
28export DEBUGLEVEL  # transmit value to sub-makefiles
29DEBUGFLAGS  = -g -DDEBUGLEVEL=$(DEBUGLEVEL)
30CPPFLAGS   += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
31              -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
32ifeq ($(OS),Windows_NT)   # MinGW assumed
33CPPFLAGS   += -D__USE_MINGW_ANSI_STDIO   # compatibility with %zu formatting
34endif
35CFLAGS     ?= -O3
36CFLAGS     += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow                 \
37              -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
38              -Wstrict-prototypes -Wundef                                     \
39              -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings      \
40              -Wredundant-decls -Wmissing-prototypes
41CFLAGS     += $(DEBUGFLAGS)
42CPPFLAGS   += $(MOREFLAGS)
43
44
45ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
46ZSTDCOMP_FILES   := $(ZSTDDIR)/compress/*.c
47ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
48ZSTD_FILES  := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
49ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c
50ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c
51
52ZSTD_F1 := $(wildcard $(ZSTD_FILES))
53ZSTD_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdm_,$(ZSTD_F1))
54ZSTD_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdc_,$(ZSTD_OBJ1))
55ZSTD_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdd_,$(ZSTD_OBJ2))
56ZSTD_OBJECTS := $(ZSTD_OBJ3:.c=.o)
57
58ZSTDMT_OBJ1 := $(subst $(ZSTDDIR)/common/,zstdmt_m_,$(ZSTD_F1))
59ZSTDMT_OBJ2 := $(subst $(ZSTDDIR)/compress/,zstdmt_c_,$(ZSTDMT_OBJ1))
60ZSTDMT_OBJ3 := $(subst $(ZSTDDIR)/decompress/,zstdmt_d_,$(ZSTDMT_OBJ2))
61ZSTDMT_OBJECTS := $(ZSTDMT_OBJ3:.c=.o)
62
63# Define *.exe as extension for Windows systems
64ifneq (,$(filter Windows%,$(OS)))
65EXT =.exe
66MULTITHREAD_CPP = -DZSTD_MULTITHREAD
67MULTITHREAD_LD  =
68else
69EXT =
70MULTITHREAD_CPP = -DZSTD_MULTITHREAD
71MULTITHREAD_LD  = -pthread
72endif
73MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
74
75VOID = /dev/null
76ZSTREAM_TESTTIME ?= -T90s
77FUZZERTEST ?= -T200s
78ZSTDRTTEST = --test-large-data
79DECODECORPUS_TESTTIME ?= -T30
80
81.PHONY: default
82default: fullbench
83
84.PHONY: all
85all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus roundTripCrash poolTests
86
87.PHONY: all32
88all32: fullbench32 fuzzer32 zstreamtest32
89
90.PHONY: allnothread
91allnothread: MULTITHREAD_CPP=
92allnothread: MULTITHREAD_LD=
93allnothread: fullbench fuzzer paramgrill datagen decodecorpus
94
95# note : broken : requires symbols unavailable from dynamic library
96.PHONY: dll
97dll: fuzzer-dll zstreamtest-dll
98
99.PHONY: zstd zstd32 zstd-nolegacy  # only external makefile knows how to build or update them
100zstd zstd32 zstd-nolegacy:
101	$(MAKE) -C $(PRGDIR) $@ MOREFLAGS+="$(DEBUGFLAGS)"
102
103.PHONY: libzstd
104libzstd :
105	$(MAKE) -C $(ZSTDDIR) libzstd MOREFLAGS+="$(DEBUGFLAGS)"
106
107%-dll : libzstd
108%-dll : LDFLAGS += -L$(ZSTDDIR) -lzstd
109
110$(ZSTDDIR)/libzstd.a :
111	$(MAKE) -C $(ZSTDDIR) libzstd.a
112
113zstdm_%.o : $(ZSTDDIR)/common/%.c
114	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
115
116zstdc_%.o : $(ZSTDDIR)/compress/%.c
117	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
118
119zstdd_%.o : $(ZSTDDIR)/decompress/%.c
120	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
121
122zstdmt%.o : CPPFLAGS += $(MULTITHREAD_CPP)
123
124zstdmt_m_%.o : $(ZSTDDIR)/common/%.c
125	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
126
127zstdmt_c_%.o : $(ZSTDDIR)/compress/%.c
128	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
129
130zstdmt_d_%.o : $(ZSTDDIR)/decompress/%.c
131	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
132
133fullbench32: CPPFLAGS += -m32
134fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP)
135fullbench fullbench32 : LDFLAGS += $(MULTITHREAD_LD)
136fullbench fullbench32 : DEBUGFLAGS = -DNDEBUG  # turn off assert() for speed measurements
137fullbench fullbench32 : $(ZSTD_FILES)
138fullbench fullbench32 : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c fullbench.c
139	$(LINK.c) $^ -o $@$(EXT)
140
141fullbench-lib : CPPFLAGS += -DXXH_NAMESPACE=ZSTD_
142fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(ZSTDDIR)/libzstd.a fullbench.c
143	$(LINK.c) $^ -o $@$(EXT)
144
145# note : broken : requires symbols unavailable from dynamic library
146fullbench-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	$(LINK.c) $^ $(LDLIBS) -o $@$(EXT)
149
150fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
151fuzzer : LDFLAGS += $(MULTITHREAD_LD)
152fuzzer : $(ZSTDMT_OBJECTS)
153fuzzer fuzzer32 : $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c fuzzer.c
154
155fuzzer32 : CFLAGS += -m32 $(MULTITHREAD)
156fuzzer32 : $(ZSTD_FILES)
157	$(LINK.c) $^ -o $@$(EXT)
158
159# note : broken : requires symbols unavailable from dynamic library
160fuzzer-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)
162
163zbufftest zbufftest32 zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated
164zbufftest zbufftest32 zbufftest-dll : CFLAGS += -Wno-deprecated-declarations   # required to silence deprecation warnings
165zbufftest32 : CFLAGS +=  -m32
166zbufftest zbufftest32 : $(ZSTD_OBJECTS) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
167	$(LINK.c) $^ -o $@$(EXT)
168
169zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c
170	$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
171
172ZSTREAM_LOCAL_FILES := $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c seqgen.c zstreamtest.c
173ZSTREAM_PROPER_FILES := $(ZDICT_FILES) $(ZSTREAM_LOCAL_FILES)
174ZSTREAMFILES := $(ZSTD_FILES) $(ZSTREAM_PROPER_FILES)
175zstreamtest32 : CFLAGS += -m32
176zstreamtest zstreamtest32 : CPPFLAGS += $(MULTITHREAD_CPP)
177zstreamtest zstreamtest32 : LDFLAGS += $(MULTITHREAD_LD)
178zstreamtest : $(ZSTDMT_OBJECTS) $(ZSTREAM_PROPER_FILES)
179zstreamtest32 : $(ZSTREAMFILES)
180zstreamtest zstreamtest32 :
181	$(LINK.c) $^ -o $@$(EXT)
182
183zstreamtest_asan : CFLAGS += -fsanitize=address
184zstreamtest_asan : $(ZSTREAMFILES)
185	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
186
187zstreamtest_tsan : CFLAGS += -fsanitize=thread
188zstreamtest_tsan : $(ZSTREAMFILES)
189	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
190
191# note : broken : requires symbols unavailable from dynamic library
192zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c  # xxh symbols not exposed from dll
193zstreamtest-dll : $(ZSTREAM_LOCAL_FILES)
194	$(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)
195
196paramgrill : DEBUGFLAGS =   # turn off debug for speed measurements
197paramgrill : LDLIBS += -lm
198paramgrill : $(ZSTD_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/benchfn.c $(PRGDIR)/benchzstd.c $(PRGDIR)/datagen.c paramgrill.c
199
200datagen : $(PRGDIR)/datagen.c datagencli.c
201	$(LINK.c) $^ -o $@$(EXT)
202
203roundTripCrash: CFLAGS += $(MULTITHREAD)
204roundTripCrash : $(ZSTD_OBJECTS) roundTripCrash.c
205
206longmatch : $(ZSTD_OBJECTS) longmatch.c
207
208bigdict: CFLAGS += $(MULTITHREAD)
209bigdict: $(ZSTDMT_OBJECTS) $(PRGDIR)/datagen.c bigdict.c
210
211invalidDictionaries : $(ZSTD_OBJECTS) invalidDictionaries.c
212
213legacy : CPPFLAGS += -I$(ZSTDDIR)/legacy -DZSTD_LEGACY_SUPPORT=4
214legacy : $(ZSTD_FILES) $(wildcard $(ZSTDDIR)/legacy/*.c) legacy.c
215
216decodecorpus : LDLIBS += -lm
217decodecorpus : $(filter-out zstdc_zstd_compress.o, $(ZSTD_OBJECTS)) $(ZDICT_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c decodecorpus.c
218
219poolTests : $(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
220	$(LINK.c) $(MULTITHREAD) $^ -o $@$(EXT)
221
222.PHONY: versionsTest
223versionsTest: clean
224	$(PYTHON) test-zstd-versions.py
225
226.PHONY: automated_benchmarking
227automated_benchmarking: clean
228	$(PYTHON) automated_benchmarking.py
229
230# make checkTag
231checkTag.o : $(ZSTDDIR)/zstd.h
232
233.PHONY: clean
234clean:
235	$(MAKE) -C $(ZSTDDIR) clean
236	$(MAKE) -C $(PRGDIR) clean
237	$(RM) -fR $(TESTARTEFACT)
238	$(RM) -rf tmp*  # some test directories are named tmp*
239	$(RM) core *.o *.tmp result* *.gcda dictionary *.zst \
240        $(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \
241        fullbench$(EXT) fullbench32$(EXT) \
242        fullbench-lib$(EXT) fullbench-dll$(EXT) \
243        fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \
244        fuzzer-dll$(EXT) zstreamtest-dll$(EXT) zbufftest-dll$(EXT) \
245        zstreamtest$(EXT) zstreamtest32$(EXT) \
246        datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \
247        symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \
248        decodecorpus$(EXT) checkTag$(EXT) bigdict$(EXT)
249	@echo Cleaning completed
250
251
252#----------------------------------------------------------------------------------
253# valgrind tests are validated only for some posix platforms
254#----------------------------------------------------------------------------------
255UNAME := $(shell uname)
256ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
257HOST_OS = POSIX
258
259valgrindTest: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
260valgrindTest: zstd datagen fuzzer fullbench
261	@echo "\n ---- valgrind tests : memory analyzer ----"
262	$(VALGRIND) ./datagen -g50M > $(VOID)
263	$(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi
264	./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID)
265	./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
266	./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp
267	$(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID)
268	./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
269	@rm tmp
270	$(VALGRIND) ./fuzzer -T1mn -t1
271	$(VALGRIND) ./fullbench -i1
272
273endif
274
275
276ifneq (,$(filter MINGW% MSYS%,$(UNAME)))
277  HOST_OS = MSYS
278endif
279
280
281#-----------------------------------------------------------------------------
282# make tests validated only for below targets
283#-----------------------------------------------------------------------------
284ifneq (,$(filter $(HOST_OS),MSYS POSIX))
285
286DIFF:=diff
287ifneq (,$(filter $(UNAME),SunOS))
288  DIFF:=gdiff
289endif
290
291.PHONY: list
292list:
293	@$(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
294
295.PHONY: shortest
296shortest: ZSTDRTTEST=  # remove long tests
297shortest: test-zstd
298
299.PHONY: check
300check: shortest
301
302.PHONY: fuzztest
303fuzztest: test-fuzzer test-zstream test-decodecorpus
304
305.PHONY: test
306test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus
307ifeq ($(QEMU_SYS),)
308test: test-pool
309endif
310
311.PHONY: test32
312test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32
313
314.PHONY: test-all
315test-all: test test32 valgrindTest test-decodecorpus-cli
316
317.PHONY: test-zstd test-zstd32 test-zstd-nolegacy test-zstdgrep
318test-zstd: ZSTD = $(PRGDIR)/zstd
319test-zstd: zstd
320
321test-zstd32: ZSTD = $(PRGDIR)/zstd32
322test-zstd32: zstd32
323
324test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy
325test-zstd-nolegacy: zstd-nolegacy
326
327test-zstd test-zstd32 test-zstd-nolegacy: datagen
328	file $(ZSTD)
329	EXE_PREFIX="$(QEMU_SYS)" ZSTD_BIN="$(ZSTD)" DATAGEN_BIN=./datagen ./playTests.sh $(ZSTDRTTEST)
330
331test-fullbench: fullbench datagen
332	$(QEMU_SYS) ./fullbench -i1
333	$(QEMU_SYS) ./fullbench -i1 -P0
334
335test-fullbench32: fullbench32 datagen
336	$(QEMU_SYS) ./fullbench32 -i1
337	$(QEMU_SYS) ./fullbench32 -i1 -P0
338
339test-fuzzer: fuzzer
340	$(QEMU_SYS) ./fuzzer -v $(FUZZERTEST) $(FUZZER_FLAGS)
341
342test-fuzzer-stackmode: MOREFLAGS += -DZSTD_HEAPMODE=0
343test-fuzzer-stackmode: test-fuzzer
344
345test-fuzzer32: fuzzer32
346	$(QEMU_SYS) ./fuzzer32 -v $(FUZZERTEST) $(FUZZER_FLAGS)
347
348test-zbuff: zbufftest
349	$(QEMU_SYS) ./zbufftest $(ZSTREAM_TESTTIME)
350
351test-zbuff32: zbufftest32
352	$(QEMU_SYS) ./zbufftest32 $(ZSTREAM_TESTTIME)
353
354test-zstream: zstreamtest
355	$(QEMU_SYS) ./zstreamtest -v $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
356	$(QEMU_SYS) ./zstreamtest --newapi -t1 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
357
358test-zstream32: zstreamtest32
359	$(QEMU_SYS) ./zstreamtest32 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
360
361test-longmatch: longmatch
362	$(QEMU_SYS) ./longmatch
363
364test-bigdict: bigdict
365	$(QEMU_SYS) ./bigdict
366
367test-invalidDictionaries: invalidDictionaries
368	$(QEMU_SYS) ./invalidDictionaries
369
370test-legacy: legacy
371	$(QEMU_SYS) ./legacy
372
373test-decodecorpus: decodecorpus
374	$(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME)
375
376test-decodecorpus-cli: decodecorpus
377	@echo "\n ---- decodecorpus basic cli tests ----"
378	@mkdir testdir
379	./decodecorpus -n5 -otestdir -ptestdir
380	@cd testdir && \
381	$(ZSTD) -d z000000.zst -o tmp0 && \
382	$(ZSTD) -d z000001.zst -o tmp1 && \
383	$(ZSTD) -d z000002.zst -o tmp2 && \
384	$(ZSTD) -d z000003.zst -o tmp3 && \
385	$(ZSTD) -d z000004.zst -o tmp4 && \
386	diff z000000 tmp0 && \
387	diff z000001 tmp1 && \
388	diff z000002 tmp2 && \
389	diff z000003 tmp3 && \
390	diff z000004 tmp4 && \
391	rm ./* && \
392	cd ..
393	@echo "\n ---- decodecorpus dictionary cli tests ----"
394	./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
395	@cd testdir && \
396	$(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \
397	$(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \
398	$(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \
399	$(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \
400	$(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \
401	diff z000000 tmp0 && \
402	diff z000001 tmp1 && \
403	diff z000002 tmp2 && \
404	diff z000003 tmp3 && \
405	diff z000004 tmp4 && \
406	cd ..
407	@rm -rf testdir
408
409test-pool: poolTests
410	$(QEMU_SYS) ./poolTests
411
412test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd
413test-lz4: ZSTD_LZ4 = LD_LIBRARY_PATH=/usr/local/lib ./lz4
414test-lz4: ZSTD_UNLZ4 = LD_LIBRARY_PATH=/usr/local/lib ./unlz4
415test-lz4: zstd decodecorpus datagen
416	[ -f lz4 ] || ln -s $(PRGDIR)/zstd lz4
417	[ -f unlz4 ] || ln -s $(PRGDIR)/zstd unlz4
418
419	./decodecorpus -ptmp
420	# lz4 -> zstd
421	lz4 < tmp | \
422	$(ZSTD) -d | \
423	cmp - tmp
424	lz4 < tmp | \
425	$(ZSTD_UNLZ4) | \
426	cmp - tmp
427	# zstd -> lz4
428	$(ZSTD) --format=lz4 < tmp | \
429	lz4 -d | \
430	cmp - tmp
431	$(ZSTD_LZ4) < tmp | \
432	lz4 -d | \
433	cmp - tmp
434	# zstd -> zstd
435	$(ZSTD) --format=lz4 < tmp | \
436	$(ZSTD) -d | \
437	cmp - tmp
438	# zstd -> zstd
439	$(ZSTD) < tmp | \
440	$(ZSTD) -d | \
441	cmp - tmp
442
443	./datagen -g384KB | $(ZSTD) --format=lz4 | $(ZSTD) -d > /dev/null
444
445	rm tmp lz4 unlz4
446
447endif
448