fix education decoder test
when `zstd` in not installed on local system by allowing `ZSTD` variable to hold a custom location for the binary
This commit is contained in:
@@ -69,7 +69,7 @@ test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL) -Werror
|
|||||||
test:
|
test:
|
||||||
MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
|
MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants
|
||||||
$(MAKE) -C $(TESTDIR) $@
|
$(MAKE) -C $(TESTDIR) $@
|
||||||
$(MAKE) -C doc/educational_decoder test
|
ZSTD=../../programs/zstd $(MAKE) -C doc/educational_decoder test
|
||||||
|
|
||||||
## shortest: same as `make check`
|
## shortest: same as `make check`
|
||||||
.PHONY: shortest
|
.PHONY: shortest
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
|
# ################################################################
|
||||||
|
# Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# 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).
|
||||||
|
# ################################################################
|
||||||
|
|
||||||
|
ZSTD ?= zstd # requires zstd installation on local system
|
||||||
|
DIFF ?= diff
|
||||||
HARNESS_FILES=*.c
|
HARNESS_FILES=*.c
|
||||||
|
|
||||||
MULTITHREAD_LDFLAGS = -pthread
|
MULTITHREAD_LDFLAGS = -pthread
|
||||||
DEBUGFLAGS= -g -DZSTD_DEBUG=1
|
DEBUGFLAGS= -g -DZSTD_DEBUG=1
|
||||||
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
|
CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
|
||||||
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
|
-I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR)
|
||||||
CFLAGS ?= -O3
|
CFLAGS ?= -O2
|
||||||
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
|
||||||
-Wstrict-aliasing=1 -Wswitch-enum \
|
-Wstrict-aliasing=1 -Wswitch-enum \
|
||||||
-Wredundant-decls -Wstrict-prototypes -Wundef \
|
-Wredundant-decls -Wstrict-prototypes -Wundef \
|
||||||
@@ -22,16 +33,22 @@ clean:
|
|||||||
@$(RM) -rf harness.dSYM
|
@$(RM) -rf harness.dSYM
|
||||||
|
|
||||||
test: harness
|
test: harness
|
||||||
@zstd README.md -o tmp.zst
|
#
|
||||||
|
# Testing single-file decompression with educational decoder
|
||||||
|
#
|
||||||
|
@$(ZSTD) README.md -o tmp.zst
|
||||||
@./harness tmp.zst tmp
|
@./harness tmp.zst tmp
|
||||||
@diff -s tmp README.md
|
@$(DIFF) -s tmp README.md
|
||||||
@$(RM) -f tmp*
|
@$(RM) -f tmp*
|
||||||
# present files for training multiple times, to reach minimum threshold
|
#
|
||||||
@zstd --train harness.c zstd_decompress.c zstd_decompress.h README.md \
|
# Testing dictionary decompression with education decoder
|
||||||
|
#
|
||||||
|
# note : files are presented multiple for training, to reach minimum threshold
|
||||||
|
@$(ZSTD) --train harness.c zstd_decompress.c zstd_decompress.h README.md \
|
||||||
harness.c zstd_decompress.c zstd_decompress.h README.md \
|
harness.c zstd_decompress.c zstd_decompress.h README.md \
|
||||||
harness.c zstd_decompress.c zstd_decompress.h README.md
|
harness.c zstd_decompress.c zstd_decompress.h README.md
|
||||||
@zstd -D dictionary README.md -o tmp.zst
|
@$(ZSTD) -D dictionary README.md -o tmp.zst
|
||||||
@./harness tmp.zst tmp dictionary
|
@./harness tmp.zst tmp dictionary
|
||||||
@diff -s tmp README.md
|
@$(DIFF) -s tmp README.md
|
||||||
@$(RM) -f tmp* dictionary
|
@$(RM) -f tmp* dictionary
|
||||||
@make clean
|
@$(MAKE) clean
|
||||||
|
|||||||
Reference in New Issue
Block a user