mirror of
https://github.com/facebook/zstd.git
synced 2025-03-07 01:10:04 +02:00
"make test" is now compatible with Solaris
This commit is contained in:
parent
724bb2ed57
commit
5f5a902453
@ -181,9 +181,9 @@ clean:
|
|||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------
|
||||||
#make valgrindTest is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets
|
#make valgrindTest is validated only for Linux, OSX, BSD, Hurd and Solaris targets
|
||||||
#----------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------
|
||||||
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly))
|
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
||||||
HOST_OS = POSIX
|
HOST_OS = POSIX
|
||||||
|
|
||||||
valgrindTest: VALGRIND = valgrind --leak-check=full --error-exitcode=1
|
valgrindTest: VALGRIND = valgrind --leak-check=full --error-exitcode=1
|
||||||
@ -208,10 +208,16 @@ HOST_OS = MSYS
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
|
#make tests validated only for MSYS, Linux, OSX, BSD, Hurd and Solaris targets
|
||||||
#------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
||||||
|
|
||||||
|
DIFF:=diff
|
||||||
|
ifneq (,$(filter $(shell uname),SunOS))
|
||||||
|
DIFF:=gdiff
|
||||||
|
endif
|
||||||
|
|
||||||
zstd-playTests: datagen
|
zstd-playTests: datagen
|
||||||
file $(ZSTD)
|
file $(ZSTD)
|
||||||
ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST)
|
ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST)
|
||||||
@ -239,7 +245,7 @@ test-gzstd: gzstd
|
|||||||
$(PRGDIR)/zstd -d README.md.gz -o README2.md
|
$(PRGDIR)/zstd -d README.md.gz -o README2.md
|
||||||
$(PRGDIR)/zstd -d README.md.gz test-zstd-speed.py.gz
|
$(PRGDIR)/zstd -d README.md.gz test-zstd-speed.py.gz
|
||||||
$(PRGDIR)/zstd -d zstd_gz.zst gz_zstd.gz
|
$(PRGDIR)/zstd -d zstd_gz.zst gz_zstd.gz
|
||||||
diff -q zstd_gz gz_zstd
|
$(DIFF) -q zstd_gz gz_zstd
|
||||||
echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst
|
echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst
|
||||||
echo Hello World GZIP | gzip -c - >hello.gz
|
echo Hello World GZIP | gzip -c - >hello.gz
|
||||||
echo Hello World TEXT >hello.txt
|
echo Hello World TEXT >hello.txt
|
||||||
|
@ -7,17 +7,17 @@ die() {
|
|||||||
|
|
||||||
roundTripTest() {
|
roundTripTest() {
|
||||||
if [ -n "$3" ]; then
|
if [ -n "$3" ]; then
|
||||||
local c="$3"
|
local_c="$3"
|
||||||
local p="$2"
|
local_p="$2"
|
||||||
else
|
else
|
||||||
local c="$2"
|
local_c="$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f tmp1 tmp2
|
rm -f tmp1 tmp2
|
||||||
$ECHO "roundTripTest: ./datagen $1 $p | $ZSTD -v$c | $ZSTD -d"
|
$ECHO "roundTripTest: ./datagen $1 $local_p | $ZSTD -v$local_c | $ZSTD -d"
|
||||||
./datagen $1 $p | $MD5SUM > tmp1
|
./datagen $1 $local_p | $MD5SUM > tmp1
|
||||||
./datagen $1 $p | $ZSTD --ultra -v$c | $ZSTD -d | $MD5SUM > tmp2
|
./datagen $1 $local_p | $ZSTD --ultra -v$local_c | $ZSTD -d | $MD5SUM > tmp2
|
||||||
diff -q tmp1 tmp2
|
$DIFF -q tmp1 tmp2
|
||||||
}
|
}
|
||||||
|
|
||||||
isWindows=false
|
isWindows=false
|
||||||
@ -37,6 +37,12 @@ case "$UNAME" in
|
|||||||
*) MD5SUM="md5sum" ;;
|
*) MD5SUM="md5sum" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
DIFF="diff"
|
||||||
|
case "$UNAME" in
|
||||||
|
SunOS) DIFF="gdiff" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
$ECHO "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'"
|
$ECHO "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'"
|
||||||
|
|
||||||
[ -n "$ZSTD" ] || die "ZSTD variable must be defined!"
|
[ -n "$ZSTD" ] || die "ZSTD variable must be defined!"
|
||||||
@ -141,7 +147,7 @@ rm ./*.tmp ./*.zstd
|
|||||||
$ECHO "frame concatenation tests completed"
|
$ECHO "frame concatenation tests completed"
|
||||||
|
|
||||||
|
|
||||||
if [ "$isWindows" = false ] ; then
|
if [ "$isWindows" = false ] && [ "$UNAME" != 'SunOS' ] ; then
|
||||||
$ECHO "\n**** flush write error test **** "
|
$ECHO "\n**** flush write error test **** "
|
||||||
|
|
||||||
$ECHO "$ECHO foo | $ZSTD > /dev/full"
|
$ECHO "$ECHO foo | $ZSTD > /dev/full"
|
||||||
@ -155,14 +161,14 @@ $ECHO "\n**** test sparse file support **** "
|
|||||||
|
|
||||||
./datagen -g5M -P100 > tmpSparse
|
./datagen -g5M -P100 > tmpSparse
|
||||||
$ZSTD tmpSparse -c | $ZSTD -dv -o tmpSparseRegen
|
$ZSTD tmpSparse -c | $ZSTD -dv -o tmpSparseRegen
|
||||||
diff -s tmpSparse tmpSparseRegen
|
$DIFF -s tmpSparse tmpSparseRegen
|
||||||
$ZSTD tmpSparse -c | $ZSTD -dv --sparse -c > tmpOutSparse
|
$ZSTD tmpSparse -c | $ZSTD -dv --sparse -c > tmpOutSparse
|
||||||
diff -s tmpSparse tmpOutSparse
|
$DIFF -s tmpSparse tmpOutSparse
|
||||||
$ZSTD tmpSparse -c | $ZSTD -dv --no-sparse -c > tmpOutNoSparse
|
$ZSTD tmpSparse -c | $ZSTD -dv --no-sparse -c > tmpOutNoSparse
|
||||||
diff -s tmpSparse tmpOutNoSparse
|
$DIFF -s tmpSparse tmpOutNoSparse
|
||||||
ls -ls tmpSparse*
|
ls -ls tmpSparse*
|
||||||
./datagen -s1 -g1200007 -P100 | $ZSTD | $ZSTD -dv --sparse -c > tmpSparseOdd # Odd size file (to not finish on an exact nb of blocks)
|
./datagen -s1 -g1200007 -P100 | $ZSTD | $ZSTD -dv --sparse -c > tmpSparseOdd # Odd size file (to not finish on an exact nb of blocks)
|
||||||
./datagen -s1 -g1200007 -P100 | diff -s - tmpSparseOdd
|
./datagen -s1 -g1200007 -P100 | $DIFF -s - tmpSparseOdd
|
||||||
ls -ls tmpSparseOdd
|
ls -ls tmpSparseOdd
|
||||||
$ECHO "\n Sparse Compatibility with Console :"
|
$ECHO "\n Sparse Compatibility with Console :"
|
||||||
$ECHO "Hello World 1 !" | $ZSTD | $ZSTD -d -c
|
$ECHO "Hello World 1 !" | $ZSTD | $ZSTD -d -c
|
||||||
@ -174,7 +180,7 @@ $ZSTD -v -f tmpSparse1M -o tmpSparseCompressed
|
|||||||
$ZSTD -d -v -f tmpSparseCompressed -o tmpSparseRegenerated
|
$ZSTD -d -v -f tmpSparseCompressed -o tmpSparseRegenerated
|
||||||
$ZSTD -d -v -f tmpSparseCompressed -c >> tmpSparseRegenerated
|
$ZSTD -d -v -f tmpSparseCompressed -c >> tmpSparseRegenerated
|
||||||
ls -ls tmpSparse*
|
ls -ls tmpSparse*
|
||||||
diff tmpSparse2M tmpSparseRegenerated
|
$DIFF tmpSparse2M tmpSparseRegenerated
|
||||||
rm tmpSparse*
|
rm tmpSparse*
|
||||||
|
|
||||||
|
|
||||||
@ -207,13 +213,13 @@ TESTFILE=../programs/zstdcli.c
|
|||||||
./datagen > tmpDict
|
./datagen > tmpDict
|
||||||
./datagen -g1M | $MD5SUM > tmp1
|
./datagen -g1M | $MD5SUM > tmp1
|
||||||
./datagen -g1M | $ZSTD -D tmpDict | $ZSTD -D tmpDict -dvq | $MD5SUM > tmp2
|
./datagen -g1M | $ZSTD -D tmpDict | $ZSTD -D tmpDict -dvq | $MD5SUM > tmp2
|
||||||
diff -q tmp1 tmp2
|
$DIFF -q tmp1 tmp2
|
||||||
$ECHO "- Create first dictionary"
|
$ECHO "- Create first dictionary"
|
||||||
$ZSTD --train *.c ../programs/*.c -o tmpDict
|
$ZSTD --train *.c ../programs/*.c -o tmpDict
|
||||||
cp $TESTFILE tmp
|
cp $TESTFILE tmp
|
||||||
$ZSTD -f tmp -D tmpDict
|
$ZSTD -f tmp -D tmpDict
|
||||||
$ZSTD -d tmp.zst -D tmpDict -fo result
|
$ZSTD -d tmp.zst -D tmpDict -fo result
|
||||||
diff $TESTFILE result
|
$DIFF $TESTFILE result
|
||||||
$ECHO "- Create second (different) dictionary"
|
$ECHO "- Create second (different) dictionary"
|
||||||
$ZSTD --train *.c ../programs/*.c ../programs/*.h -o tmpDictC
|
$ZSTD --train *.c ../programs/*.c ../programs/*.h -o tmpDictC
|
||||||
$ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
|
$ZSTD -d tmp.zst -D tmpDictC -fo result && die "wrong dictionary not detected!"
|
||||||
@ -229,7 +235,7 @@ $ZSTD --train *.c ../programs/*.c -o tmpDict2 --maxdict -v 4K && die "wrong orde
|
|||||||
$ECHO "- Compress without dictID"
|
$ECHO "- Compress without dictID"
|
||||||
$ZSTD -f tmp -D tmpDict1 --no-dictID
|
$ZSTD -f tmp -D tmpDict1 --no-dictID
|
||||||
$ZSTD -d tmp.zst -D tmpDict -fo result
|
$ZSTD -d tmp.zst -D tmpDict -fo result
|
||||||
diff $TESTFILE result
|
$DIFF $TESTFILE result
|
||||||
$ECHO "- Compress with wrong argument order (must fail)"
|
$ECHO "- Compress with wrong argument order (must fail)"
|
||||||
$ZSTD tmp -Df tmpDict1 -c > /dev/null && die "-D must be followed by dictionary name "
|
$ZSTD tmp -Df tmpDict1 -c > /dev/null && die "-D must be followed by dictionary name "
|
||||||
$ECHO "- Compress multiple files with dictionary"
|
$ECHO "- Compress multiple files with dictionary"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user