[cli-tests] Fix zstd symlinks

The zstd symlinks, notably `zstdcat`, weren't working as expected
because only the `tests/cli-tests/bin/zstd` wrapper was symlinked. We
still invoked `zstd` with the name `zstd`. The fix is to create a
directory of zstd symlinks in `tests/cli-tests/bin/symlinks` for each
name that zstd recognizes. And when `tets/cli-tests/bin/zstd` is
invoked, it selects the correct symlink to call.

See the test `zstd-cli/zstdcat.sh` for an example of how it would work.
This commit is contained in:
Nick Terrell
2022-02-07 15:20:42 -08:00
parent b848c167ab
commit 169f8c11ff
6 changed files with 67 additions and 6 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
println "hello" > hello
println "world" > world
zstd hello world
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Test zstdcat symlink in bin/
zstdcat hello.zst
zstdcat hello.zst world
zstdcat hello world.zst
zstdcat hello.zst world.zst
# Test local zstdcat symlink
ln -s $(which zstd) ./zstdcat
./zstdcat hello.zst
@@ -0,0 +1,8 @@
hello
hello
world
hello
world
hello
world
hello