From 512e111a926fedbd7dc7b0875ab837dbb7d2a7a6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 17 Apr 2008 23:34:45 +0200 Subject: Revamp test-related Makefiles. One side-effect of this change is that "make check" now works even if you put "." early in your shell's search PATH (don't do that!). Remove all test-related Makefile.am files, except those generated by mk-script. Instead, tests/Makefile.am now lists not only the tests directly under tests/, but also those in tests/*/ that are not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. A lot of these changes are like this: -. $srcdir/../lang-default +. $top_srcdir/tests/lang-default -. $srcdir/../test-lib.sh +. $top_srcdir/tests/test-lib.sh * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. * tests/rwx-to-mode: Remove file. Rewritten as... * tests/test-lib.sh (rwx_to_mode_): ...this new function. * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. (SUBDIRS): Remove each dir with a removed Makefile.am. (EXTRA_DIST): Add $(TESTS). (TESTS): Add over 300 entries. --- tests/Makefile.am | 382 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 355 insertions(+), 27 deletions(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index c74c0a183..8893f74bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,28 +19,15 @@ EXTRA_DIST = \ mk-script \ other-fs-tmpdir \ require-perl \ - rwx-to-mode \ sample-test \ setgid-check \ sparse-file \ test-lib.sh \ umask-check -# Regarding ordering in SUBDIRS, place early in the list the tools that -# are most commonly used in test scripts. Every test script uses rm -# and chmod, so they have to be very early. -# Ordering within misc/ should handle the rest. - ## N O T E :: Please do not add new tests/ directories. ## There are too many already. Put new tests in misc/. -SUBDIRS = \ - rm \ - chmod \ - misc \ - chgrp chown cp cut dd du head \ - install join ln ls mkdir mv pr readlink rmdir \ - sort tac tail tail-2 test touch tr \ - uniq wc +SUBDIRS = cut head join pr sort tac tail test tr uniq wc ## N O T E :: Please do not add new directories. all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9 ta tb tc td @@ -48,31 +35,31 @@ all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9 ta tb tc td check-root: $(all_t) t1: - cd chown && $(MAKE) check TESTS=basic + $(MAKE) check TESTS=chown/basic t2: - cd cp && $(MAKE) check TESTS=special-bits + $(MAKE) check TESTS=cp/special-bits t3: - cd rm && $(MAKE) check TESTS=no-give-up + $(MAKE) check TESTS=rm/no-give-up t4: - cd rm && $(MAKE) check TESTS=fail-2eperm + $(MAKE) check TESTS=rm/fail-2eperm t5: - cd tail-2 && $(MAKE) check TESTS=append-only + $(MAKE) check TESTS=tail-2/append-only t6: - cd rm && $(MAKE) check TESTS=one-file-system + $(MAKE) check TESTS=rm/one-file-system t7: - cd ls && $(MAKE) check TESTS=nameless-uid + $(MAKE) check TESTS=ls/nameless-uid t8: - cd misc && $(MAKE) check TESTS=chcon + $(MAKE) check TESTS=misc/chcon t9: - cd cp && $(MAKE) check TESTS=cp-a-selinux + $(MAKE) check TESTS=cp/cp-a-selinux ta: - cd mkdir && $(MAKE) check TESTS=writable-under-readonly + $(MAKE) check TESTS=mkdir/writable-under-readonly tb: - cd mv && $(MAKE) check TESTS=sticky-to-xpart + $(MAKE) check TESTS=mv/sticky-to-xpart tc: - cd cp && $(MAKE) check TESTS=preserve-gid + $(MAKE) check TESTS=cp/preserve-gid td: - cd touch && $(MAKE) check TESTS=now-owned-by-other + $(MAKE) check TESTS=touch/now-owned-by-other check-recursive: root-hint @@ -83,3 +70,344 @@ root-hint: @echo "NOTICE: Some tests may be run only as root." @echo " Do \`make check-root' as \`root' to run these tests." @echo '***********************************************************' + +EXTRA_DIST += $(TESTS) + +# Do not choose a name that is a shell keyword like 'if', or a +# commonly-used utility like 'cat' or 'test', as the name of a test. +# Otherwise, VPATH builds will fail on hosts like Solaris, since they +# will expand 'if test ...' to 'if .../test ...', and the '.../test' +# will execute the test script rather than the standard utility. + +# Regarding ordering in SUBDIRS, place early in the list the tools that +# are most commonly used in test scripts. Every test script uses rm +# and chmod, so they have to be very early. +# Ordering within misc/ should handle the rest. + +# Ordering: +# help-version comes early because it's a basic sanity test. +# Put seq early, since lots of other tests use it. +# Put head-elide-tail early, because it's long-running. + +TESTS = \ + misc/help-version \ + chgrp/basic \ + rm/cycle \ + rm/dangling-symlink \ + rm/deep-1 \ + rm/deep-2 \ + rm/dir-no-w \ + rm/dir-nonrecur \ + rm/dot-rel \ + rm/empty-inacc \ + rm/empty-name \ + rm/f-1 \ + rm/fail-2eperm \ + rm/fail-eacces \ + rm/fail-eperm \ + rm/hash \ + rm/i-1 \ + rm/i-never \ + rm/i-no-r \ + rm/ignorable \ + rm/inaccessible \ + rm/interactive-always \ + rm/interactive-once \ + rm/ir-1 \ + rm/isatty \ + rm/no-give-up \ + rm/one-file-system \ + rm/r-1 \ + rm/r-2 \ + rm/r-3 \ + rm/r-4 \ + rm/readdir-bug \ + rm/rm1 \ + rm/rm2 \ + rm/rm3 \ + rm/rm4 \ + rm/rm5 \ + rm/sunos-1 \ + rm/unread2 \ + rm/unread3 \ + rm/unreadable \ + rm/v-slash \ + chgrp/default-no-deref \ + chgrp/deref \ + chgrp/no-x \ + chgrp/posix-H \ + chgrp/recurse \ + misc/seq \ + misc/head-elide-tail \ + misc/ls-time \ + misc/ls-misc \ + misc/date \ + misc/ptx-overrun \ + misc/xstrtol \ + misc/od \ + misc/mktemp \ + misc/arch \ + misc/pr \ + misc/df-P \ + misc/pwd-unreadable-parent \ + misc/chcon \ + misc/chcon-fail \ + misc/selinux \ + misc/cut \ + misc/wc-files0-from \ + misc/wc-files0 \ + misc/cat-proc \ + misc/base64 \ + misc/basename \ + misc/close-stdout \ + misc/csplit \ + misc/date-sec \ + misc/dircolors \ + misc/df \ + misc/dirname \ + misc/expand \ + misc/expr \ + misc/factor \ + misc/false-status \ + misc/fmt \ + misc/fmt-long-line \ + misc/fold \ + misc/groups-dash \ + misc/groups-version \ + misc/head-c \ + misc/head-pos \ + misc/md5sum \ + misc/md5sum-newline \ + misc/mknod \ + misc/nice \ + misc/nl \ + misc/nohup \ + misc/od-N \ + misc/od-x8 \ + misc/paste \ + misc/pathchk1 \ + misc/printf \ + misc/printf-hex \ + misc/printf-surprise \ + misc/pwd-long \ + misc/readlink-fp-loop \ + misc/runcon-no-reorder \ + misc/sha1sum \ + misc/sha1sum-vec \ + misc/sha224sum \ + misc/sha256sum \ + misc/sha384sum \ + misc/sha512sum \ + misc/shred-exact \ + misc/shred-remove \ + misc/shuf \ + misc/sort-compress \ + misc/sort-merge \ + misc/sort-rand \ + misc/split-a \ + misc/split-fail \ + misc/split-l \ + misc/stat-fmt \ + misc/stat-printf \ + misc/stty \ + misc/stty-invalid \ + misc/stty-row-col \ + misc/sum \ + misc/sum-sysv \ + misc/tac-continue \ + misc/tee \ + misc/tee-dash \ + misc/test-diag \ + misc/tsort \ + misc/tty-eof \ + misc/unexpand \ + chmod/c-option \ + chmod/equal-x \ + chmod/equals \ + chmod/inaccessible \ + chmod/no-x \ + chmod/octal \ + chmod/setgid \ + chmod/thru-dangling \ + chmod/umask-x \ + chmod/usage \ + chown/basic \ + chown/deref \ + chown/preserve-root \ + chown/separator \ + cp/abuse \ + cp/acl \ + cp/backup-1 \ + cp/backup-dir \ + cp/backup-is-src \ + cp/cp-HL \ + cp/cp-a-selinux \ + cp/cp-deref \ + cp/cp-i \ + cp/cp-mv-backup \ + cp/cp-parents \ + cp/deref-slink \ + cp/dir-rm-dest \ + cp/dir-slash \ + cp/dir-vs-file \ + cp/existing-perm-race \ + cp/fail-perm \ + cp/file-perm-race \ + cp/into-self \ + cp/link \ + cp/link-no-deref \ + cp/link-preserve \ + cp/no-deref-link1 \ + cp/no-deref-link2 \ + cp/no-deref-link3 \ + cp/parent-perm \ + cp/parent-perm-race \ + cp/perm \ + cp/preserve-2 \ + cp/preserve-gid \ + cp/proc-zero-len \ + cp/r-vs-symlink \ + cp/same-file \ + cp/slink-2-slink \ + cp/sparse \ + cp/special-bits \ + cp/special-f \ + cp/src-base-dot \ + cp/symlink-slash \ + cp/thru-dangling \ + dd/misc \ + dd/not-rewound \ + dd/skip-seek \ + dd/skip-seek2 \ + dd/unblock-sync \ + du/2g \ + du/8gb \ + du/basic \ + du/deref \ + du/deref-args \ + du/exclude \ + du/fd-leak \ + du/files0-from \ + du/hard-link \ + du/inacc-dest \ + du/inacc-dir \ + du/inaccessible-cwd \ + du/long-from-unreadable \ + du/long-sloop \ + du/no-deref \ + du/no-x \ + du/one-file-system \ + du/restore-wd \ + du/slash \ + du/slink \ + du/trailing-slash \ + du/two-args \ + install/basic-1 \ + install/create-leading \ + install/d-slashdot \ + install/trap \ + ln/backup-1 \ + ln/hard-backup \ + ln/misc \ + ln/sf-1 \ + ln/target-1 \ + ls/color-dtype-dir \ + ls/dangle \ + ls/dired \ + ls/file-type \ + ls/follow-slink \ + ls/infloop \ + ls/inode \ + ls/m-option \ + ls/nameless-uid \ + ls/no-arg \ + ls/proc-selinux-segfault \ + ls/recursive \ + ls/rt-1 \ + ls/stat-dtype \ + ls/stat-failed \ + ls/stat-free-symlinks \ + ls/stat-vs-dirent \ + ls/symlink-slash \ + ls/x-option \ + mkdir/p-1 \ + mkdir/p-2 \ + mkdir/p-3 \ + mkdir/p-slashdot \ + mkdir/p-thru-slink \ + mkdir/p-v \ + mkdir/parents \ + mkdir/perm \ + mkdir/selinux \ + mkdir/special-1 \ + mkdir/t-slash \ + mkdir/writable-under-readonly \ + mv/acl \ + mv/atomic \ + mv/atomic2 \ + mv/backup-dir \ + mv/backup-is-src \ + mv/childproof \ + mv/diag \ + mv/dir-file \ + mv/dir2dir \ + mv/dup-source \ + mv/force \ + mv/hard-2 \ + mv/hard-3 \ + mv/hard-4 \ + mv/hard-link-1 \ + mv/hard-verbose \ + mv/i-1 \ + mv/i-2 \ + mv/i-3 \ + mv/i-4 \ + mv/i-5 \ + mv/i-link-no \ + mv/into-self \ + mv/into-self-2 \ + mv/into-self-3 \ + mv/into-self-4 \ + mv/leak-fd \ + mv/mv-special-1 \ + mv/no-target-dir \ + mv/part-fail \ + mv/part-hardlink \ + mv/part-rename \ + mv/part-symlink \ + mv/partition-perm \ + mv/perm-1 \ + mv/reply-no \ + mv/sticky-to-xpart \ + mv/to-symlink \ + mv/trailing-slash \ + mv/update \ + readlink/can-e \ + readlink/can-f \ + readlink/can-m \ + readlink/rl-1 \ + rmdir/fail-perm \ + rmdir/ignore \ + rmdir/t-slash \ + tail-2/append-only \ + tail-2/assert \ + tail-2/assert-2 \ + tail-2/big-4gb \ + tail-2/infloop-1 \ + tail-2/proc-ksyms \ + tail-2/start-middle \ + tail-2/tail-n0f \ + touch/dangling-symlink \ + touch/dir-1 \ + touch/empty-file \ + touch/fail-diag \ + touch/fifo \ + touch/no-create-missing \ + touch/no-rights \ + touch/not-owner \ + touch/now-owned-by-other \ + touch/obsolescent \ + touch/read-only \ + touch/relative + +include $(top_srcdir)/tests/check.mk -- cgit v1.2.3-54-g00ecf