summaryrefslogtreecommitdiff
path: root/tests/misc/truncate-fifo
AgeCommit message (Collapse)Author
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-05-29truncate: improve handling of non regular filesPádraig Brady
Previously we copied `dd` and suppressed error messages when truncating neither regular files or shared mem objects. This was valid for `dd`, as truncation is ancillary to copying it may also do, but for `truncate` we should display all errors. Also we used the st_size from non regular files which is undefined, so we display an error when the user tries this. * src/truncate (do_truncate): Error when referencing the size of non regular files or non shared memory objects. Display all errors returned by ftruncate(). (main): Error when referencing the size of non regular files or non shared memory objects. Don't suppress error messages for any file types that can't be opened for writing. * tests/misc/truncate-dir-fail: Check that referencing the size of a directory is not supported. * tests/misc/truncate-fifo: Ensure the test doesn't hang by using the `timeout` command. Don't test the return from running ftruncate on the fifo as it's system dependent as to whether this fails or not. NEWS: Mention the change in behavior. Reported by Jim Meyering.
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-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-06Add new program: truncatePádraig Brady
* AUTHORS: Register as the author * NEWS: Mention this change * README: Add truncate command to list * src/truncate.c: New command * src/Makefile.am: Add truncate command to list to build * src/.gitignore: Add truncate binary to list to ignore * doc/coreutils.texi (truncate invocation): Add truncate info * man/Makefile.am: Add truncate man page to list to build * man/truncate.x: Add truncate man page template * po/POTFILES.in: Add truncate to list to translate * tests/Makefile.am: Add truncate tests * tests/misc/help-version: Add support for new truncate command * tests/misc/truncate-dangling-symlink: check dangling link ok * tests/misc/truncate-dir-fail: ensure dirs fail * tests/misc/truncate-fail-diag: validate messages for missing paths * tests/misc/truncate-fifo: ensure fifos ignored * tests/misc/truncate-no-create-missing: ensure -c option honoured * tests/misc/truncate-overflow: check signed integer overflows * tests/misc/truncate-owned-by-other: root permissions check * tests/misc/truncate-parameters: check invalid parameter combinations * tests/misc/truncate-relative: check invalid relative sizes