7 SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
8 PROG_DIR="$SCRIPT_DIR/../programs"
11 ZSTD_COMPRESS="$PROG_DIR/zstd-compress"
12 ZSTD_DECOMPRESS="$PROG_DIR/zstd-decompress"
13 ZSTD_NOLEGACY="$PROG_DIR/zstd-nolegacy"
14 ZSTD_DICTBUILDER="$PROG_DIR/zstd-dictBuilder"
15 ZSTD_FRUGAL="$PROG_DIR/zstd-frugal"
16 ZSTD_NOMT="$PROG_DIR/zstd-nomt"
28 (nm $1 || echo "symbol_present $@ failed") | grep $2
31 symbol_not_present() {
32 symbol_present $@ && die "Binary '$1' mistakenly contains symbol '$2'" ||:
35 compress_not_present() {
36 symbol_not_present "$1" ZSTD_compress
39 decompress_not_present() {
40 symbol_not_present "$1" ZSTD_decompress
44 symbol_not_present "$1" ZDICT_
45 symbol_not_present "$1" COVER_
48 cliextra_not_present() {
49 symbol_not_present "$1" TRACE_
50 symbol_not_present "$1" BMK_
53 legacy_not_present() {
54 symbol_not_present "$1" ZSTDv0
58 "$1" --help | grep -- "$2"
62 test_help $@ && die "'$1' supports '$2' when it shouldn't" ||:
65 extras_not_present() {
68 cliextra_not_present $@
69 test_no_help $@ "--train"
74 echo "hello" | "$1" | "$ZSTD" -t
78 echo "hello" | "$ZSTD" | "$1" -t
86 extras_not_present "$ZSTD_FRUGAL"
87 extras_not_present "$ZSTD_COMPRESS"
88 extras_not_present "$ZSTD_DECOMPRESS"
90 compress_not_present "$ZSTD_DECOMPRESS"
92 decompress_not_present "$ZSTD_COMPRESS"
93 decompress_not_present "$ZSTD_DICTBUILDER"
95 cliextra_not_present "$ZSTD_DICTBUILDER"
97 legacy_not_present "$ZSTD_DICTBUILDER"
98 legacy_not_present "$ZSTD_NOLEGACY"
100 symbol_not_present "$ZSTD" ZSTDv01
101 symbol_not_present "$ZSTD" ZSTDv02
102 symbol_not_present "$ZSTD" ZSTDv03
103 symbol_not_present "$ZSTD" ZSTDv04
105 test_compress "$ZSTD_COMPRESS"
106 test_decompress "$ZSTD_DECOMPRESS"
108 test_zstd "$ZSTD_FRUGAL"
109 test_zstd "$ZSTD_NOLEGACY"
111 test_help "$ZSTD" '-b#'
112 test_help "$ZSTD" --train
113 test_help "$ZSTD_DICTBUILDER" --train