*** empty log message ***
[coreutils.git] / tests / misc / pathchk1
blobecc131f4ae2de4d342fdc08229f98ce87737ef62
1 #!/bin/sh
2 # ensure that pathchk exits nonzero in one particular case where it didn't
4 if test "$VERBOSE" = yes; then
5 set -x
6 pathchk --version
7 fi
9 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
11 pwd=`pwd`
12 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
13 trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
14 trap '(exit $?); exit' 1 2 13 15
16 framework_failure=0
17 mkdir -p $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
19 touch file || framework_failure=1
21 if test $framework_failure = 1; then
22 echo "$0: failure in testing framework" 1>&2
23 (exit 1); exit
26 fail=0
28 # This should exit nonzero. Before 2.0.13, it gave a diagnostic,
29 # but exited successfully.
30 pathchk file/x > /dev/null 2>&1 && fail=1
32 (exit $fail); exit