tests: include help-version test settings used by gzip and grep
authorJim Meyering <meyering@redhat.com>
Sun, 7 Feb 2010 11:16:34 +0000 (12:16 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 7 Feb 2010 16:18:02 +0000 (17:18 +0100)
* tests/misc/help-version: ...the better to keep this file in sync.

tests/misc/help-version

index 6202dee7a688bee7207bb94eab96fc88646c442e..063c3ebf81e382836c0ee463ef4a3bb3d3d90772 100755 (executable)
@@ -43,6 +43,19 @@ expected_failure_status_dir=2
 expected_failure_status_ls=2
 expected_failure_status_vdir=2
 
+expected_failure_status_cmp=2
+expected_failure_status_zcmp=2
+expected_failure_status_sdiff=2
+expected_failure_status_diff3=2
+expected_failure_status_diff=2
+expected_failure_status_zdiff=2
+expected_failure_status_zgrep=2
+expected_failure_status_zegrep=2
+expected_failure_status_zfgrep=2
+
+expected_failure_status_grep=2
+expected_failure_status_egrep=2
+expected_failure_status_fgrep=2
 
 test "$built_programs" \
   || { echo "$this_test: no programs built!?!" 1>&2; Exit 1; }
@@ -90,6 +103,10 @@ for lang in C fr da; do
   done
 done
 
+bigZ_in=bigZ-in.Z
+zin=zin.gz
+zin2=zin2.gz
+
 tmp=tmp-$$
 tmp_in=in-$$
 tmp_in2=in2-$$
@@ -123,6 +140,24 @@ cmp_args="$tmp_in $tmp_in2"
 # The transfer rate would vary between runs.
 dd_args=status=noxfer
 
+zdiff_args="$zin $zin2"
+zcmp_args="$zin $zin2"
+zcat_args=$zin
+gunzip_args=$zin
+zmore_args=$zin
+zless_args=$zin
+znew_args=$bigZ_in
+zforce_args=$zin
+zgrep_args="z $zin"
+zegrep_args="z $zin"
+zfgrep_args="z $zin"
+gzexe_args=$tmp_in
+
+# We know that $tmp_in contains a "0"
+grep_args="0 $tmp_in"
+egrep_args="0 $tmp_in"
+fgrep_args="0 $tmp_in"
+
 diff_args="$tmp_in $tmp_in2"
 sdiff_args="$tmp_in $tmp_in2"
 diff3_args="$tmp_in $tmp_in2 $tmp_in2"
@@ -188,9 +223,17 @@ for i in $built_programs; do
   # Skip these.
   case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
 
-  rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out
-  echo > $tmp_in
-  echo > $tmp_in2
+  rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2
+  echo z |gzip > $zin
+  cp $zin $zin2
+  cp $zin $bigZ_in
+
+  # This is sort of kludgey: use numbers so this is valid input for factor,
+  # and two tokens so it's valid input for tsort.
+  echo 2147483647 0 > $tmp_in
+  # Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments
+  # to the likes of cmp and diff makes them exit successfully.
+  cp $tmp_in $tmp_in2
   mkdir $tmp_dir
   # echo ================== $i
   test $i = [ && prog=lbracket || prog=$i