Commit Graph

3140 Commits

Author SHA1 Message Date
Jim Meyering
5b0e904272 Avoid spurious test failure when SELinux stats "selinux/class".
* tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.
2007-09-27 22:37:33 +02:00
Jim Meyering
beaa39a649 Add a test to exercise a readlink bug.
* tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
fixed through today's change to Gnulib's canonicalize module.
* tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
Bug report and a test case from mpb.mail@gmail.com.
2007-09-27 10:53:08 +02:00
Jim Meyering
1b246cc692 Don't print the commands of a 10-line script that's run in each subdir.
* tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise.
2007-09-22 23:26:45 +02:00
Jim Meyering
a7ec8caffe rm: give a sensible diagnostic when failing to remove a symlink
On some systems (those with openat et al), when rm would fail to
remove a symlink, it would fail with the misleading diagnostic,
"Too many levels of symbolic links".
* NEWS: Mention the bug fix.
* src/remove.c (is_nondir_lstat): New function.
(remove_entry): Use it to catch failed-to-remove symlink (and any
other non-dir) here so that we don't fall through and try to treat
it as directory, which -- with a symlink -- would provoke the bogus
ELOOP failure.
* tests/rm/fail-eacces: Add a test for the above.
* src/c99-to-c89.diff: Adjust offsets.
2007-09-22 13:27:57 +02:00
Jim Meyering
308adf1691 Avoid a test failure due to now-parallelized tests.
* tests/du/two-args: Run "du .." from a sub-directory one level deeper.
2007-09-21 08:30:55 +02:00
Jim Meyering
dbab417753 tests/misc/tac-continue: Arrange to remove a temporary file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
ed2a9e9637 tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of $(TESTS),
so that "make check TESTS=test-name" works once again.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
d423f4a14b tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
57c4cb5d88 * tests/rm/v-slash: Avoid test failure with non-C locale.
Reported by Michael Stone.
2007-09-16 01:06:16 +02:00
Jim Meyering
d96a863cf5 Enable some previously omitted test scripts. Add a test cross-check.
* tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Reenable this test.  Adjust for new rm.
* tests/mkdir/Makefile.am: Add writable-under-readonly.
* tests/mkdir/writable-under-readonly: Add some comments.
This test is always skipped, for now.
* tests/Makefile.am (ta): Hook up the new root-only script.
* tests/tail-2/infloop-1: Make this test pass.
* tests/tail-2/Makefile.am (TESTS): Add infloop-1.
* tests/tail-2/fflush: Remove unused file.
* tests/check.mk (vc_executable_is_in_TESTS): More portable.
* tests/check.mk (check): Depend on the above.
* build-aux/check.mk: Remove comment mentioning AUTHORS file.
2007-09-15 18:59:08 +02:00
Jim Meyering
56f1bd10fc Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
tests/check.mk (top_srcdir): Define.
tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir),
$(abs_top_srcdir), and $(abs_top_builddir), since they're
defined via the included tests/check.mk.
2007-09-15 08:40:39 +02:00
Jim Meyering
fbae6a7b39 tests/general: Remove from VC, this long-unused directory and contents. 2007-09-15 08:40:39 +02:00
Jim Meyering
53d36aaf9a Adapt tests/tail-2/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
10d190b8b6 Adapt tests/readlink/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
5cb2610710 Move the sole test in tests/ls-2/ to tests/misc/.
* tests/ls-2/basic-1: Move this file to ...
* tests/misc/ls-misc: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add ls-misc.
* tests/Makefile.am (SUBDIRS): Remove ls-2.
* tests/ls-2: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
a669dfdabb More misc, test-related changes. (some to allow running tests as root) 2007-09-15 08:40:39 +02:00
Jim Meyering
0539705768 Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
Reflect these renamings:
od/od-N             misc/od-N
od/x8               misc/od-x8
sha1sum/basic-1     misc/sha1sum
sha1sum/sample-vec  misc/sha1sum-vec
shred/exact         misc/shred-exact
shred/remove        misc/shred-remove
stty/basic-1        misc/stty
stty/invalid        misc/stty-invalid
stty/row-col-1      misc/stty-row-col

