updated tests

This commit is contained in:
Yann Collet 2016-02-12 02:56:27 +01:00
parent 71eafdd23f
commit c8da2c9f8f
4 changed files with 23 additions and 24 deletions

View File

@ -54,14 +54,14 @@ MANDIR = $(PREFIX)/share/man/man1
ZSTDDIR = ../lib ZSTDDIR = ../lib
ZSTD_FILES := $(ZSTDDIR)/zstd_compress.c $(ZSTDDIR)/zstd_decompress.c $(ZSTDDIR)/fse.c $(ZSTDDIR)/huff0.c ZSTD_FILES := $(ZSTDDIR)/zstd_compress.c $(ZSTDDIR)/zstd_decompress.c $(ZSTDDIR)/fse.c $(ZSTDDIR)/huff0.c
ZSTD_LEGACY:= $(ZSTDDIR)/legacy/zstd_v01.c $(ZSTDDIR)/legacy/zstd_v02.c $(ZSTDDIR)/legacy/zstd_v03.c $(ZSTDDIR)/legacy/zstd_v04.c
ifeq ($(ZSTD_LEGACY_SUPPORT), 0) ifeq ($(ZSTD_LEGACY_SUPPORT), 0)
CPPFLAGS += -DZSTD_LEGACY_SUPPORT=0 CPPFLAGS += -DZSTD_LEGACY_SUPPORT=0
ZSTD_FILES_LEGACY:=
else else
ZSTD_FILES+= $(ZSTD_LEGACY) ZSTD_LEGACY_SUPPORT:=1
CPPFLAGS += -I../lib/legacy -I./legacy -DZSTD_LEGACY_SUPPORT=1 CPPFLAGS += -I../lib/legacy -I./legacy
ZSTD_FILEIO_LEGACY = legacy/fileio_legacy.c ZSTD_FILES_LEGACY:= $(ZSTDDIR)/legacy/zstd_v01.c $(ZSTDDIR)/legacy/zstd_v02.c $(ZSTDDIR)/legacy/zstd_v03.c $(ZSTDDIR)/legacy/zstd_v04.c legacy/fileio_legacy.c
endif endif
@ -84,13 +84,13 @@ default: zstd
all: zstd zstd32 fullbench fullbench32 fuzzer fuzzer32 zbufftest zbufftest32 paramgrill datagen all: zstd zstd32 fullbench fullbench32 fuzzer fuzzer32 zbufftest zbufftest32 paramgrill datagen
zstd : $(ZSTD_FILES) $(ZSTDDIR)/zstd_buffered.c $(ZSTDDIR)/dictBuilder.c $(ZSTDDIR)/divsufsort.c \ zstd : $(ZSTD_FILES) $(ZSTD_FILES_LEGACY) $(ZSTDDIR)/zstd_buffered.c $(ZSTDDIR)/dictBuilder.c $(ZSTDDIR)/divsufsort.c \
zstdcli.c fileio.c $(ZSTD_FILEIO_LEGACY) bench.c xxhash.c datagen.c dibio.c zstdcli.c fileio.c bench.c xxhash.c datagen.c dibio.c
$(CC) $(FLAGS) $^ -o $@$(EXT) $(CC) $(FLAGS) -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) $^ -o $@$(EXT)
zstd32: $(ZSTD_FILES) $(ZSTDDIR)/zstd_buffered.c $(ZSTDDIR)/dictBuilder.c $(ZSTDDIR)/divsufsort.c \ zstd32: $(ZSTD_FILES) $(ZSTD_FILES_LEGACY) $(ZSTDDIR)/zstd_buffered.c $(ZSTDDIR)/dictBuilder.c $(ZSTDDIR)/divsufsort.c \
zstdcli.c fileio.c $(ZSTD_FILEIO_LEGACY) bench.c xxhash.c datagen.c dibio.c zstdcli.c fileio.c bench.c xxhash.c datagen.c dibio.c
$(CC) -m32 $(FLAGS) $^ -o $@$(EXT) $(CC) -m32 $(FLAGS) -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) $^ -o $@$(EXT)
zstd_nolegacy : zstd_nolegacy :
$(MAKE) zstd ZSTD_LEGACY_SUPPORT=0 $(MAKE) zstd ZSTD_LEGACY_SUPPORT=0
@ -101,12 +101,11 @@ zstd-pgo : clean zstd
rm zstd rm zstd
$(MAKE) zstd MOREFLAGS=-fprofile-use $(MAKE) zstd MOREFLAGS=-fprofile-use
zstd-frugal: $(ZSTD_FILES) $(ZSTDDIR)/zstd_buffered.c \ zstd-frugal: $(ZSTD_FILES) $(ZSTDDIR)/zstd_buffered.c zstdcli.c fileio.c
zstdcli.c fileio.c $(ZSTD_FILEIO_LEGACY) $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_LEGACY_SUPPORT=0 $^ -o zstd$(EXT)
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT $^ -o zstd$(EXT)
zstd-small: clean zstd-small: clean
CFLAGS=-Os $(MAKE) zstd-frugal ZSTD_LEGACY_SUPPORT=0 CFLAGS=-Os $(MAKE) zstd-frugal
fullbench : $(ZSTD_FILES) \ fullbench : $(ZSTD_FILES) \
datagen.c fullbench.c datagen.c fullbench.c

