From 712a9fd9721c314f4b0238577d803b012845f6d2 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Fri, 29 Jun 2018 15:33:44 -0400 Subject: [PATCH 1/3] Allow Invoking `zstd --list` When `stdin` is not a `tty` Also now returns an error when no inputs are given. New proposed behavior: ``` felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l; echo $? No files given 1 felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Makefile.zst; echo $? Frames Skips Compressed Uncompressed Ratio Check Filename 1 0 3.08 KB 10.92 KB 3.544 XXH64 Makefile.zst 0 felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Date: Fri, 29 Jun 2018 16:31:22 -0400 Subject: [PATCH 2/3] Fix Tests of `--list` Behavior with `stdin` --- tests/playTests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/playTests.sh b/tests/playTests.sh index 09a7377f..aa5535d5 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -731,8 +731,14 @@ $ECHO "\n===> zstd --list/-l error detection tests " ! $ZSTD -lv tmp1* ! $ZSTD --list -v tmp2 tmp12.zst -$ECHO "\n===> zstd --list/-l exits 1 when stdin is piped in" -! echo "piped STDIN" | $ZSTD --list +$ECHO "\n===> zstd --list/-l errors when presented with stdin / no files" +! $ZSTD -l +! $ZSTD -l - +! $ZSTD -l < tmp1.zst +! $ZSTD -l - < tmp1.zst +! $ZSTD -l - tmp1.zst +! $ZSTD -l - tmp1.zst < tmp1.zst +$ZSTD -l tmp1.zst < tmp1.zst # but doesn't error just because stdin is not a tty $ECHO "\n===> zstd --list/-l test with null files " ./datagen -g0 > tmp5 From e22d024e897febf78da7f1a6af0f7e16da17622f Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Fri, 29 Jun 2018 16:31:59 -0400 Subject: [PATCH 3/3] Make One Travis CI Run Run Tests With Non-TTY `stdin` --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b7099c24..80406064 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ addons: matrix: include: # Ubuntu 14.04 - - env: Cmd='make gcc6install && CC=gcc-6 make -j all && make clean && CC=gcc-6 make clean uasan-test-zstd' + - env: Cmd='make gcc6install && CC=gcc-6 make -j all && make clean && CC=gcc-6 make clean uasan-test-zstd