Fix #1428 - zstdgrep returned 1 on match and unmatch

- Use ZCAT for testing zstdgrep in case of non-install yet
- tests: Add file test for zstdgrep
This commit is contained in:
Lzu Tao
2019-01-06 23:22:55 +07:00
parent f8c8796dfe
commit 7b6a8840c5
2 changed files with 16 additions and 16 deletions
+6 -2
View File
@@ -353,8 +353,12 @@ test-gzstd: gzstd
$(RM) *.gz *.zst README2.md gz_zstd zstd_gz hello.txt
test-zstdgrep: gzstd
@echo a | $(PRGDIR)/zstd | $(PRGDIR)/zstdgrep a
@echo a | $(PRGDIR)/zstd | $(PRGDIR)/zstdgrep b && return 1 || return 0
-[ -f /tmp/zstdcat ] || ln -s $(PWD)/$(PRGDIR)/zstd /tmp/zstdcat
echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep a
echo a | $(PRGDIR)/zstd | env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep b && return 1 || return 0
-echo 'hello world' > test.txt && $(PRGDIR)/zstd test.txt
env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep hello test.txt.zst
env ZCAT=/tmp/zstdcat $(PRGDIR)/zstdgrep weird test.txt.zst && return 1 || return 0
test-fullbench: fullbench datagen
$(QEMU_SYS) ./fullbench -i1