* tests/misc/Makefile.am (TESTS): Add the new files.
* tests/Makefile.am (SUBDIRS): Remove the dir names.
* tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the directories.
* configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile names.
2007-09-15 08:40:39 +02:00
Jim Meyering
44629cf147 Move the two tests in tests/tee to tests/misc/.
* tests/tee/basic: Move this file to ...
* tests/misc/tee: ...here.  Don't rely on $PROG in env.
* tests/tee/dash: Move this file to ...
* tests/misc/tee-dash: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tee.
* tests/Makefile.am (SUBDIRS): Remove tee.
* tests/tee: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
eb3f59b7e1 Move the two tests in tests/sum/ to tests/misc/.
* tests/sum/basic-1: Move this file to ...
* tests/misc/sum: ...here.  Don't rely on $PROG in env.
* tests/sum/sysv: Move this file to ...
* tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
* tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
* tests/Makefile.am (SUBDIRS): Remove sum.
* tests/sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
1529be6051 Move the sole test in tests/tsort/ to tests/misc/tsort.
* tests/tsort/basic-1: Move this file to ...
* tests/misc/tsort: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tsort.
* tests/Makefile.am (SUBDIRS): Remove tsort.
* tests/tsort: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
47b7234de3 Move the sole test in tests/unexpand to tests/misc/unexpand.
* tests/unexpand/basic-1: Move this file to ...
* tests/misc/unexpand: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add unexpand.
* tests/Makefile.am (SUBDIRS): Remove unexpand.
* tests/unexpand: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
d62bdb30f7 Move the sole test in tests/seq to tests/misc/seq.
* tests/seq/basic: Move this file to ...
* tests/misc/seq: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add seq.
* tests/Makefile.am (SUBDIRS): Remove seq.
* tests/seq: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
be23f60132 Convert tests/mkdir/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
570fd054c6 Move the two tests in tests/md5sum to tests/misc/md5sum.
* tests/md5sum/basic-1: Move this file to ...
* tests/misc/md5sum: ...here.  Don't rely on $PROG in env.
* tests/md5sum/newline-1: Move this file to ...
* tests/misc/md5sum-newline: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add md5sum.
* tests/Makefile.am (SUBDIRS): Remove md5sum.
* tests/md5sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
b10817d9bd tests/sample-test: Update to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
03a08a4cd0 Convert tests/misc/ to use test-lib.sh, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
28f1844cef Convert tests/ls/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
7455bf9432 Convert tests/ln/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
74ffe86ed0 Convert tests/install/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
a0cbaa4fc8 Move the two tests in tests/fmt to tests/misc/fmt.
* tests/fmt/basic: Move this file to ...
* tests/misc/fmt: ...here.  Don't rely on $PROG in env.
* tests/fmt/long-line: Move this file to ...
* tests/misc/fmt-long-line: ...here.
* tests/misc/Makefile.am (TESTS): Add fmt.
* tests/Makefile.am (SUBDIRS): Remove fmt.
* tests/fmt: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
aa3a727dc0 Move the sole test in tests/factor to tests/misc/factor.
* tests/factor/basic: Move this file to ...
* tests/misc/factor: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add factor.
* tests/Makefile.am (SUBDIRS): Remove factor.
* tests/factor: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
fd9f53cfdf Move the sole test in tests/expr to tests/misc/expr.
* tests/expr/basic: Move this file to ...
* tests/misc/expr: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add expr.
* tests/Makefile.am (SUBDIRS): Remove expr.
* tests/expr: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
ec2064acc8 Convert tests/du/*, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
18b3231bbf Move the sole test in tests/dircolors to tests/misc/dircolors.
* tests/dircolors/simple: Move this file to...
* tests/misc/dircolors: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add dircolors.
* tests/Makefile.am (SUBDIRS): Remove dircolors.
* tests/dircolors: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
ceb5b04614 Convert tests/dd/*, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
33173e867a Convert tests/mv, too.
* tests/other-fs-tmpdir: Before, all callers would exit 77 upon failure to
find the required dir.  Now, exit 77 in this script so callers don't have to.
Adjust callers.
2007-09-15 08:40:38 +02:00
Jim Meyering
df0beae1eb Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
* tests/check.mk: Also define abs_top_builddir.
2007-09-15 08:40:38 +02:00
Jim Meyering
c840cd4334 Parallel "make check" support.
* build-aux/check.mk: New file, from The Vaucanson Group.
* .x-sc_GPL_version: New file, to allow "version 2 or later"
in build-aux/check.mk.
* Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
* tests/check.mk: New file.
* tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.

Begin factoring "sample-test" out of test scripts.
* tests/test-lib.sh: New file, to be sourced by all tests that
were previously derived from the "sample-test" template.
* tests/mkdtemp: New file.
* tests/touch/dir-1: Use test-lib.sh.
* tests/touch/empty-file: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/no-rights: Likewise.  Also, don't sleep.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
* tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
to get the parallel-"make check" bits.

Move a slow test into tests/misc.

* tests/check.mk: Wrapper.
* tests/ls/time-1: Move this file to tests/misc/ls-time.
* tests/misc/ls-time: New file.  From tests/ls/time-1.
* tests/ls/Makefile.am (TESTS): Remove time-1.
* tests/misc/Makefile.am (TESTS): Add ls-time.
2007-09-15 08:40:38 +02:00
Jim Meyering
7a6a30b8a2 Add support for parallel "make check" (in tests/misc, for now) 2007-09-15 08:40:38 +02:00
Jim Meyering
500eccdbe4 chmod: don't ignore a dangling symlink
* NEWS: Mention the bug fix.
* src/chmod.c (process_file): Handle the case of FTS_SLNONE,
i.e., give a diagnostic saying we cannot operate on such a file.
* tests/chmod/thru-dangling: Compare new stderr output with expected.
2007-09-07 10:45:22 +02:00
Bob Proulx
e70487cda7 Add a test: demonstrate that chmod ignores a dangling symlink
* tests/chmod/thru-dangling: New test.  Fails.
* tests/chmod/Makefile.am (TESTS): Add thru-dangling.
2007-09-07 10:31:14 +02:00
Jim Meyering
0fb836f179 Adapt to new SELinux behavior: "?" vs. new "unlabeled"
* src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
from getfilecon/lgetfilecon the same way we interpret a negative
return value: no security context.  So we don't print the "+".
* tests/selinux: Recognize that "unlabeled" means insufficient
support for SELinux, just like "?".
2007-09-05 10:58:45 +02:00
Jim Meyering
6873756075 Make groups-version executable,
* tests/misc/groups-version: ... as it was in the patch.
2007-09-01 11:20:42 +02:00
Eric Blake
3637b9572b Test yesterday's change to groups.
* tests/misc/groups-version: New test.
* tests/misc/Makefile.am (TESTS): Add groups-version.
2007-08-31 23:26:44 +02:00
Jim Meyering
58ddd2c5a1 Ensure that TMPDIR is valid. Otherwise, it would cause test failures.
* tests/misc/tty-eof: Set TMPDIR=.
* tests/misc/sort-compress: Likewise.
2007-08-29 00:17:27 +02:00
Jim Meyering
ddb029b0f0 tests/misc/fold: Fix a typo: missing \ in a never-seen diagnostic 2007-08-26 18:45:19 +02:00
Jim Meyering
6e3e819f4b Remove all .cvsignore files from version control. 2007-08-25 00:27:11 +02:00
Jim Meyering
d02e4e7775 Don't let ln be a party to destroying user data.
* src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h".
(dest_set, DEST_INFO_INITIAL_CAPACITY): New globals.
(do_link): Refuse to remove a just-created link.
Record a name,dev,ino triple for each link we create.
(main): Initialize dest_set, if needed.
* tests/mv/childproof: Test for the above fix.
* NEWS: Document this.
Reported by Eric Blake.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-23 14:00:35 +02:00
Jim Meyering
0918810a7d Change "rm --verbose -r a//" not to print extra slashes in a///b
* src/remove.c (push_dir): Don't copy trailing slashes onto the stack.
Reported by François Pinard.
* tests/rm/v-slash: New file.  Test for the above change.
* tests/rm/Makefile.am (TESTS): Add v-slash.
2007-08-22 20:02:34 +02:00
Jim Meyering
b78c6b68f7 Run each Coreutils.pm-based test in its own subdirectory.
* tests/CuTmpdir.pm: New file.
* tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm.
* tests/misc/od, tests/misc/base64, tests/misc/basename:
* tests/misc/cut, tests/misc/date, tests/misc/dirname:
* tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
* tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
* tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
* tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
* tests/misc/wc-files0-from, tests/misc/xstrtol:
* tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
* tests/expr/basic, tests/factor/basic, tests/fmt/basic:
* tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
* tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
* tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
* tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
* tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
not "../../src/test", so it works when run from a subdirectory.
* tests/ls-2/tests: Create temp files and dirs from within the perl
script, so that they're removed, when run from a subdirectory.
2007-08-18 08:53:31 +02:00