summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
AgeCommit message (Collapse)Author
2007-10-21Reorder tests to run more basic ones earlier.Jim Meyering
* tests/misc/Makefile.am (TESTS): Reorder. * tests/Makefile.am (SUBDIRS): Reorder. Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-09Move the help-version test into misc/.Jim Meyering
* tests/help-version: Move to... * tests/misc/help-version: ...here. Source test-lib.sh, as usual. Use $abs_top_builddir, rather than ".." and "../..".
2007-10-09Skip the chcon test on a system with no SELinux support.Jim Meyering
* tests/test-lib.sh (require_selinux_): New function. * tests/misc/chcon: Use it. * tests/misc/selinux: Use it here, too. * tests/cp/cp-a-selinux: and here. * tests/selinux: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove selinux. Reported by Mike Frysinger and Bauke Jan Douma.
2007-10-05Make a failing cross-partition mv give a sensible diagnostic.Jim Meyering
A cross-partition move of a file in a sticky tmpdir and owned by another user would evoke an invalid diagnostic after copying it: mv: cannot remove `x': Operation not permitted Either of the following (mv.c, remove.c) changes would fix the bug by itself. I think it's slightly better to use both; the added cost is minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition, rm: an extra lstat-per-unlink-that-fails-w/EPERM. * src/remove.c (remove_entry): Also lstat the file upon EPERM. * src/mv.c (rm_option_init): Initialize root_dev_ino just as is done in rm, so that a cross-partition invoked remove.c:rm call works the same way as one invoked from the command-line use of "rm". That setting of root_dev_ino makes rm() do the equivalent of an additional lstat for each argument, which in turn gives rm enough information to issue the right diagnostic. * tests/mv/sticky-to-xpart (version): New file. Test for the above. * tests/mv/Makefile.am (TESTS): Add sticky-to-xpart. Arrange for "make check-root" to run the new root-only test. * tests/Makefile.am (tb): New target, to run the new root-only test. (all_t): Add tb. * src/c99-to-c89.diff: Adjust offsets.
2007-09-15Enable some previously omitted test scripts. Add a test cross-check.Jim Meyering
* 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-15Move the sole test in tests/ls-2/ to tests/misc/.Jim Meyering
* 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-15Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.Jim Meyering
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-15Move the two tests in tests/tee to tests/misc/.Jim Meyering
* 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-15Move the two tests in tests/sum/ to tests/misc/.Jim Meyering
* 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-15Move the sole test in tests/tsort/ to tests/misc/tsort.Jim Meyering
* 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-15Move the sole test in tests/unexpand to tests/misc/unexpand.Jim Meyering
* 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-15Move the sole test in tests/seq to tests/misc/seq.Jim Meyering
* 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-15Move the two tests in tests/md5sum to tests/misc/md5sum.Jim Meyering
* 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-15Move the two tests in tests/fmt to tests/misc/fmt.Jim Meyering
* 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-15Move the sole test in tests/factor to tests/misc/factor.Jim Meyering
* 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-15Move the sole test in tests/expr to tests/misc/expr.Jim Meyering
* 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-15Move the sole test in tests/dircolors to tests/misc/dircolors.Jim Meyering
* 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-15Parallel "make check" support.Jim Meyering
* 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-08-18Run each Coreutils.pm-based test in its own subdirectory.Jim Meyering
* 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-07-15ls --color: Don't stat symlinks when neither ORPHAN nor MISSING attribute ↵Jim Meyering
has a color. * src/ls.c (main): Don't set check_symlink_color when C_EXEC is colored, unless ln=target (aka color_symlink_as_referent) is set. (gobble_file): Set f->linkok = true also when !check_symlink_color. http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927 Reported by Jeremy Maitin-Shepard. * tests/strace: New file, contents extracted from... * tests/mv/atomic: ...here. Source strace. * tests/ls/stat-free-symlinks: New file. Test for the above. Use strace to ensure that in this corner case, ls does not call stat. * tests/ls/Makefile.am (TESTS): Add stat-free-symlinks. * tests/Makefile.am (EXTRA_DIST): Add strace.
2007-07-10Skip "arch" test if it's not built.Jim Meyering
* tests/misc/Makefile.am (built_programs): Define. (TESTS_ENVIRONMENT): Add $(built_programs), for... * tests/misc/arch: ...this: skip the test if arch is not built. * src/Makefile.am (built_programs.list): New rule. * tests/Makefile.am (built_programs): Rename from all_programs. (TESTS_ENVIRONMENT): Use built_programs, not all_programs. * tests/help-version: Likewise. * NEWS: Mention that using --enable-no-install-program=X may cause "make check" to fail. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-03-29Arrange for "make check-root" to run the new root-only test.Jim Meyering
* tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux. (all_t): Add t9. Use a directory on a loopback device mounted with -o context=... * tests/cp/cp-a-selinux: Since this test now runs mount and umount, it is a root-only one.
2007-03-29* tests/cp/cp-a-selinux: New file. Test for the bug reported inJim Meyering
* tests/cp/Makefile.am (TESTS): Add cp-a-selinux. * tests/selinux: New file. * tests/Makefile.am (EXTRA_DIST): Add selinux. * tests/misc/selinux: Source the new script, rather than open coding it. Change how "cp -a" and "cp --preserve=context" work with SELinux. Now, cp -a attempts to preserve context, but failure to do so does not change cp's exit status. However "cp --preserve=context" is similar, but failure *does* cause cp to exit with nonzero status. * src/copy.h (struct cp_options) [require_preserve_context]: New member. * src/copy.c (copy_reg, copy_internal): Implement the above. * src/mv.c (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (decode_preserve_arg): Set it or reset it. FIXME: add an on-writable-NFS-only test
2007-03-29ls: Add support for SELinux and a slightly modified -Z option.Jim Meyering
I started with the patches from Red Hat. The entries below tell how the code evolved. * src/ls.c (print_long_format, print_file_name_and_frills): When there is no security context (due to getfilecon/lgetfilecon failing with e.g. ENOTSUP), print it as "?", not "". * src/ls.c (print_file_name_and_frills): Make -Z work without -l. (length_of_file_name_and_frills): Likewise. * src/ls.c: Remove the --lcontext and --scontext options. Change the way -Z, --context work so that it no longer implies -l. Thus, -Z -l will work like -lcontext and -Z without -l will work like --scontext. Adjust tests to reflect new 'ls -l' syntax -- affects only systems with SELinux when operating on a file with no ACL. These tests assumed that everything before the first space on each line is the 10-byte mode string. But there may also be a "+" in the 11th column, just before the space. However, note that this is not new. The same thing would have happened even without the change below, when listing a file with an ACL. * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm: * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod: * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm: Don't make compilation depend on USE_ACL. An SELinux security context counts as an "alternate access control method", so ls must output a "+" for each file with a security context. * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally. (FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly. (gobble_file): Record whether a file has a security context, and update the condition used to determine whether to print the "+". (gobble_file): Call getfilecon/lgetfilecon also when format == long_format, so that we get the "+". * src/ls.c (gobble_file): Add a comment explaining why (with a security context option) ls doesn't exit nonzero due to e.g., getfilecon failing with errno == ENOTSUP. * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due to ENOTSUP. * src/ls.c (gobble_file): Factor out three small blocks using getfilecon and lgetfilecon. Don't ignore return value from getfilecon and lgetfilecon. * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C ternary operator). (print_scontext_format): Likewise. (print_scontext): Declare to be "bool", not int. Adjust uses. * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX). * tests/misc/chcon: New file. * tests/misc/chcon-fail: New file. * tests/Makefile.am (check-root): Run new, root-only misc/chcon test. * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail. * tests/misc/Makefile.am (TESTS): Add selinux. * tests/misc/selinux: New file. * tests/help-version: Skip chcon.
2007-01-13Put CU_TEST_NAME in the environment for each test run by "make check".Jim Meyering
* Transform all Makefile.am files so that when running "make check", CU_TEST_NAME is set to the name of the test. This is so that when I run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" on the entire package it is more convenient to map a leak or error found in a valgrind log file back to the offending test. Use this command: (echo tests/Makefile.am.in; find tests -name Makefile.am) \ |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2006-11-21Arrange for "make check-root" to run the new root-only test.Jim Meyering
* tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid. (all_t): Add t7.
2006-10-25new feature: rm accepts new option: --one-file-systemJim Meyering
Suggested by Steve McIntyre in <http://bugs.debian.org/392925>. * src/remove.h (struct rm_options) [one_file_system]: New member. * src/rm.c (rm_option_init): Initialize it. (usage): Document the option. * src/mv.c (rm_option_init): Likewise. * src/remove.c (remove_dir): With --one-file-system and --recursive, for each directory command line argument, do not affect a file system different from that of the starting directory. And give a diagnostic. * src/rm.c (ONE_FILE_SYSTEM): New enum. (main): Handle new option. * tests/rm/one-file-system: Test the above. * tests/rm/Makefile.am (TESTS): Add one-file-system. * tests/Makefile.am (check-root): Add the rm/one-file-system test to the list. (EXTRA_DIST): Add other-fs-tmpdir. * tests/mv/setup: Removed. Renamed to... * tests/other-fs-tmpdir: ...this new file. * tests/mv/Makefile.am (EXTRA_DIST): Remove setup. * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/to-symlink: Likewise. * tests/mv/into-self-2: Likewise. [doc/ChangeLog] * coreutils.texi (rm invocation): Describe --one-file-system.
2006-10-24Don't let a failure in one test stop "make -k".Jim Meyering
* tests/Makefile.am (t1 t2 t3 t4 t5): New targets. (check-root): Depend on them, rather than executing the five commands in a single rule. Reported by Greg Schafer.
2006-08-19* tests/Makefile.am (EXTRA_DIST): Add sparse-file.Jim Meyering
2006-07-03* tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):Jim Meyering
Add $VG_PATH_PREFIX as a prefix to $PATH
2006-07-03* tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.Jim Meyering
* tests/Makefile.am (evar-check): Remove rule. (EXTRA_DIST): Remove .env-warn. * tests/.env-warn: Remove file. No longer used. Suggestion from Eric Blake.
2006-03-26(SUBDIRS): Remove basename.Jim Meyering
2006-01-24(check-root): Add tail-2/append-onlyJim Meyering
2006-01-13(SUBDIRS): Add comments discouraging theJim Meyering
addition of new directories under tests/.
2005-11-24(EXTRA_DIST): Add acl to the list.Jim Meyering
2005-11-04(EXTRA_DIST): Add very-expensive.Jim Meyering
2005-08-13(SUBDIRS): Remove date.Jim Meyering
2005-06-22(EXTRA_DIST): Add umask-check.Paul Eggert
2005-04-20(EXTRA_DIST): Add Coreutils.pm and remove Fetish.pm.Paul Eggert
2005-04-05(SUBDIRS): Add tee.Jim Meyering
2005-01-30(.PHONY): Add check-root and root-hint.Jim Meyering
2005-01-04(check-root): Update.Jim Meyering
2004-07-06(SUBDIRS): Add readlink.Jim Meyering
2004-05-13 Don't assume that "make -C" works; Solaris "make" doesn't have -C.Jim Meyering
* src/Makefile.am (all_programs.list): New rule, copied from man/Makefile.am and tests/Makefile.am, except that we use the system tr rather than ./tr and we don't use tr -s. * tests/Makefile.am (all_programs): Use it.
2004-01-08(TESTS_ENVIRONMENT): Remove `/vg' (prerelease testJim Meyering
remnant) from PATH component. That would cause tests in this directory not to run the just-built binaries, but rather whatever happened to be in one's PATH. Reported by Christian Krackowizer.
2003-12-20(root-hint): Tweak wording.Jim Meyering
2003-11-20(TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.Jim Meyering
2003-09-10(programs): Use ../src/tr -s ' ' '\n' in placeJim Meyering
of `fmt -1'. Using the just-built tr is a little cleaner. Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
2003-08-15(ASSORT): New var.Jim Meyering
(all_programs): Use it.
2003-08-01(TESTS_ENVIRONMENT): Set PATH so thatJim Meyering
the tests in help-version will use the just-built binaries.