summaryrefslogtreecommitdiff
path: root/tests/ls
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-04-17 23:34:45 +0200
committerJim Meyering <meyering@redhat.com>2008-04-21 00:01:51 +0200
commit512e111a926fedbd7dc7b0875ab837dbb7d2a7a6 (patch)
treef77cdb2c6bfc71f0560cf073324365c0a3e65526 /tests/ls
parentd25bf9dceb90dcb91f8af57aff433273c7145ff7 (diff)
downloadcoreutils-512e111a926fedbd7dc7b0875ab837dbb7d2a7a6.tar.xz
Revamp test-related Makefiles.
One side-effect of this change is that "make check" now works even if you put "." early in your shell's search PATH (don't do that!). Remove all test-related Makefile.am files, except those generated by mk-script. Instead, tests/Makefile.am now lists not only the tests directly under tests/, but also those in tests/*/ that are not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. A lot of these changes are like this: -. $srcdir/../lang-default +. $top_srcdir/tests/lang-default -. $srcdir/../test-lib.sh +. $top_srcdir/tests/test-lib.sh * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. * tests/rwx-to-mode: Remove file. Rewritten as... * tests/test-lib.sh (rwx_to_mode_): ...this new function. * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. (SUBDIRS): Remove each dir with a removed Makefile.am. (EXTRA_DIST): Add $(TESTS). (TESTS): Add over 300 entries.
Diffstat (limited to 'tests/ls')
-rw-r--r--tests/ls/Makefile.am31
-rwxr-xr-xtests/ls/color-dtype-dir2
-rwxr-xr-xtests/ls/dangle4
-rwxr-xr-xtests/ls/dired4
-rwxr-xr-xtests/ls/file-type6
-rwxr-xr-xtests/ls/follow-slink4
-rwxr-xr-xtests/ls/infloop6
-rwxr-xr-xtests/ls/inode4
-rwxr-xr-xtests/ls/m-option4
-rwxr-xr-xtests/ls/nameless-uid8
-rwxr-xr-xtests/ls/no-arg4
-rwxr-xr-xtests/ls/proc-selinux-segfault4
-rwxr-xr-xtests/ls/recursive4
-rwxr-xr-xtests/ls/rt-16
-rwxr-xr-xtests/ls/stat-dtype4
-rwxr-xr-xtests/ls/stat-failed6
-rwxr-xr-xtests/ls/stat-free-symlinks2
-rwxr-xr-xtests/ls/stat-vs-dirent4
-rwxr-xr-xtests/ls/symlink-slash4
-rwxr-xr-xtests/ls/x-option6
20 files changed, 43 insertions, 74 deletions
diff --git a/tests/ls/Makefile.am b/tests/ls/Makefile.am
deleted file mode 100644
index c9739c992..000000000
--- a/tests/ls/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-# Make coreutils tests for "ls". -*-Makefile-*-
-
-# Copyright (C) 1997-2003, 2006-2008 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-TESTS = \
- proc-selinux-segfault \
- stat-free-symlinks \
- nameless-uid \
- color-dtype-dir \
- stat-failed \
- stat-dtype \
- inode dangle file-type recursive dired infloop \
- rt-1 symlink-slash follow-slink no-arg m-option \
- stat-vs-dirent x-option
-
-EXTRA_DIST = $(TESTS)
-
-include $(top_srcdir)/tests/check.mk
diff --git a/tests/ls/color-dtype-dir b/tests/ls/color-dtype-dir
index b96970162..8a431c466 100755
--- a/tests/ls/color-dtype-dir
+++ b/tests/ls/color-dtype-dir
@@ -24,7 +24,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
# Don't let a different umask perturb the results.
umask 22
diff --git a/tests/ls/dangle b/tests/ls/dangle
index bd3633fab..7266fac89 100755
--- a/tests/ls/dangle
+++ b/tests/ls/dangle
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure ls properly handles dangling symlinks vs. ls's -L, -H, options.
-# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
ln -s no-such-file dangle || framework_failure
mkdir -p dir/sub || framework_failure
diff --git a/tests/ls/dired b/tests/ls/dired
index 45cbdfcc7..6a1bbd28a 100755
--- a/tests/ls/dired
+++ b/tests/ls/dired
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure --dired option works
-# Copyright (C) 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
mkdir dir || framework_failure
diff --git a/tests/ls/file-type b/tests/ls/file-type
index 533bec89c..87f63c96f 100755
--- a/tests/ls/file-type
+++ b/tests/ls/file-type
@@ -1,7 +1,7 @@
#!/bin/sh
# contrast ls -F, ls -p, and ls --indicator-style=file-type
-# Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
mkdir sub
cd sub
diff --git a/tests/ls/follow-slink b/tests/ls/follow-slink
index a7efadb17..a4374bf96 100755
--- a/tests/ls/follow-slink
+++ b/tests/ls/follow-slink
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure ls -L always follows symlinks
-# Copyright (C) 2000, 2002, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
# Isolate output files from directory being listed
mkdir dir dir/sub dir1 || framework_failure
diff --git a/tests/ls/infloop b/tests/ls/infloop
index cc93372c7..d96efa070 100755
--- a/tests/ls/infloop
+++ b/tests/ls/infloop
@@ -2,7 +2,7 @@
# show that the following no longer makes ls infloop
# mkdir loop; cd loop; ln -s ../loop sub; ls -RL
-# Copyright (C) 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
mkdir loop || framework_failure
ln -s ../loop loop/sub || framework_failure
diff --git a/tests/ls/inode b/tests/ls/inode
index 08ee5e1f7..636c064a3 100755
--- a/tests/ls/inode
+++ b/tests/ls/inode
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure that ls -i works properly on symlinks.
-# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
touch f || framework_failure
ln -s f slink || framework_failure
diff --git a/tests/ls/m-option b/tests/ls/m-option
index db6e53393..975042280 100755
--- a/tests/ls/m-option
+++ b/tests/ls/m-option
@@ -1,7 +1,7 @@
#!/bin/sh
# exercise the -m option
-# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
seq 2000 > b || framework_failure
touch a || framework_failure
diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid
index a2d3b9442..37becec26 100755
--- a/tests/ls/nameless-uid
+++ b/tests/ls/nameless-uid
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that ls -l works on files with nameless uid and/or gid
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,10 +22,10 @@ if test "$VERBOSE" = yes; then
fi
: ${srcdir=.}
-. $srcdir/../require-perl
+. $top_srcdir/tests/require-perl
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
require_root_
nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'`
diff --git a/tests/ls/no-arg b/tests/ls/no-arg
index 00b4d92b8..ea0730e45 100755
--- a/tests/ls/no-arg
+++ b/tests/ls/no-arg
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure ls and `ls -R' do the right thing when invoked with no arguments.
-# Copyright (C) 2001, 2003, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
mkdir -p dir/subdir || framework_failure
touch dir/subdir/file2 || framework_failure
diff --git a/tests/ls/proc-selinux-segfault b/tests/ls/proc-selinux-segfault
index 320ba6f24..60cfe5509 100755
--- a/tests/ls/proc-selinux-segfault
+++ b/tests/ls/proc-selinux-segfault
@@ -21,8 +21,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../envvar-check
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/envvar-check
+. $top_srcdir/tests/test-lib.sh
f=/proc/sys
test -r $f || f=.
diff --git a/tests/ls/recursive b/tests/ls/recursive
index 8aff3ed7e..d8b159c2e 100755
--- a/tests/ls/recursive
+++ b/tests/ls/recursive
@@ -2,7 +2,7 @@
# 4.1.1 and 4.1.2 had a bug whereby some recursive listings
# didn't include a blank line between per-directory groups of files.
-# Copyright (C) 2001, 2002, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
mkdir x y a b c a/1 a/2 a/3 || framework_failure
touch f a/1/I a/1/II || framework_failure
diff --git a/tests/ls/rt-1 b/tests/ls/rt-1
index dce7c852d..3e3c36a0f 100755
--- a/tests/ls/rt-1
+++ b/tests/ls/rt-1
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure name is used as secondary key when sorting on mtime or ctime.
-# Copyright (C) 1998, 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001-2002, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. $srcdir/../lang-default
+. $top_srcdir/tests/lang-default
if test "$VERBOSE" = yes; then
set -x
@@ -24,7 +24,7 @@ if test "$VERBOSE" = yes; then
touch --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
date=1998-01-15
diff --git a/tests/ls/stat-dtype b/tests/ls/stat-dtype
index 5e1776e71..a6d528983 100755
--- a/tests/ls/stat-dtype
+++ b/tests/ls/stat-dtype
@@ -3,7 +3,7 @@
# Also check for the dtype-related (and fs-type dependent) bug
# in coreutils-6.0 that made ls -CF columns misaligned.
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
# Skip this test unless "." is on a file system with useful d_type info.
# FIXME: This uses "ls -p" to decide whether to test "ls" with other options,
diff --git a/tests/ls/stat-failed b/tests/ls/stat-failed
index 2d6e98821..977de393e 100755
--- a/tests/ls/stat-failed
+++ b/tests/ls/stat-failed
@@ -2,7 +2,7 @@
# Verify that ls works properly when it fails to stat a file that is
# not mentioned on the command line.
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
skip_if_root_
mkdir d || framework_failure
diff --git a/tests/ls/stat-free-symlinks b/tests/ls/stat-free-symlinks
index 85f363f0c..4dc01b5ed 100755
--- a/tests/ls/stat-free-symlinks
+++ b/tests/ls/stat-free-symlinks
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
require_strace_ stat
touch x || framework_failure
diff --git a/tests/ls/stat-vs-dirent b/tests/ls/stat-vs-dirent
index c326bc9fa..f69ffba2d 100755
--- a/tests/ls/stat-vs-dirent
+++ b/tests/ls/stat-vs-dirent
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that d_ino (from ls -di) and st_ino (from stat --format=%i) match.
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh
fail=0
diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash
index 3d89bd42b..641826e13 100755
--- a/tests/ls/symlink-slash
+++ b/tests/ls/symlink-slash
@@ -21,8 +21,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
mkdir dir || framework_failure
ln -s dir symlink || framework_failure
diff --git a/tests/ls/x-option b/tests/ls/x-option
index 4fb27047c..2153536b3 100755
--- a/tests/ls/x-option
+++ b/tests/ls/x-option
@@ -1,7 +1,7 @@
#!/bin/sh
# Exercise the -x option.
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@ if test "$VERBOSE" = yes; then
ls --version
fi
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
mkdir subdir || framework_failure
touch subdir/b || framework_failure