2 # Make sure all these programs work properly
3 # when invoked with --help or --version.
5 test "$VERBOSE" = yes && set -x
7 expected_failure_status_date
=2
8 expected_failure_status_printenv
=2
9 expected_failure_status_tty
=3
10 expected_failure_status_sort
=2
12 case "$all_programs" in
14 if test -w /dev
/full
&& test -c /dev
/full
&& echo > /dev
/full
; then
16 ************************************************
17 WARNING
: On this system
, the built-in
echo function of
/bin
/sh
18 does not report failure when writing to a full device.
19 To demonstrate
, run this
command:
21 /bin
/sh
-c 'echo hello > /dev/full; echo status=$?'
23 Notice that the failing
echo leaves its
exit status
set to zero
24 and does not produce a diagnostic.
26 That bug
in /bin
/sh would cause the tests of the nohup and groups
27 scripts to fail
, so those two are being removed from the list of
28 programs checked by this
test.
29 ************************************************
31 all_programs
=`echo $all_programs|sed 's/\<nohup\> *//;s/\<groups\> *//'`
38 for lang
in C fr da
; do
39 for i
in $all_programs; do
41 # false fails even when invoked with --help or --version.
42 if test $i = false
; then
43 env LC_MESSAGES
=$lang .
/$i --help >/dev
/null
&& fail
=1
44 env LC_MESSAGES
=$lang .
/$i --version >/dev
/null
&& fail
=1
48 # The just-built install executable is always named `ginstall'.
49 test $i = install && i
=ginstall
51 # Make sure they exit successfully, under normal conditions.
52 .
/$i --help >/dev
/null || fail
=1
53 .
/$i --version >/dev
/null || fail
=1
55 # Make sure they fail upon `disk full' error.
56 if test -w /dev
/full
&& test -c /dev
/full
; then
57 .
/$i --help >/dev
/full
2>/dev
/null
&& fail
=1
58 .
/$i --version >/dev
/full
2>/dev
/null
&& fail
=1
60 eval "expected=\$expected_failure_status_$i"
61 test x
$expected = x
&& expected
=1
62 if test $status = $expected; then
66 echo "$i with --help and/or --version didn't fail with output" \
67 "redirected to /dev/full" 1>&2
81 comm_args
="$tmp_in $tmp_in"
82 csplit_args
="$tmp_in //"
84 join_args
="$tmp_in $tmp_in"
87 chmod_args
="a+x $tmp_in"
94 cmp_args
="$tmp_in $tmp_in2"
95 diff_args
="$tmp_in $tmp_in2"
96 sdiff_args
="$tmp_in $tmp_in2"
97 diff3_args
="$tmp_in $tmp_in2 $tmp_in2"
98 cp_args
="$tmp_in $tmp_in2"
99 ln_args
="$tmp_in $tmp_in2"
100 ginstall_args
="$tmp_in $tmp_in2"
101 mv_args
="$tmp_in $tmp_in2"
108 basename_args
=$tmp_in
112 # Punt, in case GNU `id' hasn't been installed yet.
113 groups_args
=--version
117 logname_args
=--version
124 # skip chroot, stty, tty, false
126 for i
in $all_programs; do
128 case $i in chroot|stty|tty|false
) continue;; esac
130 rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out
134 # echo ================== $i
135 eval "args=\$${i}_args"
136 if ..
/$i $args < $tmp_in > $tmp_out; then
142 rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir