summaryrefslogtreecommitdiff
path: root/tests/du
AgeCommit message (Collapse)Author
2012-01-09tests: more automated quote adjustmentJim Meyering
Relax initial regexp to match more instances, but add a filter to avoid some invalid conversions. Run this: git grep -l "\`[^']*'" tests | xargs perl -pi -e '$q=q"'\''";' \ -e '$q="$q\\$q$q"; /(= ?\`|\`expr|\`echo|\Q$q\E)/ and next;' \ -e ' s/\`([^'\''"]*?'\'')/'\''$1/g' The last disjunct in the above (...) filter is to exempt any line that contains this string: '\'' With quoting like that, converting a ` to ' is likely to cause trouble, so we'll handle those manually. Here are three examples where the exemption is required: *': `link-to-dir/'\'': hard link not allowed for directory'*) ;; printf 'creating file `%s'\''\n' $f 'mv: inter-device move failed: `%s'\'' to `%s'\'';'\
2012-01-09tests: change `...' to '...' on lines not matching /[=\$]/Jim Meyering
Exempt lines with '$' or '=', since those are prone to improper conversion. Run this: git grep -l "\`[^']*'" tests \ |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g'
2012-01-09tests: adjust \`...' quoting to '...' to adapt to latest gnulibJim Meyering
Run this: git grep -l "\\\\\`[^']*'" tests \ |xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g
2012-01-07maint: update quoting of "Try `prog --help'" to "Try 'prog --help'"Jim Meyering
Automatically adjust both the source (now in only one place) and all tests that expect the resulting output via this: git grep -l 'Try.*--help' src/system.h tests \ | xargs perl -pi -e 's/Try \\?`(\S+ --help)/Try '\''$1/'
2012-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2011-12-14du: -x should not count files in other file systemsPaul Eggert
This fixes Bug#10293, which I guess was introduced in commit 95c948b06a dated 2003-10-02. * NEWS: Document fix. * src/du.c (process_file): Don't count files in different file systems if -x is given. * tests/du/one-file-system: Test for this bug.
2011-11-22tests: use "compare exp out", not "compare out exp"Jim Meyering
Likewise, when an empty file is expected, use "compare /dev/null out", not "compare out /dev/null". I.e., specify the expected/desired contents via the first file name. Prompted by a suggestion from Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154 Run these commands: git grep -l -E 'compare [^ ]+ exp' \ |xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/' git grep -l -E 'compare [^ ]+ /dev/null' \ |xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/' * tests/chgrp/no-x: As above. * tests/chmod/no-x: Likewise. * tests/chmod/silent: Likewise. * tests/chmod/thru-dangling: Likewise. * tests/chown/basic: Likewise. * tests/chown/deref: Likewise. * tests/chown/preserve-root: Likewise. * tests/cp/abuse: Likewise. * tests/cp/backup-is-src: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/fail-perm: Likewise. * tests/cp/into-self: Likewise. * tests/cp/proc-zero-len: Likewise. * tests/cp/src-base-dot: Likewise. * tests/cp/thru-dangling: Likewise. * tests/dd/reblock: Likewise. * tests/dd/unblock-sync: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/basic: Likewise. * tests/du/bigtime: Likewise. * tests/du/deref-args: Likewise. * tests/du/exclude: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/hard-link: Likewise. * tests/du/inacc-dest: Likewise. * tests/du/inacc-dir: Likewise. * tests/du/long-sloop: Likewise. * tests/du/max-depth: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/du/no-deref: Likewise. * tests/du/no-x: Likewise. * tests/du/one-file-system: Likewise. * tests/du/slash: Likewise. * tests/du/trailing-slash: Likewise. * tests/install/strip-program: Likewise. * tests/ln/hard-backup: Likewise. * tests/ls/block-size: Likewise. * tests/ls/color-clear-to-eol: Likewise. * tests/ls/color-dtype-dir: Likewise. * tests/ls/color-norm: Likewise. * tests/ls/dangle: Likewise. * tests/ls/dired: Likewise. * tests/ls/file-type: Likewise. * tests/ls/follow-slink: Likewise. * tests/ls/infloop: Likewise. * tests/ls/m-option: Likewise. * tests/ls/no-arg: Likewise. * tests/ls/recursive: Likewise. * tests/ls/rt-1: Likewise. * tests/ls/stat-dtype: Likewise. * tests/ls/stat-failed: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/ls/x-option: Likewise. * tests/misc/arch: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/chcon: Likewise. * tests/misc/csplit: Likewise. * tests/misc/df-P: Likewise. * tests/misc/fmt-long-line: Likewise. * tests/misc/groups-dash: Likewise. * tests/misc/groups-version: Likewise. * tests/misc/head-pos: Likewise. * tests/misc/nl: Likewise. * tests/misc/od-N: Likewise. * tests/misc/od-multiple-t: Likewise. * tests/misc/od-x8: Likewise. * tests/misc/printf: Likewise. * tests/misc/printf-hex: Likewise. * tests/misc/pwd-option: Likewise. * tests/misc/readlink-fp-loop: Likewise. * tests/misc/runcon-no-reorder: Likewise. * tests/misc/seq-long-double: Likewise. * tests/misc/sort-NaN-infloop: Likewise. * tests/misc/sort-benchmark-random: Likewise. * tests/misc/sort-debug-keys: Likewise. * tests/misc/sort-float: Likewise. * tests/misc/sort-merge-fdlimit: Likewise. * tests/misc/sort-unique-segv: Likewise. * tests/misc/stat-hyphen: Likewise. * tests/misc/stat-slash: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/sum-sysv: Likewise. * tests/misc/tac-2-nonseekable: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/tr-case-class: Likewise. * tests/misc/truncate-fail-diag: Likewise. * tests/misc/wc-files0: Likewise. * tests/mkdir/selinux: Likewise. * tests/mv/backup-dir: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/dir2dir: Likewise. * tests/mv/dup-source: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-verbose: Likewise. * tests/mv/i-link-no: Likewise. * tests/mv/into-self: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/perm-1: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/trailing-slash: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/rm/cycle: Likewise. * tests/rm/dir-no-w: Likewise. * tests/rm/dir-nonrecur: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/fail-eacces: Likewise. * tests/rm/i-never: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/interactive-always: Likewise. * tests/rm/interactive-once: Likewise. * tests/rm/isatty: Likewise. * tests/rm/one-file-system: Likewise. * tests/rm/rm3: Likewise. * tests/rm/rm5: Likewise. * tests/rm/unread2: Likewise. * tests/rm/v-slash: Likewise. * tests/sample-test: Likewise. * tests/split/b-chunk: Likewise. * tests/split/fail: Likewise. * tests/split/l-chunk: Likewise. * tests/split/lines: Likewise. * tests/split/r-chunk: Likewise. * tests/split/suffix-length: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/follow-name: Likewise. * tests/tail-2/follow-stdin: Likewise. * tests/tail-2/pipe-f: Likewise. * tests/tail-2/pipe-f2: Likewise. * tests/tail-2/start-middle: Likewise. * tests/touch/60-seconds: Likewise. * tests/touch/fail-diag: Likewise. * tests/touch/not-owner: Likewise. * tests/touch/relative: Likewise.
2011-11-13tests: avoid rare fp failure in du/move-dir-while-traversingNix
* tests/du/move-dir-while-traversing: Boost the mkdir iteration count yet again.
2011-08-08tests: avoid lack-of-support du test failure on HP-UX 11.31Jim Meyering
* tests/du/inaccessible-cwd: Skip this test on systems like HP-UX 11.31 that lack both the *at functions and the /proc/self/fd-based support we might have used to emulate them. Reported by Bruno Haible in http://debbugs.gnu.org/8846
2011-08-08tests: complete the renaming framework_failure -> framework_failure_Stefano Lattarini
These changes were mostly mechanical, made by running the following command: git grep -lw framework_failure | grep -v ChangeLog \ | xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/' and then editing init.cfg and `tests/cp/cp-a-selinux' by hand. * tests/init.cfg (framework_failure): Remove, `framework_failure_' from init.sh should be used instead in the tests. Remove now-obsolete "FIXME" comment. (is_local_dir_, require_strace_, require_membership_in_two_groups_, require_sparse_support_, skip_if_mcstransd_is_running_, mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'. * Many test scripts: Likewise.
2011-06-17tests: remove skip_test_ function; use new skip_ insteadJim Meyering
* tests/init.cfg (skip_test_): Remove function. Use skip_ in place of skip_test_ everywhere else. * cfg.mk (sc_prohibit_skip_): Remove rule. * tests/**: Use skip_, not skip_test_, everywhere.
2011-05-13maint: avoid syntax-check failure due to long lineJim Meyering
* tests/du/bigtime (future_time): Split long line.
2011-05-13tests: use skip_test_, not skip_Jim Meyering
skip_test_ emits its diagnostic both to FD 9 (tty), and to FD 2 (usually the log file), whereas init.sh's skip_ emits only to FD 9. Without that, the log is slightly less useful. * tests/cp/fiemap-2: Use skip_test_, not skip_. * tests/cp/fiemap-perf: Likewise. * tests/du/bigtime: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/init.sh: Likewise. * tests/misc/sort-stale-thread-mem: Likewise. * tests/misc/stat-nanoseconds: Likewise. * tests/mv/i-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/split/filter: Likewise. Prompted by a report from Pádraig Brady.
2011-03-03du: don't infloop for --files0-from=DIRJim Meyering
* src/du.c (main): Fail on AI_ERR_READ error, rather than merely diagnosing and continuing. Based on a patch by Stefan Vargyas. Also move the handling of AI_ERR_EOF into the case stmt. Do not report ferror/fclose(stdin) failure when we've already diagnosed e.g., failure to read the DIR, above. Bug introduced by 2008-11-24 commit 031e2fb5, "du: read and process --files0-from= input a name at a time,". * src/wc.c: Handle read failure as with du: do not exit immediately, but rather go on to print any total and to clean-up. As above, move the handling of AI_ERR_EOF into the case stmt. * tests/du/files0-from-dir: New file, to test both du and wc. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
2011-01-25tests: minor correctionAndreas Schwab
* tests/du/move-dir-while-traversing: Ignoring SIGTSTP is enough; don't also attempt to ignore SIGSTOP, it cannot be handled or ignored. Spotted by Andreas Schwab.
2011-01-25tests: avoid FP failure due to suspensionJim Meyering
* tests/du/move-dir-while-traversing: Prohibit suspension, to avoid false-positive failure.
2011-01-25tests: avoid rare FP failure in new du testJim Meyering
* tests/du/move-dir-while-traversing: Create an even larger tree to avoid a false-positive failure due to du terminating before the rename is triggered.
2011-01-18tests: avoid FP failure in new du testJim Meyering
* tests/du/move-dir-while-traversing: Create a larger tree to avoid a false-positive failure due to du terminating before the rename is triggered.
2011-01-10du: don't abort when a subdir is renamed during traversalJim Meyering
* NEWS (Bug fixes): Mention it. * src/du.c (prev_level): Move declaration "up" to file-scope global. (du_files): Reset prev_level to 0 upon abnormal fts_read termination. Reported by Johathan Nieder in http://bugs.debian.org/609049 Also, improve a diagnostic. * tests/du/move-dir-while-traversing: Test for the above. * tests/Makefile.am (TESTS): Add it.
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-12-28coreutils: keep lines within 80-column limitsPaul Eggert
* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros. (sc_long_lines): New rule. * HACKING: Use shorter URLs to the same material. * doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4: * man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c: * src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c: * src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c: * src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c: * src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm: * tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid: * tests/du/2g, tests/du/long-from-unreadable, tests/init.sh: * tests/install/basic-1, tests/ls/nameless-uid: * tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials: * tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum: * tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort: * tests/misc/sort-continue, tests/misc/sort-files0-from: * tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr: * tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail: * tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests: * tests/rm/fail-2eperm, tests/rm/interactive-always: Reformat to fit within 80 columns. * doc/Makefile.am (BAD_POSIX_PERL): New macro. * doc/coreutils.texi: Reword slightly, to make menus and index lines shorter. * src/md5sum.c: Redo --help output so that it fits within 79 columns, since that's a bit more portable and all the other --help strings fit in 79 columns.
2010-12-18tests: avoid spurious du/bigtime failureJim Meyering
* tests/du/bigtime: Map nonzero block count to 0. Reported by Assaf Gordon. * THANKS: Update.
2010-11-17tests: substitute the single-program $VERBOSE/--version usesJim Meyering
Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
2010-11-17tests: convert first batch of tests from test-lib.sh to init.shJim Meyering
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
2010-10-23du: don't print junk when diagnosing out-of-range time stampsPaul Eggert
* src/du.c (show_date): Fix call to fputs with a buffer that contains some uninitialized data. * tests/Makefile.am (TESTS): Add du/big-timestamp. * tests/du/bigtime: New file, which checks for the bug.
2010-09-07tests: exclude some tests when running on NFSPádraig Brady
All tests currently pass on NFS on Linux kernel 2.6.22 at least, but some fail on 2.6.9, so we exclude those here. * tests/init.cfg (is_local_dir_): A new function returning if the specified directory is on a local file system. (require_local_dir_): A new function to skip tests if the current directory is not on a local file system. * tests/cp/existing-perm-race: Skip if non local. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/preserve-2: Likewise. * tests/mv/part-symlink: Likewise. * tests/du/basic: Use refactored function. * tests/install/basic-1: Likewise. * tests/mkdir/p-3: Likewise. * tests/dd/skip-seek-past-dev: Likewise. * tests/du/slink: Likewise. Remove redundant test for NFS file system. * tests/misc/join: s/local/locale/.
2010-07-24du: tune, and fix some -L bugs with dangling or cyclic symlinksPaul R. Eggert
* src/du.c (process_file): Avoid recalculation of hashes and of file-exclusion for directories. Do not descend into the same directory more than once, unless -l is given; this is faster. Calculate stat buffer lazily, since it need not be computed at all for excluded files. Count space if FTS_ERR, since stat buffer is always valid then. No need for 'print' local variable. (main): Use FTS_NOSTAT. Use FTS_TIGHT_CYCLE_CHECK only when not hashing everything, since process_file finds cycles on its own when hashing everything. * tests/du/deref: Add test cases for -L bugs.
2010-07-03du: don't miscount duplicate directories or link-count-1 filesPaul Eggert
* NEWS: Mention this. * src/du.c (hash_all): New static var. (process_file): Use it. (main): Set it. * tests/du/hard-link: Add a couple of test cases to help make sure this bug stays squashed. * tests/du/files0-from: Adjust existing tests to reflect change in semantics with duplicate arguments.
2010-05-19du: recognize -d N as equivalent to --max-depth=NJon Ringuette
* NEWS (New features): Mention it. * src/du.c (DEBUG_OPT): Remove. Use long-named ---debug instead. Commented out. (MAX_DEPTH_OPTION): Remove. Use 'd' instead. (main): Insert literal "d:"; remove DEBUG_OPT. * doc/coreutils.texi (du invocation): Add -d to indices. * tests/du/max-depth: Exercise -d, too.
2010-05-19tests: exercise du's --max-depth optionJim Meyering
* tests/Makefile.am (TESTS): Add du/max-depth. * tests/du/max-depth: New file.
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-10-30tests: factor 350 fail=0 initializations into test-lib.shJim Meyering
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2008-09-10tests: use "Exit $fail", not (exit $fail); exit $failJim Meyering
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63 * tests/**: Convert all uses: This restrictive change converted the vast majority: git grep -l '^(exit \$fail); exit \$fail$' \ | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/' And this did the rest, plus a few undesirable ones, so I manually backed out the changes to ChangeLog-* and build-aux/check.mk: git grep -l -E '\(exit [^)]+\); exit ' \ | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
2008-06-08standardize some error messagesBo Borgerson
* maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase): (sc_error_message_period): Add automatic checks for non-standard error messages. * .x-sc_error_message_uppercase: explicit exclusion for this check * src/cp.c: Standardize some error messages. * src/date.c: Likewise. * src/dircolors.c: Likewise. * src/du.c: Likewise. * src/expr.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/ln.c: Likewise. * src/mv.c: Likewise. * src/od.c: Likewise. * src/pr.c: Likewise. * src/split.c: Likewise. * src/truncate.c: Likewise. * src/wc.c: Likewise. * tests/du/files0-from: Expect new error message. * tests/misc/join: Likewise. * tests/misc/split-a: Likewise. * tests/misc/wc-files0-from: Likewise. * tests/misc/xstrtol: Likewise. * lib/xmemxfrm.c: Likewise.
2008-05-27in 280+ tests/* files, use $srcdir, not $top_srcdir/testsJim Meyering
2008-05-17tests: sync and update wc and du --files0-from testsJim Meyering
* tests/du/files0-from: Sync from tests/misc/wc-files0-from. (minus-in-minus): New test. Adjust for new diagnostics. * tests/misc/wc-files0-from: Adjust for new diagnostics.
2008-05-17tests: remove ugly /bin/sh wrapper around each perl-based test scriptJim Meyering
* tests/check.mk (TESTS_ENVIRONMENT): Save and restore TMPDIR around envvar-check, so that the few scripts that require $TMPDIR don't fail. This is also good to let a user's default TMPDIR setting be used e.g., in the search for an 'other-partition'. FIXME: this is pretty ugly. maybe undo it and find a better way. (TESTS_ENVIRONMENT): Invoke perl scripts with $(PERL), and use -T if the script requires that. Otherwise, use $(SHELL). * tests/misc/md5sum-newline: Create a file whose name contains a newline in Perl (resort to using "system", since open refuses). Fix old brokenness exposed by this change: * tests/du/files0-from: Correct test not to rely on stdin being attached to a non-tty. * tests/misc/sort (3g, 3h, 3i): Likewise: add explicit empty input file. Avoid warnings about using qw()-around-commas. * tests/rm/fail-eperm: Now that this test is run from a temporary subdirectory, adjust the full name of the "rm" program we're going to run. Change #!/bin/sh to #!/usr/bin/perl, and factor out the few lines of boilerplate code to invoke perl. Do not "require 5.00x"; a configure-time Perl test handles that * tests/dd/skip-seek: * tests/misc/base64: * tests/misc/basename: * tests/misc/cut: * tests/misc/date: * tests/misc/dircolors: * tests/misc/dirname: * tests/misc/expand: * tests/misc/expr: * tests/misc/factor: * tests/misc/fmt: * tests/misc/fold: * tests/misc/head: * tests/misc/head-elide-tail: * tests/misc/join: * tests/misc/ls-misc: * tests/misc/md5sum: * tests/misc/md5sum-newline: * tests/misc/mktemp: * tests/misc/od: * tests/misc/paste: * tests/misc/pr: * tests/misc/printf-cov: * tests/misc/seq: * tests/misc/sha1sum: * tests/misc/sha1sum-vec: * tests/misc/sha224sum: * tests/misc/sha256sum: * tests/misc/sha384sum: * tests/misc/sha512sum: * tests/misc/sort-merge: * tests/misc/stat-printf: * tests/misc/sum: * tests/misc/tac: * tests/misc/tail: * tests/misc/test: * tests/misc/test-diag: * tests/misc/tr: * tests/misc/tsort: * tests/misc/tty-eof: * tests/misc/unexpand: * tests/misc/uniq: * tests/misc/wc: * tests/misc/wc-files0-from: * tests/misc/xstrtol: * tests/mv/i-1: * tests/pr/pr-tests: * tests/rm/empty-name: * tests/rm/fail-eperm: * tests/rm/unreadable:
2008-05-06tests: move "sparse-file" into test-lib.shJim Meyering
* tests/sparse-file: Remove file Move contents into ... * tests/test-lib.sh (require_sparse_support_): ...here. New function. * tests/cp/sparse: Use the function, not the file. * tests/du/8gb: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove sparse-file.
2008-05-06tests: hoist the sourcing of "lang-default"Jim Meyering
* tests/check.mk (TESTS_ENVIRONMENT): Source lang-default here, ... ... rather than in each of 100+ test scripts. * tests/chgrp/basic: * tests/chgrp/no-x: * tests/chmod/c-option: * tests/chmod/no-x: * tests/chmod/setgid: * tests/chmod/thru-dangling: * tests/chmod/umask-x: * tests/chmod/usage: * tests/chown/basic: * tests/chown/deref: * tests/chown/preserve-root: * tests/cp/abuse: * tests/cp/acl: * tests/cp/backup-is-src: * tests/cp/cp-a-selinux: * tests/cp/cp-i: * tests/cp/cp-mv-backup: * tests/cp/deref-slink: * tests/cp/fail-perm: * tests/cp/into-self: * tests/cp/link-preserve: * tests/cp/preserve-gid: * tests/cp/same-file: * tests/cp/slink-2-slink: * tests/cp/special-f: * tests/cp/symlink-slash: * tests/cp/thru-dangling: * tests/du/basic: * tests/du/hard-link: * tests/du/inacc-dest: * tests/du/long-sloop: * tests/du/no-x: * tests/install/basic-1: * tests/ln/hard-backup: * tests/ln/sf-1: * tests/ls/file-type: * tests/ls/infloop: * tests/ls/nameless-uid: * tests/ls/rt-1: * tests/ls/stat-failed: * tests/ls/symlink-slash: * tests/ls/x-option: * tests/misc/chcon: * tests/misc/chcon-fail: * tests/misc/csplit: * tests/misc/df-P: * tests/misc/groups-dash: * tests/misc/groups-version: * tests/misc/nohup: * tests/misc/printf-surprise: * tests/misc/runcon-no-reorder: * tests/misc/selinux: * tests/misc/split-a: * tests/misc/split-fail: * tests/misc/tac-continue: * tests/misc/wc-files0: * tests/mkdir/p-v: * tests/mkdir/selinux: * tests/mv/acl: * tests/mv/backup-dir: * tests/mv/backup-is-src: * tests/mv/childproof: * tests/mv/diag: * tests/mv/dir2dir: * tests/mv/dup-source: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/hard-verbose: * tests/mv/i-2: * tests/mv/i-3: * tests/mv/i-4: * tests/mv/i-5: * tests/mv/i-link-no: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/mv-special-1: * tests/mv/part-fail: * tests/mv/part-symlink: * tests/mv/partition-perm: * tests/mv/perm-1: * tests/mv/reply-no: * tests/mv/sticky-to-xpart: * tests/mv/update: * tests/rm/cycle: * tests/rm/dir-no-w: * tests/rm/dir-nonrecur: * tests/rm/fail-2eperm: * tests/rm/fail-eacces: * tests/rm/inaccessible: * tests/rm/interactive-always: * tests/rm/interactive-once: * tests/rm/isatty: * tests/rm/one-file-system: * tests/rm/r-1: * tests/rm/r-2: * tests/rm/rm1: * tests/rm/rm2: * tests/rm/rm3: * tests/rm/rm4: * tests/rm/rm5: * tests/rm/unread2: * tests/rm/v-slash: * tests/touch/fail-diag: * tests/touch/not-owner:
2008-05-06tests: hoist envvar-check so it is run for every testJim Meyering
I.e., also for Perl-based tests; not just the ones using test-lib.sh. * tests/check.mk (TESTS_ENVIRONMENT): Source envvar-check here, ... * tests/test-lib.sh: ...not here.
2008-05-06fix typo in comments: s/ouput/output/Jim Meyering
adjust spelling in that same comment: s/localisation/localization/
2008-04-27tests: move another file (expensive) into test-lib.shJim Meyering
* tests/expensive: Remove file. Move contents into ... * tests/test-lib.sh (expensive_): ...here. New function. * tests/du/fd-leak: Update caller to use the new function. * tests/mv/leak-fd: Likewise. * tests/rm/hash: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove its name.
2008-04-21tests: adjust perl -I to use $top_srcdir/tests, not $srcdir/..Jim Meyering
2008-04-21Revamp test-related Makefiles.Jim Meyering
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.
2008-02-23Avoid test failures when root (/) is not readable.Jim Meyering
* tests/test-lib.sh (require_readable_root_): New function. * tests/misc/pwd-long: Skip this test when / is unreadable. * tests/du/slash: Likewise. This is required at least for Mandrake/Mandriva in "secure" mode. Reported by Theodoros V. Kalamatianos in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12800
2008-02-09tests: factor out the perl-requiring code in many test scriptsJim Meyering
* 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.
2008-02-09tests: call skip_test_ in place of echo+exit 77Jim Meyering
* tests/mv/no-target-dir: Likewise. * tests/other-fs-tmpdir: Likewise. * tests/rm/empty-name: Likewise. * tests/rm/fail-eperm: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/isatty: Likewise. * tests/rm/unreadable: Likewise. * tests/setgid-check: Likewise. * tests/sparse-file: Likewise. * tests/strace: Likewise. * tests/tail-2/append-only: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/tail-n0f: Likewise. * tests/touch/dangling-symlink: Likewise. * tests/touch/fifo: Likewise. * tests/touch/not-owner: Likewise. * tests/mv/i-3: Likewise. * tests/umask-check: Likewise. * tests/mv/acl: Likewise. * tests/cp/acl: Likewise. * tests/chgrp/deref: Likewise. * tests/chmod/setgid: Likewise. * tests/cp/existing-perm-race: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/long-from-unreadable: Likewise. * tests/du/long-sloop: Likewise. * tests/du/slink: Likewise. * tests/ls/nameless-uid: Likewise. * tests/ls/stat-dtype: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/md5sum-newline: Likewise. * tests/misc/nice: Likewise. * tests/misc/od-x8: Likewise. * tests/misc/pwd-unreadable-parent: Likewise. * tests/misc/selinux: Likewise. * tests/misc/stty-row-col: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before* the use of skip_test_.
2008-02-09tests: move the very-expensive file into test-lib.shJim Meyering
* tests/very-expensive: Remove file. * tests/test-lib.sh (very_expensive_): New function. * tests/Makefile.am (EXTRA_DIST): Remove very-expensive. * tests/cp/perm: Call the new function, rather than sourcing the file. * tests/tail-2/assert: Likewise. * tests/tail-2/assert-2: Likewise. * tests/du/2g: Likewise.