Age | Commit message (Collapse) | Author |
|
Exempt init.sh because it runs before we're assured to have a
shell that groks $(...). Exempt *.mk because "$" would have to
be doubled, and besides, any `...` expression in a .mk file is
almost certainly evaluated before init.sh is run. Finally, also
exempt the perl-based tests, because perl's `...` cannot be
converted to $(...). Do that by running this command:
git grep -l '`.*`' tests \
| grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \
| xargs perl -pi -e 's/`(.*?)`/\$($1)/g'
One minor fix-up change was required after that, due to how
quoting differs:
diff --git a/tests/chmod/equals b/tests/chmod/equals
- expected_perms=$(eval 'echo \$expected_'$dest)
+ expected_perms=$(eval 'echo $expected_'$dest)
Another was to make these required quoting adjustments:
diff --git a/tests/misc/stty b/tests/misc/stty
...
- rev=$(eval echo "\\\$REV_$opt")
+ rev=$(eval echo "\$REV_$opt")
...
- rev1=$(eval echo "\\\$REV_$opt1")
- rev2=$(eval echo "\\\$REV_$opt2")
+ rev1=$(eval echo "\$REV_$opt1")
+ rev2=$(eval echo "\$REV_$opt2")
Also, transform two files that were needlessly excluded above:
(both use perl, but are mostly bourne shell)
perl -pi -e 's/`(.*?)`/\$($1)/g' \
tests/du/long-from-unreadable tests/init.cfg
|
|
Run "make update-copyright".
|
|
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'
|
|
Run "make update-copyright".
|
|
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.
|
|
Those were useful when tests might have been run in the same
directory and in parallel. Now, each test is run in a newly-
created empty directory.
* tests/cp/backup-1: Remove obsolete uses of "$$".
* tests/cp/same-file: Likewise.
* tests/dd/misc: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/to-symlink: Likewise.
* tests/touch/fail-diag: Likewise.
|
|
Run "make update-copyright".
|
|
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/'
|
|
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,"
|
|
* tests/init.cfg: Introduce a retry_delay_() function to
repeatedly call a test function that requires a delay.
This delay can now be shorter for the common case on fast
systems, but will double until a configurable limit it reached
before failing on slower systems.
* tests/dd/reblock: Use retry_delay_.
* tests/misc/cat-buf: Likewise.
* tests/misc/stdbuf: Likewise.
* tests/tail-2/F-vs-rename: Likewise.
* tests/tail-2/flush-initial: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/tail-2/wait: Likewise.
* test/dd/misc: Comment that delay is needed to trigger failure.
|
|
Use this command:
git ls-files | grep -v COPYING \
| xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
build-aux/update-copyright
|
|
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.
|
|
|
|
* 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/'
|
|
* tests/dd/misc: Set LC_ALL=C via env.
* tests/cp/thru-dangling: Set POSIXLY_CORRECT via env.
This is necessary at least on AIX 5.3.
Reported by Jeph Cowan and Ralf Wildenhues. Details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257
|
|
* src/dd.c (O_FULLBLOCK): Define using an enum, not #define.
Derive the value, rather than hard-coding to one that might conflict.
(usage): Mention iflag=fullblock in --help output.
(scanargs): Reset the O_FULLBLOCK bit, so that we don't try to set
an undefined attribute via fcntl (fd, F_SETFL, ...
* tests/dd/misc: Signal framework_failure when necessary.
Use "compare actual expected", so any diffs look "right".
* NEWS (dd): Alphabetize and reword.
* coreutils.texi (dd invocation): Adjust wording.
|
|
* src/dd.c (iread_fullblock): New function for reading full blocks.
(scanargs): Check for new parameter iflag=fullblock.
(skip): Use iread_fnc pointer instead of iread function.
(dd_copy): Use iread_fnc pointer instead of iread function.
* tests/dd/misc: Add test for dd - read full blocks.
* doc/coretuils.texi: Mention new parameter iflag=fullblock.
* NEWS: Mentioned the change.
|
|
|
|
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.
|
|
* lib/fd-reopen.c: Work even if FILE is "/dev/stdin".
Problem reported by Geoffrey Lee in <http://bugs.debian.org/290727>.
* tests/dd/misc: Check for this bug.
|
|
* maint.mk (sc_require_test_exit_idiom): New rule to enforce policy.
* tests/cp/acl: Adhere to the new policy.
* tests/cp/preserve-gid: Likewise.
* tests/dd/misc:
* tests/install/create-leading:
* tests/ln/sf-1:
* tests/ls/symlink-slash:
* tests/misc/help-version:
* tests/misc/ls-time:
* tests/misc/nice:
* tests/misc/shred-remove:
* tests/misc/stty:
* tests/misc/stty-row-col:
* tests/mkdir/p-1:
* tests/mkdir/p-2:
* tests/mkdir/p-3:
* tests/mkdir/p-v:
* tests/mkdir/special-1:
* tests/mkdir/writable-under-readonly:
* tests/mv/acl:
* tests/mv/backup-is-src:
* tests/mv/diag:
* tests/mv/dir-file:
* tests/mv/force:
* tests/mv/hard-link-1:
* tests/mv/i-2:
* tests/mv/i-4:
* tests/mv/into-self:
* tests/mv/into-self-2:
* tests/mv/into-self-3:
* tests/mv/partition-perm:
* tests/mv/to-symlink:
* tests/rmdir/ignore:
* tests/tail-2/assert:
* tests/tail-2/assert-2:
* tests/touch/dangling-symlink:
* tests/touch/dir-1:
* tests/touch/empty-file:
* tests/touch/fifo:
* tests/touch/no-rights: Likewise.
Signed-off-by: Jim Meyering <meyering@redhat.com>
|
|
|
|
|
|
|
|
|
|
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
reliable.
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it. Problem reported by Jim Meyering today in
bug-coreutils.
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.
|
|
as POSIX requires.
* src/dd.c (scanargs): Implement it.
* tests/dd/misc (outbytes): Test it.
* doc/coreutils.texi (dd invocation): Specify that bs=N
overrides later ibs and obs, undoing part of the
previous change. (The behavior was wrong.)
|
|
|
|
and nolinks flags. Simplify redirection to /dev/null in some cases.
|
|
noatime test never tested anything.
|
|
|
|
|
|
|
|
|