View File

@ -33,8 +33,8 @@ extern "C" {
* Special i/o constants * Special i/o constants
**************************************/ **************************************/
#define nullString "null" #define nullString "null"
#define stdinmark "-" #define stdinmark "stdin"
#define stdoutmark "-" #define stdoutmark "stdout"
#ifdef _WIN32 #ifdef _WIN32
# define nulmark "nul" # define nulmark "nul"
#else #else

View File

@ -27,10 +27,10 @@ printf "\n**** frame concatenation **** "
echo "hello " > hello.tmp echo "hello " > hello.tmp
echo "world!" > world.tmp echo "world!" > world.tmp
cat hello.tmp world.tmp > helloworld.tmp cat hello.tmp world.tmp > helloworld.tmp
$ZSTD hello.tmp > hello.zstd $ZSTD -c hello.tmp > hello.zstd
$ZSTD world.tmp > world.zstd $ZSTD -c world.tmp > world.zstd
cat hello.zstd world.zstd > helloworld.zstd cat hello.zstd world.zstd > helloworld.zstd
$ZSTD -df helloworld.zstd > result.tmp $ZSTD -dc helloworld.zstd > result.tmp
cat result.tmp cat result.tmp
sdiff helloworld.tmp result.tmp sdiff helloworld.tmp result.tmp
rm ./*.tmp ./*.zstd rm ./*.tmp ./*.zstd
@ -57,12 +57,12 @@ echo "*** multiple files tests *** "
./datagen -s1 > tmp1 2> /dev/null ./datagen -s1 > tmp1 2> /dev/null
./datagen -s2 -g100K > tmp2 2> /dev/null ./datagen -s2 -g100K > tmp2 2> /dev/null
./datagen -s3 -g1M > tmp3 2> /dev/null ./datagen -s3 -g1M > tmp3 2> /dev/null
$ZSTD -f -m tmp* $ZSTD -f tmp*
ls -ls tmp* ls -ls tmp*
rm tmp1 tmp2 tmp3 rm tmp1 tmp2 tmp3
$ZSTD -df -m *.zst $ZSTD -df *.zst
ls -ls tmp* ls -ls tmp*
$ZSTD -f -m tmp1 notHere tmp2 && die "missing file not detected!" $ZSTD -f tmp1 notHere tmp2 && die "missing file not detected!"
rm tmp* rm tmp*
echo "**** zstd round-trip tests **** " echo "**** zstd round-trip tests **** "

View File

@ -372,8 +372,8 @@ int main(int argCount, const char** argv)
goto _end; goto _end;
} }
/* No input filename ==> use stdin */ /* No input filename ==> use stdin and stdout */
if(!filenameIdx) filenameIdx=1, filenameTable[0]=stdinmark; if(!filenameIdx) filenameIdx=1, filenameTable[0]=stdinmark, outFileName=stdoutmark;
/* Check if input/output defined as console; trigger an error in this case */ /* Check if input/output defined as console; trigger an error in this case */
if (!strcmp(filenameTable[0], stdinmark) && IS_CONSOLE(stdin) ) return badusage(programName); if (!strcmp(filenameTable[0], stdinmark) && IS_CONSOLE(stdin) ) return badusage(programName);