*** empty log message ***
[coreutils.git] / tests / ls / recursive
blob3b4cb72552071156f6eae5bfc78ba7a93678a248
1 #!/bin/sh
2 # 4.1.1 and 4.1.2 had a bug whereby some recursive listings
3 # didn't include a blank line between per-directory groups of files.
5 if test "$VERBOSE" = yes; then
6 set -x
7 ls --version
8 fi
10 . $srcdir/../envvar-check
12 pwd=`pwd`
13 tmp=recursive.$$
14 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
15 trap '(exit $?); exit' 1 2 13 15
17 framework_failure=0
18 mkdir $tmp || framework_failure=1
19 cd $tmp || framework_failure=1
21 mkdir x y a b c a/1 a/2 a/3 || framework_failure=1
22 touch f a/1/I a/1/II || framework_failure=1
24 if test $framework_failure = 1; then
25 echo "$0: failure in testing framework" 1>&2
26 (exit 1); exit
29 fail=0
31 # This first example is from Andreas Schwab's bug report.
32 ls -R1 a b c > out || fail=1
33 cat <<EOF > exp
39 a/1:
43 a/2:
45 a/3:
50 EOF
52 cmp out exp || fail=1
53 test $fail = 1 && diff out exp 2> /dev/null
55 rm -rf out exp
56 ls -R1 x y f > out || fail=1
57 cat <<EOF > exp
63 EOF
65 cmp out exp || fail=1
66 test $fail = 1 && diff out exp 2> /dev/null
68 (exit $fail); exit