diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2007-03-22 21:23:21 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2007-03-22 21:23:21 +0000 |
commit | cbf5993c43f49281173f185863577d86bfac6eae (patch) | |
tree | 90737c96cf15b97273a2bdc5950b3cf09f1d94ca /tests/ls | |
download | coreutils-tarball-cbf5993c43f49281173f185863577d86bfac6eae.tar.gz |
coreutils-6.9coreutils-6.9
Diffstat (limited to 'tests/ls')
-rw-r--r-- | tests/ls/Makefile.am | 36 | ||||
-rw-r--r-- | tests/ls/Makefile.in | 747 | ||||
-rwxr-xr-x | tests/ls/color-dtype-dir | 67 | ||||
-rwxr-xr-x | tests/ls/dangle | 67 | ||||
-rwxr-xr-x | tests/ls/dired | 56 | ||||
-rwxr-xr-x | tests/ls/file-type | 90 | ||||
-rwxr-xr-x | tests/ls/follow-slink | 86 | ||||
-rwxr-xr-x | tests/ls/infloop | 61 | ||||
-rwxr-xr-x | tests/ls/inode | 83 | ||||
-rwxr-xr-x | tests/ls/m-option | 61 | ||||
-rwxr-xr-x | tests/ls/nameless-uid | 65 | ||||
-rwxr-xr-x | tests/ls/no-arg | 76 | ||||
-rwxr-xr-x | tests/ls/recursive | 85 | ||||
-rwxr-xr-x | tests/ls/rt-1 | 71 | ||||
-rwxr-xr-x | tests/ls/stat-dtype | 86 | ||||
-rwxr-xr-x | tests/ls/stat-failed | 75 | ||||
-rwxr-xr-x | tests/ls/stat-vs-dirent | 83 | ||||
-rwxr-xr-x | tests/ls/symlink-slash | 52 | ||||
-rwxr-xr-x | tests/ls/time-1 | 145 |
19 files changed, 2092 insertions, 0 deletions
diff --git a/tests/ls/Makefile.am b/tests/ls/Makefile.am new file mode 100644 index 0000000..461ba07 --- /dev/null +++ b/tests/ls/Makefile.am @@ -0,0 +1,36 @@ +# Make coreutils tests for "ls". -*-Makefile-*- + +# Copyright (C) 1997-2003, 2006-2007 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +TESTS = \ + nameless-uid \ + color-dtype-dir \ + stat-failed \ + stat-dtype \ + inode dangle file-type recursive dired infloop \ + rt-1 time-1 symlink-slash follow-slink no-arg m-option \ + stat-vs-dirent + +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = \ + top_srcdir=$(top_srcdir) \ + srcdir=$(srcdir) \ + CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \ + PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ + PERL="$(PERL)" \ + PROG=ls diff --git a/tests/ls/Makefile.in b/tests/ls/Makefile.in new file mode 100644 index 0000000..a77a08a --- /dev/null +++ b/tests/ls/Makefile.in @@ -0,0 +1,747 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Make coreutils tests for "ls". -*-Makefile-*- + +# Copyright (C) 1997-2003, 2006-2007 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/ls +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ + $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ + $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ + $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ + $(top_srcdir)/m4/canon-host.m4 \ + $(top_srcdir)/m4/canonicalize.m4 \ + $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ + $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ + $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ + $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ + $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ + $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ + $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ + $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/euidaccess-stat.m4 \ + $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ + $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ + $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ + $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ + $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ + $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ + $(top_srcdir)/m4/getcwd-abort-bug.m4 \ + $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ + $(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getdelim.m4 \ + $(top_srcdir)/m4/getgroups.m4 $(top_srcdir)/m4/gethostname.m4 \ + $(top_srcdir)/m4/gethrxtime.m4 $(top_srcdir)/m4/getline.m4 \ + $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getndelim2.m4 \ + $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/getpagesize.m4 \ + $(top_srcdir)/m4/getpass.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ + $(top_srcdir)/m4/getugroups.m4 \ + $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/group-member.m4 \ + $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ + $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ + $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ + $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ + $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ + $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ + $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ + $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ + $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ + $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ + $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ + $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ + $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ + $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ + $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ + $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/regex.m4 \ + $(top_srcdir)/m4/rename-dest-slash.m4 \ + $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ + $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/root-dev-ino.m4 \ + $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ + $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ + $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ + $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ + $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ + $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ + $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ + $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ + $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ + $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ + $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ + $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ + $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ + $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ + $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ + $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ + $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ + $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ + $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ + $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ + $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ + $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ +ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ +ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ +ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ +ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ +ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ +ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ +ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ +ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ +ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ +ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ +ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ +ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ +ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ +ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +ARPA_INET_H = @ARPA_INET_H@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DF_PROG = @DF_PROG@ +DIRENT_H = @DIRENT_H@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXEEXT = @EXEEXT@ +FCNTL_H = @FCNTL_H@ +FNMATCH_H = @FNMATCH_H@ +GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ +GETOPT_H = @GETOPT_H@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_IMAXABS = @GNULIB_IMAXABS@ +GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNU_PACKAGE = @GNU_PACKAGE@ +GREP = @GREP@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRNDUP = @HAVE_STRNDUP@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE__BOOL = @HAVE__BOOL@ +HELP2MAN = @HELP2MAN@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTTYPES_H = @INTTYPES_H@ +KMEM_GROUP = @KMEM_GROUP@ +LDFLAGS = @LDFLAGS@ +LIBCOREUTILS_LIBDEPS = @LIBCOREUTILS_LIBDEPS@ +LIBCOREUTILS_LTLIBDEPS = @LIBCOREUTILS_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ACL = @LIB_ACL@ +LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_CRYPT = @LIB_CRYPT@ +LIB_EACCESS = @LIB_EACCESS@ +LIB_FDATASYNC = @LIB_FDATASYNC@ +LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAN = @MAN@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEED_SETGID = @NEED_SETGID@ +NETINET_IN_H = @NETINET_IN_H@ +OBJEXT = @OBJEXT@ +OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +SEQ_LIBM = @SEQ_LIBM@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +U = @U@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WCTYPE_H = @WCTYPE_H@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS = \ + nameless-uid \ + color-dtype-dir \ + stat-failed \ + stat-dtype \ + inode dangle file-type recursive dired infloop \ + rt-1 time-1 symlink-slash follow-slink no-arg m-option \ + stat-vs-dirent + +EXTRA_DIST = $(TESTS) +TESTS_ENVIRONMENT = \ + top_srcdir=$(top_srcdir) \ + srcdir=$(srcdir) \ + CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \ + PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ + PERL="$(PERL)" \ + PROG=ls + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/ls/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/ls/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/ls/color-dtype-dir b/tests/ls/color-dtype-dir new file mode 100755 index 0000000..f3f9ee9 --- /dev/null +++ b/tests/ls/color-dtype-dir @@ -0,0 +1,67 @@ +#!/bin/sh +# Ensure "ls --color" properly colors other-writable and sticky directories. +# Before coreutils-6.2, this test would fail, coloring all three +# directories the same as the first one -- but only on a file system +# with dirent.d_type support. + +# Copyright (C) 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +mkdir d other-writable sticky || framework_failure=1 +chmod o+w other-writable || framework_failure=1 +chmod o+t sticky || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls --color=always > out || fail=1 +cat -A out > o1 || fail=1 +echo >> o1 || fail=1 +mv o1 out || fail=1 + +cat <<\EOF > exp || fail=1 +^[[0m^[[01;34md^[[0m$ +^[[34;42mother-writable^[[0m$ +^[[0mout^[[0m$ +^[[37;44msticky^[[0m$ +^[[m +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/dangle b/tests/ls/dangle new file mode 100755 index 0000000..a3bc0d2 --- /dev/null +++ b/tests/ls/dangle @@ -0,0 +1,67 @@ +#!/bin/sh +# Make sure ls properly handles dangling symlinks vs. ls's -L, -H, options. + +# Copyright (C) 2003, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +ln -s no-such-file dangle || framework_failure=1 +mkdir -p dir/sub || framework_failure=1 +ln -s dir slink-to-dir || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +# This must exit nonzero. +ls -L dangle > /dev/null 2>&1 && fail=1 +# So must this. +ls -H dangle > /dev/null 2>&1 && fail=1 + +# This must exit successfully. +ls dangle >> out || fail=1 + +ls slink-to-dir >> out 2>&1 || fail=1 +ls -H slink-to-dir >> out 2>&1 || fail=1 +ls -L slink-to-dir >> out 2>&1 || fail=1 + +cat <<\EOF > exp +dangle +sub +sub +sub +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/dired b/tests/ls/dired new file mode 100755 index 0000000..d6f32b4 --- /dev/null +++ b/tests/ls/dired @@ -0,0 +1,56 @@ +#!/bin/sh +# make sure --dired option works + +# Copyright (C) 2001, 2002, 2004, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +tmp=dired.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +mkdir dir || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +LC_MESSAGES=C ls -lR --dired dir > out || fail=1 +cat <<EOF > exp + dir: + total 0 +//SUBDIRED// 2 5 +//DIRED-OPTIONS// --quoting-style=literal +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/file-type b/tests/ls/file-type new file mode 100755 index 0000000..80d778a --- /dev/null +++ b/tests/ls/file-type @@ -0,0 +1,90 @@ +#!/bin/sh +# contrast ls -F, ls -p, and ls --indicator-style=file-type + +# Copyright (C) 2002, 2005, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check +. $srcdir/../lang-default + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +mkdir sub +cd sub +mkdir dir +touch regular executable +chmod a+x executable +ln -s regular slink-reg +ln -s dir slink-dir +ln -s nowhere slink-dangle +mknod block b 20 20 2> /dev/null && block="block +" +mknod char c 10 10 2> /dev/null && char="char +" +mkfifo fifo +cd .. + + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls -F sub > out || fail=1 +cat <<EOF > exp +$block${char}dir/ +executable* +fifo| +regular +slink-dangle@ +slink-dir@ +slink-reg@ +EOF + +sed 's/\*//' exp > exp2 +ls --indicator-style=file-type sub > out2 || fail=1 + +sed 's/[@|]$//' exp2 > exp3 +ls -p sub > out3 || fail=1 + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +cmp out2 exp2 || fail=1 +test $fail = 1 && diff out2 exp2 2> /dev/null + +cmp out3 exp3 || fail=1 +test $fail = 1 && diff out3 exp3 2> /dev/null + +ls --color=auto -F sub > out || fail=1 +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/follow-slink b/tests/ls/follow-slink new file mode 100755 index 0000000..00e9b1b --- /dev/null +++ b/tests/ls/follow-slink @@ -0,0 +1,86 @@ +#!/bin/sh +# make sure ls -L always follows symlinks + +# Copyright (C) 2000, 2002, 2004, 2006, 2007 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +pwd=`pwd` +tmp=follow-sl.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +# Isolate output files from directory being listed +mkdir dir dir/sub dir1 || framework_failure=1 +cd dir || framework_failure=1 +ln -s link link || framework_failure=1 +ln -s ../../dir1 sub/link-to-dir || framework_failure=1 + +# Make sure the symlink was created. +# `ln -s link link' succeeds, but creates no file on +# systems running some DJGPP-2.03 libc. +ls -F link > /dev/null || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' + (exit 1); exit 1 +fi + +fail=0 + +# When explicitly listing a broken link, the command must fail. +ls -L link 2> /dev/null && fail=1 + +# When encountering a broken link implicitly, Solaris 9 and OpenBSD 3.4 +# list the link, provided no further information about the link needed +# to be printed. Since POSIX does not specify one way or the other, we +# opt for compatibility (this was broken in 5.3.0 through 5.94). +LC_ALL=C ls -L > ../out-L || fail=1 +LC_ALL=C ls -FLR sub > ../out-FLR-sub || fail=1 + +cd .. || fail=1 + +cat <<\EOF > exp-L +link +sub +EOF + +cat <<\EOF > exp-FLR-sub +sub: +link-to-dir/ + +sub/link-to-dir: +EOF + +cmp out-L exp-L || { + fail=1 + diff out-L exp-L +} +cmp out-FLR-sub exp-FLR-sub || { + fail=1 + diff out-FLR-sub exp-FLR-sub +} + +(exit $fail); exit $fail diff --git a/tests/ls/infloop b/tests/ls/infloop new file mode 100755 index 0000000..f7790b8 --- /dev/null +++ b/tests/ls/infloop @@ -0,0 +1,61 @@ +#!/bin/sh +# 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 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../lang-default + +pwd=`pwd` +tmp=infloop.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +mkdir loop || framework_failure=1 +ln -s ../loop loop/sub || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls -RL loop 2>err | head -n 7 > out +# With an inf-looping ls, out will contain these 7 lines: +cat <<EOF > bad +loop: +sub + +loop/sub: +sub + +loop/sub/sub: +EOF + +cmp out bad 2>/dev/null && fail=1 + +(exit $fail); exit $fail diff --git a/tests/ls/inode b/tests/ls/inode new file mode 100755 index 0000000..305eb22 --- /dev/null +++ b/tests/ls/inode @@ -0,0 +1,83 @@ +#!/bin/sh +# Make sure that ls -i works properly on symlinks. + +# Copyright (C) 2003, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +touch f || framework_failure=1 +ln -s f slink || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +# When listed explicitly: + +set x `ls -Ci f slink`; shift +test $# = 4 || fail=1 +# The inode numbers should differ. +test "$1" != "$3" || fail=1 + +set x `ls -CLi f slink`; shift +test $# = 4 || fail=1 +# With -L, they must be the same. +test "$1" = "$3" || fail=1 + +set x `ls -CHi f slink`; shift +test $# = 4 || fail=1 +# With -H, they must be the same, too, from the command line. +# Note that POSIX says -H must make ls dereference only +# symlinks (specified on the command line) to directories, +# but the historical BSD meaning of -H is to dereference +# any symlink given on the command line. For compatibility GNU ls +# implements the BSD semantics. +test "$1" = "$3" || fail=1 + +# When listed from a directory: + +set x `ls -Ci`; shift +test $# = 4 || fail=1 +# The inode numbers should differ. +test "$1" != "$3" || fail=1 + +set x `ls -CLi`; shift +test $# = 4 || fail=1 +# With -L, they must be the same. +test "$1" = "$3" || fail=1 + +set x `ls -CHi`; shift +test $# = 4 || fail=1 +# With -H, they must be different from inside a directory. +test "$1" != "$3" || fail=1 + +(exit $fail); exit $fail diff --git a/tests/ls/m-option b/tests/ls/m-option new file mode 100755 index 0000000..e002fc4 --- /dev/null +++ b/tests/ls/m-option @@ -0,0 +1,61 @@ +#!/bin/sh +# exercise the -m option + +# Copyright (C) 2003, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +seq 2000 > b || framework_failure=1 +touch a || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +# Before coreutils-5.1.1, the following would output a space after the comma. +ls -w2 -m a b > out || fail=1 + +# Before coreutils-5.1.1, the following would produce leading white space. +# All of the sed business is because the sizes are not portable. +ls -sm a b | sed 's/^[0-9]/0/;s/, [0-9][0-9]* b/, 12 b/' >> out || fail=1 +cat <<\EOF > exp || fail=1 +a, +b +0 a, 12 b +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid new file mode 100755 index 0000000..70b0613 --- /dev/null +++ b/tests/ls/nameless-uid @@ -0,0 +1,65 @@ +#!/bin/sh +# Ensure that ls -l works on files with nameless uid and/or gid + +# Copyright (C) 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check +. $srcdir/../lang-default +PRIV_CHECK_ARG=require-root . $srcdir/../priv-check + +$PERL -e 1 > /dev/null 2>&1 || { + echo 1>&2 "$0: configure didn't find a usable version of Perl," \ + "so can't run this test" + (exit 77); exit 77 +} + +nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'` + +if test x$nameless_uid = x; then + echo "$0: couldn't find a nameless UID" 1>&2 + (exit 77); exit 77 +fi + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +touch f || framework_failure=1 +chown $nameless_uid f || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +set -- `ls -o f` || fail=1 +test $3 = $nameless_uid || fail=1 + +(exit $fail); exit $fail diff --git a/tests/ls/no-arg b/tests/ls/no-arg new file mode 100755 index 0000000..0c56e03 --- /dev/null +++ b/tests/ls/no-arg @@ -0,0 +1,76 @@ +#!/bin/sh +# make sure ls and `ls -R' do the right thing when invoked with no arguments. + +# Copyright (C) 2001, 2003, 2004, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +pwd=`pwd` +tmp=no-args.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +mkdir -p dir/subdir || framework_failure=1 +touch dir/subdir/file2 || framework_failure=1 +ln -s f symlink || framework_failure=1 + +cat > exp <<\EOF || framework_failure=1 +dir +exp +out +symlink +EOF + +if test $framework_failure = 1; then + echo 'failure in testing framework' + (exit 1); exit 1 +fi + +fail=0 + +ls -1 > out || fail=1 + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +cat > exp <<\EOF +.: +dir +exp +out +symlink + +./dir: +subdir + +./dir/subdir: +file2 +EOF + +ls -R1 > out || fail=1 + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/recursive b/tests/ls/recursive new file mode 100755 index 0000000..c4a2725 --- /dev/null +++ b/tests/ls/recursive @@ -0,0 +1,85 @@ +#!/bin/sh +# 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 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +tmp=recursive.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +mkdir x y a b c a/1 a/2 a/3 || framework_failure=1 +touch f a/1/I a/1/II || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +# This first example is from Andreas Schwab's bug report. +ls -R1 a b c > out || fail=1 +cat <<EOF > exp +a: +1 +2 +3 + +a/1: +I +II + +a/2: + +a/3: + +b: + +c: +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +rm -rf out exp +ls -R1 x y f > out || fail=1 +cat <<EOF > exp +f + +x: + +y: +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/rt-1 b/tests/ls/rt-1 new file mode 100755 index 0000000..5c0f3c8 --- /dev/null +++ b/tests/ls/rt-1 @@ -0,0 +1,71 @@ +#!/bin/sh +# Make sure name is used as secondary key when sorting on mtime or ctime. + +# Copyright (C) 1998, 2001, 2002, 2004, 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +. $srcdir/../envvar-check +. $srcdir/../lang-default + +if test "$VERBOSE" = yes; then + set -x + ls --version + touch --version +fi + +pwd=`pwd` +tmp=t-ls.$$ +trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +date=1998-01-15 + +touch -d "$date" c || framework_failure=1 +touch -d "$date" a || framework_failure=1 +touch -d "$date" b || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls -1t a b c > out || fail=1 +cat <<EOF > exp +a +b +c +EOF +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +rm -rf out exp +ls -1rt a b c > out || fail=1 +cat <<EOF > exp +c +b +a +EOF +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/stat-dtype b/tests/ls/stat-dtype new file mode 100755 index 0000000..9e903ac --- /dev/null +++ b/tests/ls/stat-dtype @@ -0,0 +1,86 @@ +#!/bin/sh +# Ensure that ls --file-type does not call stat unnecessarily. +# Also check for the dtype-related (and fs-type dependent) bug +# in coreutils-6.0 that made ls -CF columns misaligned. + +# Copyright (C) 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# The trick is to create an un-stat'able symlink and to see if ls +# can report its type nonetheless, using dirent.d_type. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +# 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, +# but if ls's d_type code is buggy then "ls -p" might be buggy too. +mkdir -p c/d || framework_failure=1 +chmod a-x c || framework_failure=1 +if test "X`ls -p c 2>&1`" != Xd/; then + echo "$0: '.' is not on a suitable file system for this test" 1>&2 + echo "$0: skipping this test" 1>&2 + (exit 77); exit 77 +fi + +mkdir d || framework_failure=1 +ln -s / d/s || framework_failure=1 +chmod 600 d || framework_failure=1 + +mkdir -p e/a2345 e/b || framework_failure=1 +chmod 600 e || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls --file-type d > out || fail=1 +cat <<\EOF > exp || fail=1 +s@ +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +rm -f out exp +# Check for the ls -CF misaligned-columns bug: +ls -CF e > out || fail=1 + +# coreutils-6.0 would print two spaces after the first slash, +# rather than the appropriate TAB. +printf 'a2345/\tb/\n' > exp || fail=1 + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/stat-failed b/tests/ls/stat-failed new file mode 100755 index 0000000..fb1cff8 --- /dev/null +++ b/tests/ls/stat-failed @@ -0,0 +1,75 @@ +#!/bin/sh +# Verify that ls works properly when it fails to stat a file that is +# not mentioned on the command line. + +# Copyright (C) 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check +. $srcdir/../lang-default +PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 +mkdir d || framework_failure=1 +ln -s / d/s || framework_failure=1 +chmod 600 d || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +ls -Log d > out 2> err +test $? = 1 || fail=1 + +cat <<\EOF > exp || fail=1 +total 0 +?????????? ? ? ? s +EOF + +sed 's/^l/?/' out | cmp - exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +# Ensure that the offsets in --dired output are accurate. +rm -f out exp +ls --dired -l d > out 2> /dev/null && fail=1 + +cat <<\EOF > exp || fail=1 + total 0 + ?????????? ? ? ? ? ? s +//DIRED// 44 45 +//DIRED-OPTIONS// --quoting-style=literal +EOF + +sed 's/^ l/ ?/' out | cmp - exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + +(exit $fail); exit $fail diff --git a/tests/ls/stat-vs-dirent b/tests/ls/stat-vs-dirent new file mode 100755 index 0000000..b71d7dd --- /dev/null +++ b/tests/ls/stat-vs-dirent @@ -0,0 +1,83 @@ +#!/bin/sh +# Ensure that d_ino (from ls -di) and st_ino (from stat --format=%i) match. + +# Copyright (C) 2006 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +root_dev_ino=`stat --format=%d-%i /` +t=`pwd` +while :; do + ls -i1 "$t" > tmp + if test $? = 0; then + # Extract the inode number from the first line of output from ls -i1. + # This value comes from dirent.d_ino, on systems with d_ino support. + d_ino=`sed -n '1s/^ *\([0-9][0-9]*\) .*/\1/p;q' tmp` + + # Extract the name of the corresponding directory entry. + file=`sed -n '1s/^ *[0-9][0-9]* *//p;q' tmp` + + # Get its inode number (stat.st_ino) via stat(1)'s call to lstat. + st_ino=`stat --format=%i "$t/$file"` + + # Make sure that they are the same. + # We know from experience that there may be mismatches on some + # buggy file systems, at mount points. + if test "$d_ino" != "$st_ino"; then + echo "$0: test failed: $t/$file: d_ino($d_ino) != st_ino($st_ino) + This may indicate a flaw in your kernel or file system implementation. + The flaw isn't serious for coreutils, but it might break other tools, + so you should report it to your operating system vendor." 1>&2 + + # This test fails too often, and we don't want to be distracted + # with reports, since the code that could be affected by the losing + # behavior (pwd and getcwd) works around any mismatch. + # So do continue to issue the warning, but don't count it as a + # real failure. + # fail=1 + break + fi + fi + + t=`(cd "$t/.."; pwd)` + dev_ino=`stat --format=%d-%i "$t"` + test $dev_ino = $root_dev_ino && break +done + +(exit $fail); exit $fail diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash new file mode 100755 index 0000000..1caa221 --- /dev/null +++ b/tests/ls/symlink-slash @@ -0,0 +1,52 @@ +#!/bin/sh +# Do dereference a symlink arg if its name is written with a trailing slash. + +# Copyright (C) 1999, 2000, 2004 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +. $srcdir/../envvar-check +. $srcdir/../lang-default + +tmp=t-ls.$$ + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +mkdir dir || framework_failure=1 +ln -s dir symlink || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' + exit 1 +fi + +fail=0 +set `ls -l symlink/` + +# Prior to fileutils-4.0k, the following would have output `... symlink -> dir'. +test "$*" = 'total 0' && : || fail=1 + +cd .. +rm -rf $tmp + +exit $fail diff --git a/tests/ls/time-1 b/tests/ls/time-1 new file mode 100755 index 0000000..aaaf04a --- /dev/null +++ b/tests/ls/time-1 @@ -0,0 +1,145 @@ +#!/bin/sh +# Test some of ls's sorting options. + +# Copyright (C) 1998, 1999, 2000, 2001, 2004 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +if test "$VERBOSE" = yes; then + set -x + ls --version +fi + +# Avoid any possible glitches due to daylight-saving changes near the +# time stamps used during the test. +TZ=UTC0 +export TZ + +# Avoid glitches due to the environment specifying `ls' styles. +unset QUOTING_STYLE +unset TIME_STYLE + +tmp=t-ls.$$ + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +t1='1998-01-15 21:00' +t2='1998-01-15 22:00' +t3='1998-01-15 23:00' + +u1='1998-01-14 11:00' +u2='1998-01-14 12:00' +u3='1998-01-14 13:00' + +touch -m -d "$t3" a || framework_failure=1 +touch -m -d "$t2" b || framework_failure=1 +touch -m -d "$t1" c || framework_failure=1 + +touch -a -d "$u3" c || framework_failure=1 +touch -a -d "$u2" b || framework_failure=1 +# Make sure A has ctime at least 1 second more recent than C's. +sleep 2 +touch -a -d "$u1" a || framework_failure=1 + +fail=0 + +# A has ctime more recent than C. +set `ls -c a c` +test "$*" = 'a c' || fail=1 + +# Sleep so long in an attempt to avoid spurious failures +# due to NFS caching and/or clock skew. +sleep 2 + +# Create a link, updating c's ctime. +ln c d || framework_failure=1 + +# Before we go any further, verify that touch's -m option works. +set -- `ls --full -l a` +case "$*" in + *" $t3:00.000000000 +0000 a") ;; + *) + # This might be what's making HPUX 11 systems fail this test. + cat >&2 << EOF +A basic test of touch -m has just failed, so the subsequent +tests in this file will not be run. + +In the output below, the date of last modification for \`a' should +have been $t3. +EOF + #` + ls --full -l a + framework_failure=1 + ;; +esac + +# Now test touch's -a option. +set -- `ls --full -lu a` +case "$*" in + *" $u1:00.000000000 +0000 a") ;; + *) + # This might be what's making HPUX 11 systems fail this test. + cat >&2 << EOF +A basic test of touch -a has just failed, so the subsequent +tests in this file will not be run. + +In the output below, the date of last access for \`a' should +have been $u1. +EOF + ls --full -lu a + (exit 77); exit 77 + ;; +esac + +if test $framework_failure = 1; then + echo 'failure in testing framework' + exit 1 +fi + +set `ls -ut a b c` +test "$*" = 'c b a' && : || fail=1 +test $fail = 1 && ls -l --full-time --time=access a b c + +set `ls -t a b c` +test "$*" = 'a b c' && : || fail=1 +test $fail = 1 && ls -l --full-time a b c + +# Now, C should have ctime more recent than A. +set `ls -ct a c` +if test "$*" = 'c a'; then + : ok +else + # In spite of documentation, (e.g., stat(2)), neither link nor chmod + # update a file's st_ctime on SunOS4.1.4. + cat >&2 << \EOF +failed ls ctime test -- this failure is expected at least for SunOS4.1.4 +and for tmpfs file systems on Solaris 5.5.1. + +In the output below, `c' should have had a ctime more recent than +that of `a', but does not. +EOF + #' + ls -ctl --full-time a c + fail=1 +fi + +cd .. +rm -rf $tmp + +exit $fail |