xref: /aosp_15_r20/external/zstd/tests/cli-tests/progress/progress.sh (revision 01826a4963a0d8a59bc3812d29bdf0fb76416722)
1*01826a49SYabin Cui#!/bin/sh
2*01826a49SYabin Cui
3*01826a49SYabin Cui. "$COMMON/platform.sh"
4*01826a49SYabin Cui
5*01826a49SYabin Cuiset -e
6*01826a49SYabin Cui
7*01826a49SYabin Cuiprintln >&2 "Tests cases where progress information should be printed"
8*01826a49SYabin Cui
9*01826a49SYabin Cuiecho hello > hello
10*01826a49SYabin Cuiecho world > world
11*01826a49SYabin Cui
12*01826a49SYabin Cuizstd -q hello world
13*01826a49SYabin Cui
14*01826a49SYabin Cuifor args in \
15*01826a49SYabin Cui	"--progress" \
16*01826a49SYabin Cui	"--fake-stderr-is-console" \
17*01826a49SYabin Cui	"--progress --fake-stderr-is-console -q"; do
18*01826a49SYabin Cui	println >&2 "args = $args"
19*01826a49SYabin Cui	println >&2 "compress file to file"
20*01826a49SYabin Cui	zstd $args -f hello
21*01826a49SYabin Cui	println >&2 "compress pipe to pipe"
22*01826a49SYabin Cui	zstd $args < hello > $INTOVOID
23*01826a49SYabin Cui	println >&2 "compress pipe to file"
24*01826a49SYabin Cui	zstd $args < hello -fo hello.zst
25*01826a49SYabin Cui	println >&2 "compress file to pipe"
26*01826a49SYabin Cui	zstd $args hello -c > $INTOVOID
27*01826a49SYabin Cui	println >&2 "compress 2 files"
28*01826a49SYabin Cui	zstd $args -f hello world
29*01826a49SYabin Cui
30*01826a49SYabin Cui	println >&2 "decompress file to file"
31*01826a49SYabin Cui	zstd $args -d -f hello.zst
32*01826a49SYabin Cui	println >&2 "decompress pipe to pipe"
33*01826a49SYabin Cui	zstd $args -d < hello.zst > $INTOVOID
34*01826a49SYabin Cui	println >&2 "decompress pipe to file"
35*01826a49SYabin Cui	zstd $args -d < hello.zst -fo hello
36*01826a49SYabin Cui	println >&2 "decompress file to pipe"
37*01826a49SYabin Cui	zstd $args -d hello.zst -c > $INTOVOID
38*01826a49SYabin Cui	println >&2 "decompress 2 files"
39*01826a49SYabin Cui	zstd $args -d -f hello.zst world.zst
40*01826a49SYabin Cui	println >&2 ""
41*01826a49SYabin Cuidone
42