Compress-Stream-Zstd

 view release on metacpan or  search on metacpan

ext/zstd/tests/gzip/help-version.sh  view on Meta::CPAN

    # Skip `test'; it doesn't accept --help or --version.
    test $i = test && continue;

    # false fails even when invoked with --help or --version.
    if test $i = false; then
      env LC_MESSAGES=$lang $i --help >/dev/null && fail=1
      env LC_MESSAGES=$lang $i --version >/dev/null && fail=1
      continue
    fi

    args=

    # The just-built install executable is always named `ginstall'.
    test $i = install && i=ginstall

    # Make sure they exit successfully, under normal conditions.
    eval "env \$i $args --help    > h-\$i   " || fail=1
    eval "env \$i $args --version >/dev/null" || fail=1

    # Make sure they mention the bug-reporting address in --help output.
    grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
    rm -f h-$i

    # Make sure they fail upon `disk full' error.
    if test -w /dev/full && test -c /dev/full; then
      eval "env \$i $args --help    >/dev/full 2>/dev/null" && fail=1
      eval "env \$i $args --version >/dev/full 2>/dev/null" && fail=1
      status=$?
      test $i = [ && prog=lbracket || prog=$i
      eval "expected=\$expected_failure_status_$prog"
      test x$expected = x && expected=1
      if test $status = $expected; then
        : # ok
      else
        fail=1
        echo "*** $i: bad exit status \`$status' (expected $expected)," 1>&2
        echo "  with --help or --version output redirected to /dev/full" 1>&2
      fi
    fi
  done
done

bigZ_in=bigZ-in.Z
zin=zin.gz
zin2=zin2.gz

tmp=tmp-$$
tmp_in=in-$$
tmp_in2=in2-$$
tmp_dir=dir-$$
tmp_out=out-$$
mkdir $tmp || fail=1
cd $tmp || fail=1

comm_setup () { args="$tmp_in $tmp_in"; }
csplit_setup () { args="$tmp_in //"; }
cut_setup () { args='-f 1'; }
join_setup () { args="$tmp_in $tmp_in"; }
tr_setup () { args='a a'; }

chmod_setup () { args="a+x $tmp_in"; }
# Punt on these.
chgrp_setup () { args=--version; }
chown_setup () { args=--version; }
mkfifo_setup () { args=--version; }
mknod_setup () { args=--version; }
# Punt on uptime, since it fails (e.g., failing to get boot time)
# on some systems, and we shouldn't let that stop `make check'.
uptime_setup () { args=--version; }

# Create a file in the current directory, not in $TMPDIR.
mktemp_setup () { args=mktemp.XXXX; }

cmp_setup () { args="$tmp_in $tmp_in2"; }

# Tell dd not to print the line with transfer rate and total.
# The transfer rate would vary between runs.
dd_setup () { args=status=noxfer; }

zdiff_setup () { args="$args $zin $zin2"; }
zcmp_setup () { zdiff_setup; }
zcat_setup () { args="$args $zin"; }
gunzip_setup () { zcat_setup; }
zmore_setup () { zcat_setup; }
zless_setup () { zcat_setup; }
znew_setup () { args="$args $bigZ_in"; }
zforce_setup () { zcat_setup; }
zgrep_setup () { args="$args z $zin"; }
zegrep_setup () { zgrep_setup; }
zfgrep_setup () { zgrep_setup; }
gzexe_setup () { args="$args $tmp_in"; }

# We know that $tmp_in contains a "0"
grep_setup () { args="0 $tmp_in"; }
egrep_setup () { args="0 $tmp_in"; }
fgrep_setup () { args="0 $tmp_in"; }

diff_setup () { args="$tmp_in $tmp_in2"; }
sdiff_setup () { args="$tmp_in $tmp_in2"; }
diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; }
cp_setup () { args="$tmp_in $tmp_in2"; }
ln_setup () { args="$tmp_in ln-target"; }
ginstall_setup () { args="$tmp_in $tmp_in2"; }
mv_setup () { args="$tmp_in $tmp_in2"; }
mkdir_setup () { args=$tmp_dir/subdir; }
rmdir_setup () { args=$tmp_dir; }
rm_setup () { args=$tmp_in; }
shred_setup () { args=$tmp_in; }
touch_setup () { args=$tmp_in2; }
truncate_setup () { args="--reference=$tmp_in $tmp_in2"; }

basename_setup () { args=$tmp_in; }
dirname_setup () { args=$tmp_in; }
expr_setup () { args=foo; }

# Punt, in case GNU `id' hasn't been installed yet.
groups_setup () { args=--version; }

pathchk_setup () { args=$tmp_in; }
yes_setup () { args=--version; }
logname_setup () { args=--version; }



( run in 0.534 second using v1.01-cache-2.11-cpan-39bf76dae61 )