2017-08-31 19:20:50 +00:00
|
|
|
# ################################################################
|
|
|
|
# Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
|
2016-10-11 22:27:44 +00:00
|
|
|
# All rights reserved.
|
2016-05-23 12:23:55 +00:00
|
|
|
#
|
2017-08-31 19:20:50 +00:00
|
|
|
# This source code is licensed under both the BSD-style license (found in the
|
|
|
|
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
|
|
# in the COPYING file in the root directory of this source tree).
|
|
|
|
# ################################################################
|
2016-08-18 11:18:11 +00:00
|
|
|
# datagen : Synthetic and parametrable data generator, for tests
|
2016-08-25 06:47:18 +00:00
|
|
|
# fullbench : Precisely measure speed for each zstd inner functions
|
|
|
|
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
|
2016-08-18 11:18:11 +00:00
|
|
|
# fuzzer : Test tool, to check zstd integrity on target platform
|
|
|
|
# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode
|
2016-08-25 06:47:18 +00:00
|
|
|
# paramgrill : parameter tester for zstd
|
|
|
|
# test-zstd-speed.py : script for testing zstd speed difference between commits
|
|
|
|
# versionsTest : compatibility test between zstd versions stored on Github (v0.1+)
|
|
|
|
# zstreamtest : Fuzzer test tool for zstd streaming API
|
2016-11-16 16:50:54 +00:00
|
|
|
# zstreamtest32: Same as zstreamtest, but forced to compile in 32-bits mode
|
2016-05-23 12:23:55 +00:00
|
|
|
# ##########################################################################
|
|
|
|
|
2016-08-18 11:18:11 +00:00
|
|
|
ZSTDDIR = ../lib
|
2016-08-18 11:53:26 +00:00
|
|
|
PRGDIR = ../programs
|
2016-08-18 12:04:57 +00:00
|
|
|
PYTHON ?= python3
|
|
|
|
TESTARTEFACT := versionsTest namespaceTest
|
|
|
|
|
2017-07-04 19:39:26 +00:00
|
|
|
DEBUGLEVEL= 1
|
|
|
|
DEBUGFLAGS= -g -DZSTD_DEBUG=$(DEBUGLEVEL)
|
2017-05-19 17:17:59 +00:00
|
|
|
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
|
|
|
|
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
|
|
|
|
CFLAGS ?= -O3
|
2017-06-17 00:56:41 +00:00
|
|
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
2017-05-16 18:34:38 +00:00
|
|
|
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
|
2017-06-17 00:56:41 +00:00
|
|
|
-Wstrict-prototypes -Wundef -Wformat-security \
|
|
|
|
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
|
|
|
|
-Wredundant-decls
|
2017-07-04 19:39:26 +00:00
|
|
|
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
|
2017-06-17 00:56:41 +00:00
|
|
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
|
2016-08-10 06:14:48 +00:00
|
|
|
|
2016-05-23 12:23:55 +00:00
|
|
|
|
2016-08-18 11:18:11 +00:00
|
|
|
ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c
|
2017-02-24 07:09:10 +00:00
|
|
|
ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c
|
2016-12-06 03:28:19 +00:00
|
|
|
ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c
|
2017-02-24 07:09:10 +00:00
|
|
|
ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES)
|
2016-12-06 03:28:19 +00:00
|
|
|
ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c
|
2016-08-18 11:18:11 +00:00
|
|
|
ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c
|
|
|
|
|
|
|
|
|
|
|
|
# Define *.exe as extension for Windows systems
|
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
|
|
|
EXT =.exe
|
2017-02-24 07:09:10 +00:00
|
|
|
MULTITHREAD_CPP = -DZSTD_MULTITHREAD
|
|
|
|
MULTITHREAD_LD =
|
2016-08-18 11:18:11 +00:00
|
|
|
else
|
|
|
|
EXT =
|
2017-02-24 07:09:10 +00:00
|
|
|
MULTITHREAD_CPP = -DZSTD_MULTITHREAD
|
2017-02-24 08:16:05 +00:00
|
|
|
MULTITHREAD_LD = -pthread
|
2016-08-18 11:18:11 +00:00
|
|
|
endif
|
2017-02-24 07:09:10 +00:00
|
|
|
MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-03 14:38:13 +00:00
|
|
|
VOID = /dev/null
|
2017-03-10 00:05:10 +00:00
|
|
|
ZSTREAM_TESTTIME ?= -T2mn
|
2017-01-25 10:19:35 +00:00
|
|
|
FUZZERTEST ?= -T5mn
|
|
|
|
ZSTDRTTEST = --test-large-data
|
2017-03-10 00:05:10 +00:00
|
|
|
DECODECORPUS_TESTTIME ?= -T30
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-03-14 22:59:57 +00:00
|
|
|
.PHONY: default all all32 allnothread dll clean test test32 test-all namespaceTest versionsTest
|
2016-08-18 11:53:26 +00:00
|
|
|
|
|
|
|
default: fullbench
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-07-07 23:16:14 +00:00
|
|
|
all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-07-07 23:16:14 +00:00
|
|
|
all32: fullbench32 fuzzer32 zstreamtest32
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-08-31 22:02:14 +00:00
|
|
|
allnothread: fullbench fuzzer paramgrill datagen decodecorpus
|
2017-03-14 22:59:57 +00:00
|
|
|
|
2017-07-10 21:02:33 +00:00
|
|
|
dll: fuzzer-dll zstreamtest-dll
|
2016-12-17 15:28:12 +00:00
|
|
|
|
2016-08-18 11:53:26 +00:00
|
|
|
zstd:
|
|
|
|
$(MAKE) -C $(PRGDIR) $@
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-08-18 11:53:26 +00:00
|
|
|
zstd32:
|
|
|
|
$(MAKE) -C $(PRGDIR) $@
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-03 08:11:56 +00:00
|
|
|
zstd-nolegacy:
|
2016-08-18 11:53:26 +00:00
|
|
|
$(MAKE) -C $(PRGDIR) $@
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-30 14:20:24 +00:00
|
|
|
gzstd:
|
2017-08-31 22:02:14 +00:00
|
|
|
$(MAKE) -C $(PRGDIR) zstd HAVE_ZLIB=1
|
2016-11-30 14:20:24 +00:00
|
|
|
|
2017-06-30 01:56:24 +00:00
|
|
|
fullbench32: CPPFLAGS += -m32
|
|
|
|
fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
fullbench fullbench32 : LDFLAGS += $(MULTITHREAD_LD)
|
2017-07-05 02:33:16 +00:00
|
|
|
fullbench fullbench32 : DEBUGFLAGS = # turn off assert() for speed measurements
|
2017-06-30 01:56:24 +00:00
|
|
|
fullbench fullbench32 : $(ZSTD_FILES) $(PRGDIR)/datagen.c fullbench.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-21 11:51:01 +00:00
|
|
|
fullbench-lib: $(PRGDIR)/datagen.c fullbench.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd.a
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) $(ZSTDDIR)/libzstd.a
|
|
|
|
|
|
|
|
fullbench-dll: $(PRGDIR)/datagen.c fullbench.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll
|
|
|
|
|
2017-07-10 21:02:33 +00:00
|
|
|
fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
fuzzer : LDFLAGS += $(MULTITHREAD_LD)
|
|
|
|
fuzzer32: CFLAGS += -m32
|
|
|
|
fuzzer fuzzer32 : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-12-17 15:28:12 +00:00
|
|
|
|
|
|
|
fuzzer-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
|
|
|
fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c fuzzer.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-12-06 03:28:19 +00:00
|
|
|
zbufftest : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
2016-12-13 15:39:36 +00:00
|
|
|
zbufftest : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings
|
2016-12-06 03:28:19 +00:00
|
|
|
zbufftest : $(ZSTD_FILES) $(ZBUFF_FILES) $(PRGDIR)/datagen.c zbufftest.c
|
2016-12-13 15:39:36 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-12-06 03:28:19 +00:00
|
|
|
zbufftest32 : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
|
|
|
zbufftest32 : CFLAGS += -Wno-deprecated-declarations -m32
|
|
|
|
zbufftest32 : $(ZSTD_FILES) $(ZBUFF_FILES) $(PRGDIR)/datagen.c zbufftest.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-12-17 18:10:10 +00:00
|
|
|
zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated
|
|
|
|
zbufftest-dll : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings
|
|
|
|
zbufftest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
|
|
|
zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c zbufftest.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@$(EXT)
|
|
|
|
|
2017-02-24 07:09:10 +00:00
|
|
|
ZSTREAMFILES := $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c zstreamtest.c
|
|
|
|
zstreamtest : CPPFLAGS += $(MULTITHREAD_CPP)
|
|
|
|
zstreamtest : LDFLAGS += $(MULTITHREAD_LD)
|
|
|
|
zstreamtest : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
|
|
|
zstreamtest32 : CFLAGS += -m32
|
|
|
|
zstreamtest32 : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
|
|
|
|
|
|
|
zstreamtest_asan : CFLAGS += -fsanitize=address
|
|
|
|
zstreamtest_asan : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-02-24 07:09:10 +00:00
|
|
|
zstreamtest_tsan : CFLAGS += -fsanitize=thread
|
|
|
|
zstreamtest_tsan : $(ZSTREAMFILES)
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-12-17 15:28:12 +00:00
|
|
|
zstreamtest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
|
|
|
|
zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c zstreamtest.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@$(EXT)
|
|
|
|
|
2017-05-19 17:17:59 +00:00
|
|
|
paramgrill : DEBUGFLAGS =
|
2016-08-18 11:53:26 +00:00
|
|
|
paramgrill : $(ZSTD_FILES) $(PRGDIR)/datagen.c paramgrill.c
|
2016-08-18 11:18:11 +00:00
|
|
|
$(CC) $(FLAGS) $^ -lm -o $@$(EXT)
|
|
|
|
|
2016-08-18 11:53:26 +00:00
|
|
|
datagen : $(PRGDIR)/datagen.c datagencli.c
|
2016-08-18 11:18:11 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
|
|
|
roundTripCrash : $(ZSTD_FILES) roundTripCrash.c
|
2017-08-25 20:14:51 +00:00
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-05-23 12:23:55 +00:00
|
|
|
|
2016-12-11 03:12:13 +00:00
|
|
|
longmatch : $(ZSTD_FILES) longmatch.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2016-12-20 19:13:45 +00:00
|
|
|
invalidDictionaries : $(ZSTD_FILES) invalidDictionaries.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2017-03-13 21:44:08 +00:00
|
|
|
legacy : CFLAGS+= -DZSTD_LEGACY_SUPPORT=4
|
2017-02-08 21:56:32 +00:00
|
|
|
legacy : CPPFLAGS+= -I$(ZSTDDIR)/legacy
|
|
|
|
legacy : $(ZSTD_FILES) $(wildcard $(ZSTDDIR)/legacy/*.c) legacy.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2017-06-13 21:19:35 +00:00
|
|
|
decodecorpus : $(filter-out $(ZSTDDIR)/compress/zstd_compress.c, $(wildcard $(ZSTD_FILES))) $(ZDICT_FILES) decodecorpus.c
|
2017-02-22 23:59:15 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -lm
|
|
|
|
|
2016-12-16 21:29:23 +00:00
|
|
|
symbols : symbols.c
|
|
|
|
$(MAKE) -C $(ZSTDDIR) libzstd
|
|
|
|
ifneq (,$(filter Windows%,$(OS)))
|
|
|
|
cp $(ZSTDDIR)/dll/libzstd.dll .
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 libzstd.dll
|
|
|
|
else
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so
|
|
|
|
endif
|
|
|
|
|
2017-08-31 22:02:14 +00:00
|
|
|
poolTests : poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c
|
|
|
|
$(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT)
|
2016-12-30 07:41:03 +00:00
|
|
|
|
2016-08-18 12:04:57 +00:00
|
|
|
namespaceTest:
|
|
|
|
if $(CC) namespaceTest.c ../lib/common/xxhash.c -o $@ ; then echo compilation should fail; exit 1 ; fi
|
|
|
|
$(RM) $@
|
|
|
|
|
2017-02-22 08:36:42 +00:00
|
|
|
versionsTest: clean
|
2016-08-18 12:04:57 +00:00
|
|
|
$(PYTHON) test-zstd-versions.py
|
|
|
|
|
2016-05-23 12:23:55 +00:00
|
|
|
clean:
|
2017-02-22 09:31:30 +00:00
|
|
|
$(MAKE) -C $(ZSTDDIR) clean
|
2016-08-18 12:04:57 +00:00
|
|
|
@$(RM) -fR $(TESTARTEFACT)
|
|
|
|
@$(RM) -f core *.o tmp* result* *.gcda dictionary *.zst \
|
2016-08-18 11:53:26 +00:00
|
|
|
$(PRGDIR)/zstd$(EXT) $(PRGDIR)/zstd32$(EXT) \
|
2016-08-18 11:18:11 +00:00
|
|
|
fullbench$(EXT) fullbench32$(EXT) \
|
2016-11-21 12:58:58 +00:00
|
|
|
fullbench-lib$(EXT) fullbench-dll$(EXT) \
|
2016-08-18 11:18:11 +00:00
|
|
|
fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \
|
2016-12-17 18:10:10 +00:00
|
|
|
fuzzer-dll$(EXT) zstreamtest-dll$(EXT) zbufftest-dll$(EXT)\
|
2016-12-16 21:29:23 +00:00
|
|
|
zstreamtest$(EXT) zstreamtest32$(EXT) \
|
|
|
|
datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \
|
2017-07-10 18:32:30 +00:00
|
|
|
symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \
|
2017-02-22 23:59:15 +00:00
|
|
|
decodecorpus$(EXT)
|
2016-05-23 12:23:55 +00:00
|
|
|
@echo Cleaning completed
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------------
|
2016-12-22 17:05:07 +00:00
|
|
|
#make valgrindTest is validated only for Linux, OSX, BSD, Hurd and Solaris targets
|
2016-08-18 11:18:11 +00:00
|
|
|
#----------------------------------------------------------------------------------
|
2016-12-22 17:05:07 +00:00
|
|
|
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
2016-08-18 11:18:11 +00:00
|
|
|
HOST_OS = POSIX
|
|
|
|
|
2017-07-01 14:05:11 +00:00
|
|
|
valgrindTest: VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
|
2016-11-16 16:50:54 +00:00
|
|
|
valgrindTest: zstd datagen fuzzer fullbench
|
2016-08-18 11:18:11 +00:00
|
|
|
@echo "\n ---- valgrind tests : memory analyzer ----"
|
|
|
|
$(VALGRIND) ./datagen -g50M > $(VOID)
|
2016-08-18 11:53:26 +00:00
|
|
|
$(VALGRIND) $(PRGDIR)/zstd ; if [ $$? -eq 0 ] ; then echo "zstd without argument should have failed"; false; fi
|
|
|
|
./datagen -g80 | $(VALGRIND) $(PRGDIR)/zstd - -c > $(VOID)
|
2016-09-01 22:46:09 +00:00
|
|
|
./datagen -g16KB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
|
2016-08-18 11:53:26 +00:00
|
|
|
./datagen -g2930KB | $(VALGRIND) $(PRGDIR)/zstd -5 -vf - -o tmp
|
2016-09-01 22:46:09 +00:00
|
|
|
$(VALGRIND) $(PRGDIR)/zstd -vdf tmp -c > $(VOID)
|
|
|
|
./datagen -g64MB | $(VALGRIND) $(PRGDIR)/zstd -vf - -c > $(VOID)
|
2016-08-18 11:18:11 +00:00
|
|
|
@rm tmp
|
|
|
|
$(VALGRIND) ./fuzzer -T1mn -t1
|
|
|
|
$(VALGRIND) ./fullbench -i1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifneq (,$(filter MSYS%,$(shell uname)))
|
|
|
|
HOST_OS = MSYS
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2016-12-22 17:05:07 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
#make tests validated only for MSYS, Linux, OSX, BSD, Hurd and Solaris targets
|
|
|
|
#-----------------------------------------------------------------------------
|
2016-08-18 11:18:11 +00:00
|
|
|
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
2016-12-22 17:05:07 +00:00
|
|
|
|
|
|
|
DIFF:=diff
|
|
|
|
ifneq (,$(filter $(shell uname),SunOS))
|
|
|
|
DIFF:=gdiff
|
|
|
|
endif
|
|
|
|
|
2016-08-18 11:18:11 +00:00
|
|
|
zstd-playTests: datagen
|
2016-11-14 16:26:58 +00:00
|
|
|
file $(ZSTD)
|
2016-11-14 11:57:05 +00:00
|
|
|
ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-03-02 01:02:49 +00:00
|
|
|
shortest: ZSTDRTTEST=
|
|
|
|
shortest: test-zstd
|
|
|
|
|
2017-03-07 20:08:15 +00:00
|
|
|
fuzztest: test-fuzzer test-zstream test-decodecorpus
|
|
|
|
|
2017-02-22 23:59:15 +00:00
|
|
|
test: test-zstd test-fullbench test-fuzzer test-zstream test-invalidDictionaries test-legacy test-decodecorpus
|
2017-02-14 18:08:14 +00:00
|
|
|
ifeq ($(QEMU_SYS),)
|
2017-02-08 12:58:04 +00:00
|
|
|
test: test-pool
|
|
|
|
endif
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-16 16:50:54 +00:00
|
|
|
test32: test-zstd32 test-fullbench32 test-fuzzer32 test-zstream32
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2017-06-24 00:10:41 +00:00
|
|
|
test-all: test test32 valgrindTest test-decodecorpus-cli
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-08-18 11:53:26 +00:00
|
|
|
test-zstd: ZSTD = $(PRGDIR)/zstd
|
2016-08-18 11:18:11 +00:00
|
|
|
test-zstd: zstd zstd-playTests
|
|
|
|
|
2016-08-18 11:53:26 +00:00
|
|
|
test-zstd32: ZSTD = $(PRGDIR)/zstd32
|
2016-08-18 11:18:11 +00:00
|
|
|
test-zstd32: zstd32 zstd-playTests
|
|
|
|
|
2017-08-20 17:15:44 +00:00
|
|
|
test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy
|
2016-11-03 08:11:56 +00:00
|
|
|
test-zstd-nolegacy: zstd-nolegacy zstd-playTests
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-11-30 14:20:24 +00:00
|
|
|
test-gzstd: gzstd
|
2017-08-31 22:02:14 +00:00
|
|
|
$(PRGDIR)/zstd -f README.md test-zstd-speed.py
|
|
|
|
gzip -f README.md test-zstd-speed.py
|
2016-12-05 17:02:40 +00:00
|
|
|
cat README.md.zst test-zstd-speed.py.gz >zstd_gz.zst
|
|
|
|
cat README.md.gz test-zstd-speed.py.zst >gz_zstd.gz
|
2017-08-31 22:02:14 +00:00
|
|
|
$(PRGDIR)/zstd -df README.md.gz -o README2.md
|
|
|
|
$(PRGDIR)/zstd -df README.md.gz test-zstd-speed.py.gz
|
|
|
|
$(PRGDIR)/zstd -df zstd_gz.zst gz_zstd.gz
|
2016-12-22 17:05:07 +00:00
|
|
|
$(DIFF) -q zstd_gz gz_zstd
|
2016-12-05 17:31:14 +00:00
|
|
|
echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst
|
|
|
|
echo Hello World GZIP | gzip -c - >hello.gz
|
|
|
|
echo Hello World TEXT >hello.txt
|
|
|
|
cat hello.zst hello.gz hello.txt >hello_zst_gz_txt.gz
|
|
|
|
$(PRGDIR)/zstd -dcf hello.*
|
|
|
|
$(PRGDIR)/zstd -dcf - <hello_zst_gz_txt.gz
|
2017-08-31 22:02:14 +00:00
|
|
|
$(RM) *.gz *.zst README2.md gz_zstd zstd_gz hello.txt
|
2016-11-30 14:20:24 +00:00
|
|
|
|
2016-08-18 11:18:11 +00:00
|
|
|
test-fullbench: fullbench datagen
|
2016-11-14 11:57:05 +00:00
|
|
|
$(QEMU_SYS) ./fullbench -i1
|
|
|
|
$(QEMU_SYS) ./fullbench -i1 -P0
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-fullbench32: fullbench32 datagen
|
2016-11-14 11:57:05 +00:00
|
|
|
$(QEMU_SYS) ./fullbench32 -i1
|
|
|
|
$(QEMU_SYS) ./fullbench32 -i1 -P0
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-fuzzer: fuzzer
|
2017-03-20 18:32:24 +00:00
|
|
|
$(QEMU_SYS) ./fuzzer $(FUZZERTEST) $(FUZZER_FLAGS)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-fuzzer32: fuzzer32
|
2017-03-20 18:32:24 +00:00
|
|
|
$(QEMU_SYS) ./fuzzer32 $(FUZZERTEST) $(FUZZER_FLAGS)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-zbuff: zbufftest
|
2016-12-06 03:28:19 +00:00
|
|
|
$(QEMU_SYS) ./zbufftest $(ZSTREAM_TESTTIME)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-zbuff32: zbufftest32
|
2016-12-06 03:28:19 +00:00
|
|
|
$(QEMU_SYS) ./zbufftest32 $(ZSTREAM_TESTTIME)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-zstream: zstreamtest
|
2017-03-20 18:32:24 +00:00
|
|
|
$(QEMU_SYS) ./zstreamtest $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2017-06-17 00:56:41 +00:00
|
|
|
$(QEMU_SYS) ./zstreamtest --mt $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
|
|
|
$(QEMU_SYS) ./zstreamtest --newapi $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2017-08-24 23:28:49 +00:00
|
|
|
$(QEMU_SYS) ./zstreamtest --opaqueapi $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
|
|
|
test-zstream32: zstreamtest32
|
2017-03-20 18:32:24 +00:00
|
|
|
$(QEMU_SYS) ./zstreamtest32 $(ZSTREAM_TESTTIME) $(FUZZER_FLAGS)
|
2016-08-18 11:18:11 +00:00
|
|
|
|
2016-12-11 03:12:13 +00:00
|
|
|
test-longmatch: longmatch
|
|
|
|
$(QEMU_SYS) ./longmatch
|
|
|
|
|
2016-12-20 19:13:45 +00:00
|
|
|
test-invalidDictionaries: invalidDictionaries
|
|
|
|
$(QEMU_SYS) ./invalidDictionaries
|
|
|
|
|
2016-12-16 21:29:23 +00:00
|
|
|
test-symbols: symbols
|
|
|
|
$(QEMU_SYS) ./symbols
|
|
|
|
|
2017-02-08 21:56:32 +00:00
|
|
|
test-legacy: legacy
|
|
|
|
$(QEMU_SYS) ./legacy
|
|
|
|
|
2017-02-22 23:59:15 +00:00
|
|
|
test-decodecorpus: decodecorpus
|
|
|
|
$(QEMU_SYS) ./decodecorpus -t $(DECODECORPUS_TESTTIME)
|
|
|
|
|
2017-06-22 20:53:39 +00:00
|
|
|
test-decodecorpus-cli: decodecorpus
|
|
|
|
@echo "\n ---- decodecorpus basic cli tests ----"
|
2017-06-22 21:43:44 +00:00
|
|
|
@mkdir testdir
|
|
|
|
./decodecorpus -n5 -otestdir -ptestdir
|
2017-06-22 22:13:41 +00:00
|
|
|
@cd testdir && \
|
|
|
|
$(ZSTD) -d z000000.zst -o tmp0 && \
|
|
|
|
$(ZSTD) -d z000001.zst -o tmp1 && \
|
|
|
|
$(ZSTD) -d z000002.zst -o tmp2 && \
|
|
|
|
$(ZSTD) -d z000003.zst -o tmp3 && \
|
|
|
|
$(ZSTD) -d z000004.zst -o tmp4 && \
|
|
|
|
diff z000000 tmp0 && \
|
|
|
|
diff z000001 tmp1 && \
|
|
|
|
diff z000002 tmp2 && \
|
|
|
|
diff z000003 tmp3 && \
|
|
|
|
diff z000004 tmp4 && \
|
|
|
|
rm ./* && \
|
|
|
|
cd ..
|
2017-06-22 22:23:59 +00:00
|
|
|
@echo "\n ---- decodecorpus dictionary cli tests ----"
|
2017-06-22 21:43:44 +00:00
|
|
|
./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
|
2017-06-22 22:13:41 +00:00
|
|
|
@cd testdir && \
|
|
|
|
$(ZSTD) -d z000000.zst -D dictionary -o tmp0 && \
|
|
|
|
$(ZSTD) -d z000001.zst -D dictionary -o tmp1 && \
|
|
|
|
$(ZSTD) -d z000002.zst -D dictionary -o tmp2 && \
|
|
|
|
$(ZSTD) -d z000003.zst -D dictionary -o tmp3 && \
|
|
|
|
$(ZSTD) -d z000004.zst -D dictionary -o tmp4 && \
|
|
|
|
diff z000000 tmp0 && \
|
|
|
|
diff z000001 tmp1 && \
|
|
|
|
diff z000002 tmp2 && \
|
|
|
|
diff z000003 tmp3 && \
|
|
|
|
diff z000004 tmp4 && \
|
2017-06-22 22:44:01 +00:00
|
|
|
cd ..
|
2017-06-22 21:43:44 +00:00
|
|
|
@rm -rf testdir
|
2017-06-22 20:53:39 +00:00
|
|
|
|
2017-07-10 18:32:30 +00:00
|
|
|
test-pool: poolTests
|
|
|
|
$(QEMU_SYS) ./poolTests
|
2016-12-30 07:41:03 +00:00
|
|
|
|
2016-08-18 11:18:11 +00:00
|
|
|
endif
|