xref: /netbsd-src/external/bsd/zstd/dist/tests/gzip/gzip-env.sh (revision 3117ece4fc4a4ca4489ba793710b60b0d26bab6c)
1*3117ece4Schristos#!/bin/sh
2*3117ece4Schristos# Test the obsolescent GZIP environment variable.
3*3117ece4Schristos
4*3117ece4Schristos# Copyright 2015-2016 Free Software Foundation, Inc.
5*3117ece4Schristos
6*3117ece4Schristos# This program is free software: you can redistribute it and/or modify
7*3117ece4Schristos# it under the terms of the GNU General Public License as published by
8*3117ece4Schristos# the Free Software Foundation, either version 3 of the License, or
9*3117ece4Schristos# (at your option) any later version.
10*3117ece4Schristos
11*3117ece4Schristos# This program is distributed in the hope that it will be useful,
12*3117ece4Schristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
13*3117ece4Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*3117ece4Schristos# GNU General Public License for more details.
15*3117ece4Schristos
16*3117ece4Schristos# You should have received a copy of the GNU General Public License
17*3117ece4Schristos# along with this program.  If not, see <https://www.gnu.org/licenses/>.
18*3117ece4Schristos# limit so don't run it by default.
19*3117ece4Schristos
20*3117ece4Schristos. "${srcdir=.}/init.sh"; path_prepend_ .
21*3117ece4Schristos
22*3117ece4Schristos#echo PATH=$PATH
23*3117ece4Schristos#gzip --version
24*3117ece4Schristos
25*3117ece4Schristosecho a >exp || framework_failure_
26*3117ece4Schristosgzip <exp >in || framework_failure_
27*3117ece4Schristos
28*3117ece4Schristosfail=0
29*3117ece4SchristosGZIP=-qv gzip -d <in >out 2>err || fail=1
30*3117ece4Schristoscompare exp out || fail=1
31*3117ece4Schristos
32*3117ece4Schristosfor badopt in -- -c --stdout -d --decompress -f --force -h --help -k --keep \
33*3117ece4Schristos  -l --list -L --license -r --recursive -Sxxx --suffix=xxx '--suffix xxx' \
34*3117ece4Schristos  -t --test -V --version
35*3117ece4Schristosdo
36*3117ece4Schristos  GZIP=$badopt gzip -d <in >out 2>err && fail=1
37*3117ece4Schristosdone
38*3117ece4Schristos
39*3117ece4Schristosfor goodopt in -n --no-name -N --name -q --quiet -v --verbose \
40*3117ece4Schristos  -1 --fast -2 -3 -4 -5 -6 -7 -8 -9 --best
41*3117ece4Schristosdo
42*3117ece4Schristos  GZIP=$goodopt gzip -d <in >out 2>err || fail=1
43*3117ece4Schristos  compare exp out || fail=1
44*3117ece4Schristosdone
45*3117ece4Schristos
46*3117ece4SchristosExit $fail
47