]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed playTests.sh for minGW
authorYann Collet <cyan@fb.com>
Wed, 26 Dec 2018 23:19:09 +0000 (15:19 -0800)
committerYann Collet <cyan@fb.com>
Wed, 26 Dec 2018 23:19:09 +0000 (15:19 -0800)
On Windows, the equivalent of `/dev/null` is `NUL`.
When tests are run under msys2/minGW,
the environment identifies itself as Windows,
hence the script uses `NUL` instead of `/dev/null`
but the environment will consider `NUL` to be a regular file name.
Consequently, `NUL` will be overwritten during tests,
triggering an error.

This patch uses flag `-f` to force such overwrite
passing the test.

programs/windres/zstd32.res
programs/windres/zstd64.res
tests/playTests.sh

index 2c2b9b01e53c7bbb4fa4e845fb51edd30b84475e..843499254924c1c45ed155677538d8856721f527 100644 (file)
Binary files a/programs/windres/zstd32.res and b/programs/windres/zstd32.res differ
index 4a37157eabe4a269b57bbc774f867eb3eecfea10..da859810fc875c7d863e61428d988e0ce0a29ab5 100644 (file)
Binary files a/programs/windres/zstd64.res and b/programs/windres/zstd64.res differ
index 051833b43f059f462f8a51e427f7778d43eb91cf..ef4861b52917e7df58b143e1785af7cc3a3571f2 100755 (executable)
@@ -125,7 +125,7 @@ $ZSTD --fast=9999999999 -f tmp  && die "should have refused numeric value"
 $ECHO "test : set compression level with environment variable ZSTD_CLEVEL"
 ZSTD_CLEVEL=12  $ZSTD -f tmp # positive compression level
 ZSTD_CLEVEL=-12 $ZSTD -f tmp # negative compression level
-ZSTD_CLEVEL=+12 $ZSTD -f tmp # valid: verbose '+' sign 
+ZSTD_CLEVEL=+12 $ZSTD -f tmp # valid: verbose '+' sign
 ZSTD_CLEVEL=    $ZSTD -f tmp # empty env var, warn and revert to default setting
 ZSTD_CLEVEL=-   $ZSTD -f tmp # malformed env var, warn and revert to default setting
 ZSTD_CLEVEL=a   $ZSTD -f tmp # malformed env var, warn and revert to default setting
@@ -133,7 +133,7 @@ ZSTD_CLEVEL=+a  $ZSTD -f tmp # malformed env var, warn and revert to default set
 ZSTD_CLEVEL=3a7 $ZSTD -f tmp # malformed env var, warn and revert to default setting
 ZSTD_CLEVEL=50000000000  $ZSTD -f tmp # numeric value too large, warn and revert to default setting
 $ECHO "test : override ZSTD_CLEVEL with command line option"
-ZSTD_CLEVEL=12  $ZSTD --fast=3 -f tmp # overridden by command line option 
+ZSTD_CLEVEL=12  $ZSTD --fast=3 -f tmp # overridden by command line option
 $ECHO "test : compress to stdout"
 $ZSTD tmp -c > tmpCompressed
 $ZSTD tmp --stdout > tmpCompressed       # long command format
@@ -192,8 +192,8 @@ chmod 400 tmpro.zst
 $ZSTD -q tmpro && die "should have refused to overwrite read-only file"
 $ZSTD -q -f tmpro
 $ECHO "test: --no-progress flag"
-$ZSTD tmpro -c --no-progress | $ZSTD -d -o "$INTOVOID" --no-progress
-$ZSTD tmpro -cv --no-progress | $ZSTD -dv -o "$INTOVOID" --no-progress
+$ZSTD tmpro -c --no-progress | $ZSTD -d -f -o "$INTOVOID" --no-progress
+$ZSTD tmpro -cv --no-progress | $ZSTD -dv -f -o "$INTOVOID" --no-progress
 rm -f tmpro tmpro.zst
 $ECHO "test: overwrite input file (must fail)"
 $ZSTD tmp -fo tmp && die "zstd compression overwrote the input file"
@@ -232,7 +232,7 @@ rm tmp*
 $ECHO "test : compress multiple files"
 $ECHO hello > tmp1
 $ECHO world > tmp2
-$ZSTD tmp1 tmp2 -o "$INTOVOID"
+$ZSTD tmp1 tmp2 -o "$INTOVOID" -f
 $ZSTD tmp1 tmp2 -c | $ZSTD -t
 $ZSTD tmp1 tmp2 -o tmp.zst
 test ! -f tmp1.zst
@@ -240,7 +240,7 @@ test ! -f tmp2.zst
 $ZSTD tmp1 tmp2
 $ZSTD -t tmp1.zst tmp2.zst
 $ZSTD -dc tmp1.zst tmp2.zst
-$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID"
+$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID" -f
 $ZSTD -d tmp1.zst tmp2.zst -o tmp
 touch tmpexists
 $ZSTD tmp1 tmp2 -f -o tmpexists