2016-11-03 14:03:43 +00:00
|
|
|
# ##########################################################################
|
|
|
|
# LZ4 programs - Makefile
|
2020-12-01 01:42:36 +00:00
|
|
|
# Copyright (C) Yann Collet 2011-2020
|
2017-01-19 15:28:08 +00:00
|
|
|
#
|
2016-11-03 14:03:43 +00:00
|
|
|
# GPL v2 License
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# You can contact the author at :
|
|
|
|
# - LZ4 homepage : http://www.lz4.org
|
2016-11-03 14:12:57 +00:00
|
|
|
# - LZ4 source repository : https://github.com/lz4/lz4
|
2016-11-03 14:03:43 +00:00
|
|
|
# ##########################################################################
|
|
|
|
# fuzzer : Test tool, to check lz4 integrity on target platform
|
|
|
|
# frametest : Test tool, to check lz4frame integrity on target platform
|
|
|
|
# fullbench : Precisely measure speed for each LZ4 function variant
|
|
|
|
# datagen : generates synthetic data samples for tests & benchmarks
|
|
|
|
# ##########################################################################
|
|
|
|
|
2017-06-26 09:07:09 +00:00
|
|
|
LZ4DIR := ../lib
|
2016-11-03 14:03:43 +00:00
|
|
|
PRGDIR := ../programs
|
2016-11-03 15:17:38 +00:00
|
|
|
TESTDIR := versionsTest
|
2016-11-10 09:25:41 +00:00
|
|
|
PYTHON ?= python3
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2018-03-21 14:14:13 +00:00
|
|
|
DEBUGLEVEL?= 1
|
|
|
|
DEBUGFLAGS = -g -DLZ4_DEBUG=$(DEBUGLEVEL)
|
2020-09-17 17:29:31 +00:00
|
|
|
CFLAGS ?= -O3 # can select custom optimization flags. Example : CFLAGS=-O2 make
|
2017-12-22 10:54:43 +00:00
|
|
|
CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow \
|
2017-08-21 22:26:03 +00:00
|
|
|
-Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \
|
2016-11-14 18:16:11 +00:00
|
|
|
-Wpointer-arith -Wstrict-aliasing=1
|
2017-12-22 10:54:43 +00:00
|
|
|
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
|
2018-04-11 23:41:25 +00:00
|
|
|
CPPFLAGS+= -I$(LZ4DIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
|
2016-11-17 21:02:06 +00:00
|
|
|
FLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2019-04-22 19:48:48 +00:00
|
|
|
include ../Makefile.inc
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2018-02-26 22:09:46 +00:00
|
|
|
LZ4 := $(PRGDIR)/lz4$(EXT)
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Default test parameters
|
|
|
|
TEST_FILES := COPYING
|
2018-04-11 23:31:43 +00:00
|
|
|
FUZZER_TIME := -T90s
|
2016-11-10 09:25:41 +00:00
|
|
|
NB_LOOPS ?= -i1
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2020-11-09 05:17:32 +00:00
|
|
|
.PHONY: default
|
2016-11-17 21:02:06 +00:00
|
|
|
default: all
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2020-08-12 21:42:10 +00:00
|
|
|
all: fullbench fuzzer frametest roundTripTest datagen checkFrame decompress-partial
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
all32: CFLAGS+=-m32
|
|
|
|
all32: all
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
lz4:
|
2017-08-21 22:26:03 +00:00
|
|
|
$(MAKE) -C $(PRGDIR) $@ CFLAGS="$(CFLAGS)"
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2018-05-04 21:33:59 +00:00
|
|
|
lib liblz4.pc:
|
|
|
|
$(MAKE) -C $(LZ4DIR) $@ CFLAGS="$(CFLAGS)"
|
|
|
|
|
2017-08-25 00:58:13 +00:00
|
|
|
lz4c unlz4 lz4cat: lz4
|
2019-04-23 11:44:00 +00:00
|
|
|
$(LN_SF) $(LZ4) $(PRGDIR)/$@
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
lz4c32: # create a 32-bits version for 32/64 interop tests
|
2017-08-21 22:26:03 +00:00
|
|
|
$(MAKE) -C $(PRGDIR) $@ CFLAGS="-m32 $(CFLAGS)"
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2017-12-27 12:02:40 +00:00
|
|
|
%.o : $(LZ4DIR)/%.c $(LZ4DIR)/%.h
|
|
|
|
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
|
|
|
|
|
2018-04-23 22:42:27 +00:00
|
|
|
fullbench : DEBUGLEVEL=0
|
|
|
|
fullbench : lz4.o lz4hc.o lz4frame.o xxhash.o fullbench.c
|
2016-11-03 14:03:43 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2017-12-27 12:02:40 +00:00
|
|
|
$(LZ4DIR)/liblz4.a:
|
2017-06-26 09:07:09 +00:00
|
|
|
$(MAKE) -C $(LZ4DIR) liblz4.a
|
2017-12-27 12:02:40 +00:00
|
|
|
|
|
|
|
fullbench-lib: fullbench.c $(LZ4DIR)/liblz4.a
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2017-06-26 09:07:09 +00:00
|
|
|
fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
|
|
|
|
$(MAKE) -C $(LZ4DIR) liblz4
|
2019-04-22 17:48:59 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/$(LIBLZ4).dll
|
2016-11-09 14:19:29 +00:00
|
|
|
|
2020-11-09 05:17:32 +00:00
|
|
|
# test LZ4_USER_MEMORY_FUNCTIONS
|
|
|
|
fullbench-wmalloc: CPPFLAGS += -DLZ4_USER_MEMORY_FUNCTIONS
|
|
|
|
fullbench-wmalloc: fullbench
|
|
|
|
|
2017-12-27 12:02:40 +00:00
|
|
|
fuzzer : lz4.o lz4hc.o xxhash.o fuzzer.c
|
2016-11-03 14:03:43 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2017-12-27 12:02:40 +00:00
|
|
|
frametest: lz4frame.o lz4.o lz4hc.o xxhash.o frametest.c
|
2016-11-03 14:03:43 +00:00
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2018-09-04 23:50:34 +00:00
|
|
|
roundTripTest : lz4.o lz4hc.o xxhash.o roundTripTest.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2016-11-03 14:03:43 +00:00
|
|
|
datagen : $(PRGDIR)/datagen.c datagencli.c
|
|
|
|
$(CC) $(FLAGS) -I$(PRGDIR) $^ -o $@$(EXT)
|
|
|
|
|
2018-09-28 15:02:49 +00:00
|
|
|
checkFrame : lz4frame.o lz4.o lz4hc.o xxhash.o checkFrame.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
|
|
|
|
2020-08-12 21:42:10 +00:00
|
|
|
decompress-partial: lz4.o decompress-partial.c
|
|
|
|
$(CC) $(FLAGS) $^ -o $@$(EXT)
|
2020-08-27 06:20:28 +00:00
|
|
|
|
2020-11-09 05:17:32 +00:00
|
|
|
.PHONY: clean
|
2016-11-03 14:03:43 +00:00
|
|
|
clean:
|
2017-06-26 09:07:09 +00:00
|
|
|
@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
|
2016-11-17 22:39:49 +00:00
|
|
|
@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
|
2019-04-08 21:01:32 +00:00
|
|
|
@$(RM) -rf core *.o *.test tmp* \
|
2016-11-10 13:43:51 +00:00
|
|
|
fullbench-dll$(EXT) fullbench-lib$(EXT) \
|
2016-11-03 14:03:43 +00:00
|
|
|
fullbench$(EXT) fullbench32$(EXT) \
|
|
|
|
fuzzer$(EXT) fuzzer32$(EXT) \
|
|
|
|
frametest$(EXT) frametest32$(EXT) \
|
2018-09-05 21:05:08 +00:00
|
|
|
fasttest$(EXT) roundTripTest$(EXT) \
|
2018-09-28 15:02:49 +00:00
|
|
|
datagen$(EXT) checkTag$(EXT) \
|
2020-08-12 21:42:10 +00:00
|
|
|
frameTest$(EXT) decompress-partial$(EXT) \
|
|
|
|
lz4_all.c
|
2019-04-08 21:01:32 +00:00
|
|
|
@$(RM) -rf $(TESTDIR)
|
2016-11-03 14:03:43 +00:00
|
|
|
@echo Cleaning completed
|
|
|
|
|
2016-11-17 22:54:30 +00:00
|
|
|
.PHONY: versionsTest
|
2016-11-03 15:01:50 +00:00
|
|
|
versionsTest:
|
|
|
|
$(PYTHON) test-lz4-versions.py
|
|
|
|
|
2019-05-10 15:54:05 +00:00
|
|
|
.PHONY: listTest
|
|
|
|
listTest: lz4
|
|
|
|
QEMU_SYS=$(QEMU_SYS) $(PYTHON) test-lz4-list.py
|
|
|
|
|
2018-01-15 00:57:25 +00:00
|
|
|
checkTag: checkTag.c $(LZ4DIR)/lz4.h
|
|
|
|
$(CC) $(FLAGS) $< -o $@$(EXT)
|
|
|
|
|
2017-02-10 14:00:27 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-08-25 00:58:13 +00:00
|
|
|
# validated only for Linux, OSX, BSD, Hurd and Solaris targets
|
2017-02-10 14:00:27 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2019-04-22 20:06:04 +00:00
|
|
|
ifeq ($(POSIX_ENV),Yes)
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
MD5:=md5sum
|
2021-08-16 23:43:17 +00:00
|
|
|
ifneq (,$(filter $(shell $(UNAME)), Darwin ))
|
2016-11-17 21:02:06 +00:00
|
|
|
MD5:=md5 -r
|
|
|
|
endif
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2019-04-21 19:42:13 +00:00
|
|
|
# note : we should probably settle on a single compare utility
|
|
|
|
CMP:=cmp
|
2016-12-22 16:18:39 +00:00
|
|
|
DIFF:=diff
|
2021-08-16 23:43:17 +00:00
|
|
|
ifneq (,$(filter $(shell $(UNAME)),SunOS))
|
2016-12-22 16:18:39 +00:00
|
|
|
DIFF:=gdiff
|
|
|
|
endif
|
|
|
|
|
2020-08-25 21:25:51 +00:00
|
|
|
CAT:=cat
|
2017-09-22 21:50:11 +00:00
|
|
|
DD:=dd
|
2020-08-25 21:25:51 +00:00
|
|
|
DATAGEN:=./datagen
|
2017-09-22 21:50:11 +00:00
|
|
|
|
2019-04-08 20:45:01 +00:00
|
|
|
.PHONY: list
|
|
|
|
list:
|
|
|
|
@$(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
|
2016-12-22 16:18:39 +00:00
|
|
|
|
2020-08-10 17:54:35 +00:00
|
|
|
.PHONY: check
|
|
|
|
check: test-lz4-essentials
|
|
|
|
|
2019-04-08 20:45:01 +00:00
|
|
|
.PHONY: test
|
2020-08-12 21:42:10 +00:00
|
|
|
test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install test-amalgamation listTest test-decompress-partial
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2019-04-08 20:45:01 +00:00
|
|
|
.PHONY: test32
|
2016-11-17 21:02:06 +00:00
|
|
|
test32: CFLAGS+=-m32
|
|
|
|
test32: test
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2019-04-23 21:18:11 +00:00
|
|
|
test-amalgamation: lz4_all.o
|
|
|
|
|
|
|
|
lz4_all.c: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) $^ > $@
|
2018-11-16 17:12:26 +00:00
|
|
|
|
2018-05-04 21:33:59 +00:00
|
|
|
test-install: lz4 lib liblz4.pc
|
2018-05-04 20:35:10 +00:00
|
|
|
lz4_root=.. ./test_install.sh
|
|
|
|
|
2016-11-03 14:03:43 +00:00
|
|
|
test-lz4-sparse: lz4 datagen
|
|
|
|
@echo "\n ---- test sparse file support ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g5M -P100 > tmplsdg5M
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -B4D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB4
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -s tmplsdg5M tmplscB4
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -B5D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB5
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -s tmplsdg5M tmplscB5
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -B6D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB6
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -s tmplsdg5M tmplscB6
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -B7D tmplsdg5M -c | $(LZ4) -dv --sparse > tmplscB7
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -s tmplsdg5M tmplscB7
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) tmplsdg5M -c | $(LZ4) -dv --no-sparse > tmplsnosparse
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -s tmplsdg5M tmplsnosparse
|
|
|
|
ls -ls tmpls*
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -s1 -g1200007 -P100 | $(LZ4) | $(LZ4) -dv --sparse > tmplsodd # Odd size file (to generate non-full last block)
|
|
|
|
$(DATAGEN) -s1 -g1200007 -P100 | $(DIFF) -s - tmplsodd
|
2017-08-21 22:26:03 +00:00
|
|
|
ls -ls tmplsodd
|
|
|
|
@$(RM) tmpls*
|
2016-11-03 14:03:43 +00:00
|
|
|
@echo "\n Compatibility with Console :"
|
2016-11-17 21:02:06 +00:00
|
|
|
echo "Hello World 1 !" | $(LZ4) | $(LZ4) -d -c
|
2020-08-25 21:25:51 +00:00
|
|
|
echo "Hello World 2 !" | $(LZ4) | $(LZ4) -d | $(CAT)
|
2016-11-17 21:02:06 +00:00
|
|
|
echo "Hello World 3 !" | $(LZ4) --no-frame-crc | $(LZ4) -d -c
|
2016-11-03 14:03:43 +00:00
|
|
|
@echo "\n Compatibility with Append :"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -P100 -g1M > tmplsdg1M
|
|
|
|
$(CAT) tmplsdg1M tmplsdg1M > tmpls2M
|
2017-08-21 22:26:03 +00:00
|
|
|
$(LZ4) -B5 -v tmplsdg1M tmplsc
|
|
|
|
$(LZ4) -d -v tmplsc tmplsr
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -d -v tmplsc -c >> tmplsr
|
2016-11-03 14:03:43 +00:00
|
|
|
ls -ls tmp*
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) tmpls2M tmplsr
|
|
|
|
@$(RM) tmpls*
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-lz4-contentSize: lz4 datagen
|
|
|
|
@echo "\n ---- test original size support ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g15M > tmplc1
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -v tmplc1 -c | $(LZ4) -t
|
|
|
|
$(LZ4) -v --content-size tmplc1 -c | $(LZ4) -d > tmplc2
|
2020-08-25 21:42:15 +00:00
|
|
|
$(DIFF) tmplc1 tmplc2
|
2020-08-25 21:53:08 +00:00
|
|
|
$(LZ4) -f tmplc1 -c > tmplc1.lz4
|
2020-08-25 21:42:15 +00:00
|
|
|
$(LZ4) --content-size tmplc1 -c > tmplc2.lz4
|
|
|
|
! $(DIFF) tmplc1.lz4 tmplc2.lz4 # must differ, due to content size
|
|
|
|
$(LZ4) --content-size < tmplc1 > tmplc3.lz4
|
|
|
|
$(DIFF) tmplc2.lz4 tmplc3.lz4 # both must contain content size
|
|
|
|
$(CAT) tmplc1 | $(LZ4) > tmplc4.lz4
|
|
|
|
$(DIFF) tmplc1.lz4 tmplc4.lz4 # both don't have content size
|
|
|
|
$(CAT) tmplc1 | $(LZ4) --content-size > tmplc5.lz4 # can't determine content size
|
|
|
|
$(DIFF) tmplc1.lz4 tmplc5.lz4 # both don't have content size
|
2017-08-21 22:26:03 +00:00
|
|
|
@$(RM) tmplc*
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-lz4-frame-concatenation: lz4 datagen
|
|
|
|
@echo "\n ---- test frame concatenation ----"
|
2017-08-21 22:26:03 +00:00
|
|
|
@echo -n > tmp-lfc-empty
|
|
|
|
@echo hi > tmp-lfc-nonempty
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-lfc-nonempty tmp-lfc-empty tmp-lfc-nonempty > tmp-lfc-src
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -zq tmp-lfc-empty -c > tmp-lfc-empty.lz4
|
|
|
|
$(LZ4) -zq tmp-lfc-nonempty -c > tmp-lfc-nonempty.lz4
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-lfc-nonempty.lz4 tmp-lfc-empty.lz4 tmp-lfc-nonempty.lz4 > tmp-lfc-concat.lz4
|
2019-04-20 00:08:40 +00:00
|
|
|
$(LZ4) -d tmp-lfc-concat.lz4 -c > tmp-lfc-result
|
2019-04-21 19:42:13 +00:00
|
|
|
$(CMP) tmp-lfc-src tmp-lfc-result
|
2017-08-21 22:26:03 +00:00
|
|
|
@$(RM) tmp-lfc-*
|
2016-11-03 14:03:43 +00:00
|
|
|
@echo frame concatenation test completed
|
|
|
|
|
|
|
|
test-lz4-multiple: lz4 datagen
|
|
|
|
@echo "\n ---- test multiple files ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
@$(DATAGEN) -s1 > tmp-tlm1 2> $(VOID)
|
|
|
|
@$(DATAGEN) -s2 -g100K > tmp-tlm2 2> $(VOID)
|
|
|
|
@$(DATAGEN) -s3 -g200K > tmp-tlm3 2> $(VOID)
|
2019-04-12 22:55:38 +00:00
|
|
|
# compress multiple files : one .lz4 per source file
|
2017-08-21 22:26:03 +00:00
|
|
|
$(LZ4) -f -m tmp-tlm*
|
2019-04-12 22:17:48 +00:00
|
|
|
test -f tmp-tlm1.lz4
|
|
|
|
test -f tmp-tlm2.lz4
|
|
|
|
test -f tmp-tlm3.lz4
|
2019-04-12 22:55:38 +00:00
|
|
|
# decompress multiple files : one output file per .lz4
|
|
|
|
mv tmp-tlm1 tmp-tlm1-orig
|
|
|
|
mv tmp-tlm2 tmp-tlm2-orig
|
|
|
|
mv tmp-tlm3 tmp-tlm3-orig
|
|
|
|
$(LZ4) -d -f -m tmp-tlm*.lz4
|
2019-04-21 19:42:13 +00:00
|
|
|
$(CMP) tmp-tlm1 tmp-tlm1-orig # must be identical
|
|
|
|
$(CMP) tmp-tlm2 tmp-tlm2-orig
|
|
|
|
$(CMP) tmp-tlm3 tmp-tlm3-orig
|
2019-04-12 22:55:38 +00:00
|
|
|
# compress multiple files into stdout
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 > tmp-tlm-concat1
|
2019-04-12 22:17:48 +00:00
|
|
|
$(RM) *.lz4
|
2019-04-12 22:55:38 +00:00
|
|
|
$(LZ4) -m tmp-tlm1 tmp-tlm2 tmp-tlm3 -c > tmp-tlm-concat2
|
2019-04-12 22:17:48 +00:00
|
|
|
test ! -f tmp-tlm1.lz4 # must not create .lz4 artefact
|
2019-04-21 19:42:13 +00:00
|
|
|
$(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
|
2019-04-12 22:55:38 +00:00
|
|
|
# decompress multiple files into stdout
|
|
|
|
$(RM) tmp-tlm-concat1 tmp-tlm-concat2
|
|
|
|
$(LZ4) -f -m tmp-tlm1 tmp-tlm2 tmp-tlm3 # generate .lz4 to decompress
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-tlm1 tmp-tlm2 tmp-tlm3 > tmp-tlm-concat1 # create concatenated reference
|
2019-04-12 22:55:38 +00:00
|
|
|
$(RM) tmp-tlm1 tmp-tlm2 tmp-tlm3
|
|
|
|
$(LZ4) -d -m tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 -c > tmp-tlm-concat2
|
|
|
|
test ! -f tmp-tlm1 # must not create file artefact
|
2019-04-21 19:42:13 +00:00
|
|
|
$(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
|
2019-04-12 22:55:38 +00:00
|
|
|
# compress multiple files, one of which is absent (must fail)
|
|
|
|
! $(LZ4) -f -m tmp-tlm-concat1 notHere tmp-tlm-concat2 # must fail : notHere not present
|
2017-08-21 22:26:03 +00:00
|
|
|
@$(RM) tmp-tlm*
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2020-02-08 01:06:40 +00:00
|
|
|
test-lz4-multiple-legacy: lz4 datagen
|
|
|
|
@echo "\n ---- test multiple files (Legacy format) ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
@$(DATAGEN) -s1 > tmp-tlm1 2> $(VOID)
|
|
|
|
@$(DATAGEN) -s2 -g100K > tmp-tlm2 2> $(VOID)
|
|
|
|
@$(DATAGEN) -s3 -g200K > tmp-tlm3 2> $(VOID)
|
2020-02-08 01:06:40 +00:00
|
|
|
# compress multiple files using legacy format: one .lz4 per source file
|
|
|
|
$(LZ4) -f -l -m tmp-tlm*
|
|
|
|
test -f tmp-tlm1.lz4
|
|
|
|
test -f tmp-tlm2.lz4
|
|
|
|
test -f tmp-tlm3.lz4
|
|
|
|
# decompress multiple files compressed using legacy format: one output file per .lz4
|
|
|
|
mv tmp-tlm1 tmp-tlm1-orig
|
|
|
|
mv tmp-tlm2 tmp-tlm2-orig
|
|
|
|
mv tmp-tlm3 tmp-tlm3-orig
|
|
|
|
$(LZ4) -d -f -m tmp-tlm*.lz4
|
|
|
|
$(LZ4) -l -d -f -m tmp-tlm*.lz4 # -l mustn't impact -d option
|
|
|
|
$(CMP) tmp-tlm1 tmp-tlm1-orig # must be identical
|
|
|
|
$(CMP) tmp-tlm2 tmp-tlm2-orig
|
|
|
|
$(CMP) tmp-tlm3 tmp-tlm3-orig
|
|
|
|
# compress multiple files into stdout using legacy format
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 > tmp-tlm-concat1
|
2020-02-08 01:06:40 +00:00
|
|
|
$(RM) *.lz4
|
|
|
|
$(LZ4) -l -m tmp-tlm1 tmp-tlm2 tmp-tlm3 -c > tmp-tlm-concat2
|
|
|
|
test ! -f tmp-tlm1.lz4 # must not create .lz4 artefact
|
|
|
|
$(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
|
|
|
|
# # # decompress multiple files into stdout using legacy format
|
|
|
|
$(RM) tmp-tlm-concat1 tmp-tlm-concat2
|
|
|
|
$(LZ4) -l -f -m tmp-tlm1 tmp-tlm2 tmp-tlm3 # generate .lz4 to decompress
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-tlm1 tmp-tlm2 tmp-tlm3 > tmp-tlm-concat1 # create concatenated reference
|
2020-02-08 01:06:40 +00:00
|
|
|
$(RM) tmp-tlm1 tmp-tlm2 tmp-tlm3
|
|
|
|
$(LZ4) -d -m tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 -c > tmp-tlm-concat2
|
|
|
|
$(LZ4) -d -l -m tmp-tlm1.lz4 tmp-tlm2.lz4 tmp-tlm3.lz4 -c > tmp-tlm-concat2 # -l mustn't impact option -d
|
|
|
|
test ! -f tmp-tlm1 # must not create file artefact
|
|
|
|
$(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
|
|
|
|
# # # compress multiple files, one of which is absent (must fail)
|
|
|
|
! $(LZ4) -f -l -m tmp-tlm-concat1 notHere-legacy tmp-tlm-concat2 # must fail : notHere-legacy not present
|
|
|
|
@$(RM) tmp-tlm*
|
|
|
|
|
2016-12-07 22:49:04 +00:00
|
|
|
test-lz4-basic: lz4 datagen unlz4 lz4cat
|
2016-11-03 14:03:43 +00:00
|
|
|
@echo "\n ---- test lz4 basic compression/decompression ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g0 | $(LZ4) -v | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g16KB | $(LZ4) -9 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g20KB > tmp-tlb-dg20k
|
2017-08-21 22:26:03 +00:00
|
|
|
$(LZ4) < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
|
|
|
|
$(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
|
|
|
|
$(LZ4) --no-frame-crc < tmp-tlb-dg20k | $(LZ4) -d > tmp-tlb-dec
|
|
|
|
$(DIFF) -q tmp-tlb-dg20k tmp-tlb-dec
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) | $(LZ4) -BI | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g6M -P99 | $(LZ4) -9BD | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g17M | $(LZ4) -9v | $(LZ4) -qt
|
|
|
|
$(DATAGEN) -g33M | $(LZ4) --no-frame-crc | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
|
2017-08-21 22:26:03 +00:00
|
|
|
@echo "hello world" > tmp-tlb-hw
|
|
|
|
$(LZ4) --rm -f tmp-tlb-hw tmp-tlb-hw.lz4
|
|
|
|
test ! -f tmp-tlb-hw # must fail (--rm)
|
|
|
|
test -f tmp-tlb-hw.lz4
|
|
|
|
$(PRGDIR)/lz4cat tmp-tlb-hw.lz4 # must display hello world
|
|
|
|
test -f tmp-tlb-hw.lz4
|
|
|
|
$(PRGDIR)/unlz4 --rm tmp-tlb-hw.lz4 tmp-tlb-hw
|
|
|
|
test -f tmp-tlb-hw
|
|
|
|
test ! -f tmp-tlb-hw.lz4 # must fail (--rm)
|
|
|
|
test ! -f tmp-tlb-hw.lz4.lz4 # must fail (unlz4)
|
|
|
|
$(PRGDIR)/lz4cat tmp-tlb-hw # pass-through mode
|
|
|
|
test -f tmp-tlb-hw
|
|
|
|
test ! -f tmp-tlb-hw.lz4 # must fail (lz4cat)
|
|
|
|
$(LZ4) tmp-tlb-hw tmp-tlb-hw.lz4 # creates tmp-tlb-hw.lz4
|
|
|
|
$(PRGDIR)/lz4cat < tmp-tlb-hw.lz4 > tmp-tlb3 # checks lz4cat works with stdin (#285)
|
|
|
|
$(DIFF) -q tmp-tlb-hw tmp-tlb3
|
|
|
|
$(PRGDIR)/lz4cat < tmp-tlb-hw > tmp-tlb2 # checks lz4cat works in pass-through mode
|
|
|
|
$(DIFF) -q tmp-tlb-hw tmp-tlb2
|
|
|
|
cp tmp-tlb-hw ./-d
|
|
|
|
$(LZ4) --rm -- -d -d.lz4 # compresses ./d into ./-d.lz4
|
2017-03-23 03:48:51 +00:00
|
|
|
test -f ./-d.lz4
|
|
|
|
test ! -f ./-d
|
|
|
|
mv ./-d.lz4 ./-z
|
2017-08-21 22:26:03 +00:00
|
|
|
$(LZ4) -d --rm -- -z tmp-tlb4 # uncompresses ./-z into tmp-tlb4
|
2017-03-23 03:48:51 +00:00
|
|
|
test ! -f ./-z
|
2017-08-21 22:26:03 +00:00
|
|
|
$(DIFF) -q tmp-tlb-hw tmp-tlb4
|
|
|
|
$(LZ4) -f tmp-tlb-hw
|
2019-04-22 21:01:19 +00:00
|
|
|
$(LZ4) --list tmp-tlb-hw.lz4 # test --list on valid single-frame file
|
2020-08-25 21:25:51 +00:00
|
|
|
$(CAT) tmp-tlb-hw >> tmp-tlb-hw.lz4
|
2017-08-21 22:26:03 +00:00
|
|
|
$(LZ4) -f tmp-tlb-hw.lz4 # uncompress valid frame followed by invalid data
|
|
|
|
$(LZ4) -BX tmp-tlb-hw -c -q | $(LZ4) -tv # test block checksum
|
2020-08-25 21:25:51 +00:00
|
|
|
# $(DATAGEN) -g20KB generates the same file every single time
|
|
|
|
# cannot save output of $(DATAGEN) -g20KB as input file to lz4 because the following shell commands are run before $(DATAGEN) -g20KB
|
|
|
|
test "$(shell $(DATAGEN) -g20KB | $(LZ4) -c --fast | wc -c)" -lt "$(shell $(DATAGEN) -g20KB | $(LZ4) -c --fast=9 | wc -c)" # -1 vs -9
|
|
|
|
test "$(shell $(DATAGEN) -g20KB | $(LZ4) -c -1 | wc -c)" -lt "$(shell $(DATAGEN) -g20KB| $(LZ4) -c --fast=1 | wc -c)" # 1 vs -1
|
|
|
|
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
|
2018-06-27 00:53:12 +00:00
|
|
|
! $(LZ4) -c --fast=0 tmp-tlb-dg20K # lz4 should fail when fast=0
|
|
|
|
! $(LZ4) -c --fast=-1 tmp-tlb-dg20K # lz4 should fail when fast=-1
|
2020-08-10 17:54:35 +00:00
|
|
|
# High --fast values can result in out-of-bound dereferences #876
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g1M | $(LZ4) -c --fast=999999999 > /dev/null
|
2019-01-09 04:51:40 +00:00
|
|
|
# Test for #596
|
|
|
|
@echo "TEST" > tmp-tlb-test
|
2019-04-22 00:01:03 +00:00
|
|
|
$(LZ4) -m tmp-tlb-test
|
2019-01-09 04:51:40 +00:00
|
|
|
$(LZ4) tmp-tlb-test.lz4 tmp-tlb-test2
|
|
|
|
$(DIFF) -q tmp-tlb-test tmp-tlb-test2
|
2017-08-21 22:26:03 +00:00
|
|
|
@$(RM) tmp-tlb*
|
2016-11-09 22:36:42 +00:00
|
|
|
|
2018-06-26 00:46:39 +00:00
|
|
|
|
|
|
|
|
2017-09-22 21:50:11 +00:00
|
|
|
test-lz4-dict: lz4 datagen
|
|
|
|
@echo "\n ---- test lz4 compression/decompression with dictionary ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g16KB > tmp-dict
|
|
|
|
$(DATAGEN) -g32KB > tmp-dict-sample-32k
|
2017-09-22 21:50:11 +00:00
|
|
|
< tmp-dict-sample-32k $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-32k
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g128MB > tmp-dict-sample-128m
|
2017-09-22 21:50:11 +00:00
|
|
|
< tmp-dict-sample-128m $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-128m
|
|
|
|
touch tmp-dict-sample-0
|
|
|
|
< tmp-dict-sample-0 $(LZ4) -D tmp-dict | $(LZ4) -dD tmp-dict | diff - tmp-dict-sample-0
|
|
|
|
|
|
|
|
< tmp-dict-sample-32k $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-sample-32k
|
|
|
|
< tmp-dict-sample-0 $(LZ4) -D tmp-dict-sample-0 | $(LZ4) -dD tmp-dict-sample-0 | diff - tmp-dict-sample-0
|
|
|
|
|
|
|
|
@echo "\n ---- test lz4 dictionary loading ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g128KB > tmp-dict-data-128KB
|
2017-09-22 21:50:11 +00:00
|
|
|
set -e; \
|
|
|
|
for l in 0 1 4 128 32767 32768 32769 65535 65536 65537 98303 98304 98305 131071 131072 131073; do \
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g$$l > tmp-dict-$$l; \
|
2017-09-22 21:50:11 +00:00
|
|
|
$(DD) if=tmp-dict-$$l of=tmp-dict-$$l-tail bs=1 count=65536 skip=$$((l > 65536 ? l - 65536 : 0)); \
|
2019-04-20 00:08:40 +00:00
|
|
|
< tmp-dict-$$l $(LZ4) -D stdin tmp-dict-data-128KB -c | $(LZ4) -dD tmp-dict-$$l-tail | $(DIFF) - tmp-dict-data-128KB; \
|
|
|
|
< tmp-dict-$$l-tail $(LZ4) -D stdin tmp-dict-data-128KB -c | $(LZ4) -dD tmp-dict-$$l | $(DIFF) - tmp-dict-data-128KB; \
|
2017-09-22 21:50:11 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
@$(RM) tmp-dict*
|
|
|
|
|
2016-11-09 22:36:42 +00:00
|
|
|
test-lz4-hugefile: lz4 datagen
|
|
|
|
@echo "\n ---- test huge files compression/decompression ----"
|
2020-08-27 06:20:28 +00:00
|
|
|
./datagen -g6GB | $(LZ4) -vB5D | $(LZ4) -qt
|
2020-08-12 21:39:01 +00:00
|
|
|
./datagen -g4500MB | $(LZ4) -v3BD | $(LZ4) -qt
|
2018-02-26 22:09:46 +00:00
|
|
|
# test large file size [2-4] GB
|
2020-08-25 21:25:51 +00:00
|
|
|
@$(DATAGEN) -g3G -P100 | $(LZ4) -vv | $(LZ4) --decompress --force --sparse - tmphf1
|
2018-02-26 22:09:46 +00:00
|
|
|
@ls -ls tmphf1
|
2020-08-25 21:25:51 +00:00
|
|
|
@$(DATAGEN) -g3G -P100 | $(LZ4) --quiet --content-size | $(LZ4) --verbose --decompress --force --sparse - tmphf2
|
2018-02-26 22:09:46 +00:00
|
|
|
@ls -ls tmphf2
|
|
|
|
$(DIFF) -s tmphf1 tmphf2
|
|
|
|
@$(RM) tmphf*
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-09 22:36:42 +00:00
|
|
|
test-lz4-testmode: lz4 datagen
|
2016-11-09 23:04:55 +00:00
|
|
|
@echo "\n ---- bench mode ----"
|
2020-11-14 06:16:39 +00:00
|
|
|
$(LZ4) -bi0
|
2016-11-09 23:04:55 +00:00
|
|
|
@echo "\n ---- test mode ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
! $(DATAGEN) | $(LZ4) -t
|
|
|
|
! $(DATAGEN) | $(LZ4) -tf
|
2016-11-09 23:04:55 +00:00
|
|
|
@echo "\n ---- pass-through mode ----"
|
2019-01-10 18:20:17 +00:00
|
|
|
@echo "Why hello there " > tmp-tlt2.lz4
|
|
|
|
! $(LZ4) -f tmp-tlt2.lz4 > $(VOID)
|
2020-08-25 21:25:51 +00:00
|
|
|
! $(DATAGEN) | $(LZ4) -dc > $(VOID)
|
|
|
|
! $(DATAGEN) | $(LZ4) -df > $(VOID)
|
|
|
|
$(DATAGEN) | $(LZ4) -dcf > $(VOID)
|
2017-08-21 22:26:03 +00:00
|
|
|
@echo "Hello World !" > tmp-tlt1
|
|
|
|
$(LZ4) -dcf tmp-tlt1
|
|
|
|
@echo "from underground..." > tmp-tlt2
|
|
|
|
$(LZ4) -dcfm tmp-tlt1 tmp-tlt2
|
|
|
|
@echo "\n ---- non-existing source ----"
|
2017-02-14 19:17:06 +00:00
|
|
|
! $(LZ4) file-does-not-exist
|
|
|
|
! $(LZ4) -f file-does-not-exist
|
2019-05-25 18:57:04 +00:00
|
|
|
! $(LZ4) -t file-does-not-exist
|
2017-02-14 19:17:06 +00:00
|
|
|
! $(LZ4) -fm file1-dne file2-dne
|
2019-01-10 18:20:17 +00:00
|
|
|
@$(RM) tmp-tlt tmp-tlt1 tmp-tlt2 tmp-tlt2.lz4
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-12-27 12:14:04 +00:00
|
|
|
test-lz4-opt-parser: lz4 datagen
|
|
|
|
@echo "\n ---- test opt-parser ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g16KB | $(LZ4) -12 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -P10 | $(LZ4) -12B4 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g256K | $(LZ4) -12B4D | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g512K -P25 | $(LZ4) -12BD | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g1M | $(LZ4) -12B5 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g2M -P99 | $(LZ4) -11B4D | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g4M | $(LZ4) -11vq | $(LZ4) -qt
|
|
|
|
$(DATAGEN) -g8M | $(LZ4) -11B4 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g16M -P90 | $(LZ4) -11B5 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g32M -P10 | $(LZ4) -11B5D | $(LZ4) -t
|
2016-12-27 12:14:04 +00:00
|
|
|
|
2020-02-08 01:06:40 +00:00
|
|
|
test-lz4-essentials : lz4 datagen test-lz4-basic test-lz4-multiple test-lz4-multiple-legacy \
|
2018-02-26 22:09:46 +00:00
|
|
|
test-lz4-frame-concatenation test-lz4-testmode \
|
2018-03-21 15:28:51 +00:00
|
|
|
test-lz4-contentSize test-lz4-dict
|
2018-02-26 22:09:46 +00:00
|
|
|
@$(RM) tmp*
|
|
|
|
|
|
|
|
test-lz4: lz4 datagen test-lz4-essentials test-lz4-opt-parser \
|
|
|
|
test-lz4-sparse test-lz4-hugefile test-lz4-dict
|
2017-08-21 22:26:03 +00:00
|
|
|
@$(RM) tmp*
|
2016-11-09 22:36:42 +00:00
|
|
|
|
2016-11-03 14:03:43 +00:00
|
|
|
test-lz4c: lz4c datagen
|
2017-08-25 01:30:00 +00:00
|
|
|
@echo "\n ---- test lz4c variant ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g256MB | $(LZ4)c -l -v | $(LZ4)c -t
|
2016-11-17 21:02:06 +00:00
|
|
|
|
|
|
|
test-lz4c32: CFLAGS+=-m32
|
|
|
|
test-lz4c32: test-lz4
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-interop-32-64: lz4 lz4c32 datagen
|
|
|
|
@echo "\n ---- test interoperability 32-bits -vs- 64 bits ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g16KB | $(LZ4)c32 -9 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -P10 | $(LZ4) -9B4 | $(LZ4)c32 -t
|
|
|
|
$(DATAGEN) | $(LZ4)c32 | $(LZ4) -t
|
|
|
|
$(DATAGEN) -g1M | $(LZ4) -3B5 | $(LZ4)c32 -t
|
|
|
|
$(DATAGEN) -g256MB | $(LZ4)c32 -vqB4D | $(LZ4) -qt
|
|
|
|
$(DATAGEN) -g1G -P90 | $(LZ4) | $(LZ4)c32 -t
|
|
|
|
$(DATAGEN) -g6GB | $(LZ4)c32 -vq9BD | $(LZ4) -qt
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-lz4c32-basic: lz4c32 datagen
|
|
|
|
@echo "\n ---- test lz4c32 32-bits version ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g16KB | $(LZ4)c32 -9 | $(LZ4)c32 -t
|
|
|
|
$(DATAGEN) | $(LZ4)c32 | $(LZ4)c32 -t
|
|
|
|
$(DATAGEN) -g256MB | $(LZ4)c32 -vqB4D | $(LZ4)c32 -qt
|
|
|
|
$(DATAGEN) -g6GB | $(LZ4)c32 -vqB5D | $(LZ4)c32 -qt
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-08 09:43:18 +00:00
|
|
|
test-platform:
|
|
|
|
@echo "\n ---- test lz4 $(QEMU_SYS) platform ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
$(QEMU_SYS) $(DATAGEN) -g16KB | $(QEMU_SYS) $(LZ4) -9 | $(QEMU_SYS) $(LZ4) -t
|
|
|
|
$(QEMU_SYS) $(DATAGEN) | $(QEMU_SYS) $(LZ4) | $(QEMU_SYS) $(LZ4) -t
|
|
|
|
$(QEMU_SYS) $(DATAGEN) -g256MB | $(QEMU_SYS) $(LZ4) -vqB4D | $(QEMU_SYS) $(LZ4) -qt
|
2016-11-08 11:33:01 +00:00
|
|
|
ifneq ($(QEMU_SYS),qemu-arm-static)
|
2020-08-25 21:25:51 +00:00
|
|
|
$(QEMU_SYS) $(DATAGEN) -g3GB | $(QEMU_SYS) $(LZ4) -vqB5D | $(QEMU_SYS) $(LZ4) -qt
|
2016-11-08 11:33:01 +00:00
|
|
|
endif
|
2016-11-08 09:43:18 +00:00
|
|
|
|
2016-11-03 14:03:43 +00:00
|
|
|
test-fullbench: fullbench
|
|
|
|
./fullbench --no-prompt $(NB_LOOPS) $(TEST_FILES)
|
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
test-fullbench32: CFLAGS += -m32
|
|
|
|
test-fullbench32: test-fullbench
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-fuzzer: fuzzer
|
|
|
|
./fuzzer $(FUZZER_TIME)
|
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
test-fuzzer32: CFLAGS += -m32
|
|
|
|
test-fuzzer32: test-fuzzer
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-frametest: frametest
|
2019-07-15 19:11:34 +00:00
|
|
|
./frametest -v $(FUZZER_TIME)
|
2016-11-03 14:03:43 +00:00
|
|
|
|
2016-11-17 21:02:06 +00:00
|
|
|
test-frametest32: CFLAGS += -m32
|
|
|
|
test-frametest32: test-frametest
|
2016-11-03 14:03:43 +00:00
|
|
|
|
|
|
|
test-mem: lz4 datagen fuzzer frametest fullbench
|
|
|
|
@echo "\n ---- valgrind tests : memory analyzer ----"
|
2020-08-25 21:25:51 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(DATAGEN) -g50M > $(VOID)
|
|
|
|
$(DATAGEN) -g16KB > ftmdg16K
|
2017-08-21 22:26:03 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -BD -f ftmdg16K $(VOID)
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g16KB -s2 > ftmdg16K2
|
|
|
|
$(DATAGEN) -g16KB -s3 > ftmdg16K3
|
2017-08-21 22:26:03 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --force --multiple ftmdg16K ftmdg16K2 ftmdg16K3
|
2020-08-25 21:25:51 +00:00
|
|
|
$(DATAGEN) -g7MB > ftmdg7M
|
2018-04-11 23:31:43 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -9 -B5D -f ftmdg7M ftmdg16K2
|
2017-08-21 22:26:03 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -t ftmdg16K2
|
2018-04-11 23:31:43 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -bi1 ftmdg7M
|
|
|
|
valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1 ftmdg7M ftmdg16K2
|
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) -B4D -f -vq ftmdg7M $(VOID)
|
2019-05-16 14:12:00 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --list -m ftm*.lz4
|
|
|
|
valgrind --leak-check=yes --error-exitcode=1 $(LZ4) --list -m -v ftm*.lz4
|
2017-08-21 22:26:03 +00:00
|
|
|
$(RM) ftm*
|
2016-11-03 14:03:43 +00:00
|
|
|
valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i64 -t1
|
|
|
|
valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256
|
|
|
|
|
|
|
|
test-mem32: lz4c32 datagen
|
|
|
|
# unfortunately, valgrind doesn't seem to work with non-native binary...
|
|
|
|
|
2020-08-12 21:42:10 +00:00
|
|
|
test-decompress-partial : decompress-partial
|
|
|
|
@echo "\n ---- test decompress-partial ----"
|
|
|
|
./decompress-partial$(EXT)
|
|
|
|
|
2016-11-03 14:03:43 +00:00
|
|
|
endif
|