From: Bimba Shrestha Date: Wed, 23 Oct 2019 00:09:44 +0000 (-0700) Subject: Adding shell test and removing bash test file X-Git-Tag: v1.4.4~1^2~14^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1839%2Fhead;p=thirdparty%2Fzstd.git Adding shell test and removing bash test file --- diff --git a/tests/Makefile b/tests/Makefile index 123bd6312..bd2f90976 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -335,9 +335,7 @@ test-zstd-nolegacy: zstd-nolegacy test-zstd test-zstd32 test-zstd-nolegacy: datagen file $(ZSTD) - ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests_bash.sh $($(ZSTDRTTEST) - ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $($(ZSTDRTTEST) - + ZSTD="$(QEMU_SYS) $(ZSTD)" ./playTests.sh $(ZSTDRTTEST) test-gzstd: gzstd diff --git a/tests/playTests.sh b/tests/playTests.sh index 5a47ceb5e..29ac1faa5 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -1080,4 +1080,14 @@ test -f dictionary rm -f tmp* dictionary +println "\n===> zstd fifo named pipe test " +head -c 10 /dev/zero > tmp_original +mkfifo named_pipe +head -c 10 /dev/zero > named_pipe & +$ZSTD named_pipe -o tmp_compressed +$ZSTD -d -o tmp_decompressed tmp_compressed +$DIFF -s tmp_original tmp_decompressed +rm -rf tmp* +rm -rf named_pipe + rm -f tmp* diff --git a/tests/playTests_bash.sh b/tests/playTests_bash.sh deleted file mode 100755 index 68bd17e9d..000000000 --- a/tests/playTests_bash.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -println() { - printf '%b\n' "${*}" -} - -UNAME=$(uname) - -isWindows=false -INTOVOID="/dev/null" -case "$UNAME" in - GNU) DEVDEVICE="/dev/random" ;; - *) DEVDEVICE="/dev/zero" ;; -esac -case "$OS" in - Windows*) - isWindows=true - INTOVOID="NUL" - DEVDEVICE="NUL" - ;; -esac - -case "$UNAME" in - Darwin) MD5SUM="md5 -r" ;; - FreeBSD) MD5SUM="gmd5sum" ;; - OpenBSD) MD5SUM="md5" ;; - *) MD5SUM="md5sum" ;; -esac - -DIFF="diff" -case "$UNAME" in - SunOS) DIFF="gdiff" ;; -esac - -println "\nStarting playTests_bash.sh isWindows=$isWindows ZSTD='$ZSTD'" - -[ -n "$ZSTD" ] || die "ZSTD variable must be defined!" - -println "\n===> simple tests " - -println "\n===> zstd fifo named pipe test " -head -c 1M /dev/zero > tmp_original -$ZSTD <(head -c 1M /dev/zero) -o tmp_compressed -$ZSTD -d -o tmp_decompressed tmp_compressed -$DIFF -s tmp_original tmp_decompressed -rm -rf tmp*