1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 10:15:48 +02:00
Files
coreutils/tests/Makefile.am

86 lines
2.2 KiB
Makefile
Raw Normal View History

2002-07-01 09:24:34 +00:00
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
# Sort in traditional ASCII order, regardless of the current locale;
# otherwise we may get into trouble with distinct strings that the
# current locale considers to be equal.
ASSORT = LC_ALL=C sort
EXTRA_DIST = \
Coreutils.pm \
CuTmpdir.pm \
Makefile.am.in \
README \
check.mk \
envvar-check \
expensive \
group-names \
input-tty \
lang-default \
mk-script \
other-fs-tmpdir \
tests: factor out the perl-requiring code in many test scripts * tests/require-perl: New file. * tests/Makefile.am (EXTRA_DIST): Add require-perl. * tests/dd/skip-seek: Use it, and remove manual tests. * tests/du/files0-from: Likewise. * tests/ls/nameless-uid: Likewise. * tests/misc/base64: Likewise. * tests/misc/basename: Likewise. * tests/misc/cut: Likewise. * tests/misc/date: Likewise. * tests/misc/dircolors: Likewise. * tests/misc/dirname: Likewise. * tests/misc/expand: Likewise. * tests/misc/expr: Likewise. * tests/misc/factor: Likewise. * tests/misc/fmt: Likewise. * tests/misc/fold: Likewise. * tests/misc/head-elide-tail: Likewise. * tests/misc/ls-misc: Likewise. * tests/misc/md5sum: Likewise. * tests/misc/md5sum-newline: Likewise. * tests/misc/mktemp: Likewise. * tests/misc/od: Likewise. * tests/misc/paste-no-nl: Likewise. * tests/misc/pr: Likewise. * tests/misc/pwd-long: Likewise. * tests/misc/seq: Likewise. * tests/misc/sha1sum: Likewise. * tests/misc/sha1sum-vec: Likewise. * tests/misc/sha224sum: Likewise. * tests/misc/sha256sum: Likewise. * tests/misc/sha384sum: Likewise. * tests/misc/sha512sum: Likewise. * tests/misc/sort-merge: Likewise. * tests/misc/stat-printf: Likewise. * tests/misc/sum: Likewise. * tests/misc/sum-sysv: Likewise. * tests/misc/test-diag: Likewise. * tests/misc/tsort: Likewise. * tests/misc/tty-eof: Likewise. * tests/misc/unexpand: Likewise. * tests/misc/wc-files0-from: Likewise. * tests/misc/xstrtol: Likewise. * tests/mv/i-1: Likewise. * tests/rm/empty-name: Likewise. * tests/rm/fail-eperm: Likewise. * tests/rm/unreadable: Likewise. (EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script.
2007-12-06 14:21:51 +01:00
require-perl \
rwx-to-mode \
sample-test \
setgid-check \
sparse-file \
test-lib.sh \
umask-check
2002-07-01 09:24:34 +00:00
# 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/.
2002-07-01 09:24:34 +00:00
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
## N O T E :: Please do not add new directories.
2002-07-01 09:24:34 +00:00
all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9 ta tb tc td
.PHONY: check-root $(all_t)
check-root: $(all_t)
t1:
2002-07-01 09:24:34 +00:00
cd chown && $(MAKE) check TESTS=basic
t2:
2002-07-01 09:24:34 +00:00
cd cp && $(MAKE) check TESTS=special-bits
t3:
2005-01-04 09:41:14 +00:00
cd rm && $(MAKE) check TESTS=no-give-up
t4:
2003-03-04 19:50:23 +00:00
cd rm && $(MAKE) check TESTS=fail-2eperm
t5:
2006-01-24 22:54:49 +00:00
cd tail-2 && $(MAKE) check TESTS=append-only
t6:
cd rm && $(MAKE) check TESTS=one-file-system
t7:
cd ls && $(MAKE) check TESTS=nameless-uid
ls: Add support for SELinux and a slightly modified -Z option. 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-05 18:23:54 +01:00
t8:
cd misc && $(MAKE) check TESTS=chcon
t9:
cd cp && $(MAKE) check TESTS=cp-a-selinux
ta:
cd mkdir && $(MAKE) check TESTS=writable-under-readonly
tb:
cd mv && $(MAKE) check TESTS=sticky-to-xpart
tc:
cd cp && $(MAKE) check TESTS=preserve-gid
td:
cd touch && $(MAKE) check TESTS=now-owned-by-other
2002-07-01 09:24:34 +00:00
check-recursive: root-hint
2002-07-01 09:24:34 +00:00
# Advertise `check-root' target.
.PHONY: root-hint
2002-07-01 09:24:34 +00:00
root-hint:
2003-12-20 11:32:32 +00:00
@echo '***********************************************************'
@echo "NOTICE: Some tests may be run only as root."
@echo " Do \`make check-root' as \`root' to run these tests."
@echo '***********************************************************'