summaryrefslogtreecommitdiff
path: root/tests/misc
AgeCommit message (Collapse)Author
2009-08-20tests: skip the stdbuf tests when the abs build directory name is bogusJim Meyering
* tests/misc/stdbuf: Avoid spurious failure when the directory name from which we'd set LD_PRELOAD contains unsafe characters.
2009-08-18tests: stdbuf: fix a bug in test scriptJim Meyering
* tests/misc/stdbuf: Use skip_test_ only after it's defined. Reported by Berhnard Voelker. (sc_check-AUTHORS): Rename rule from check-AUTHORS.
2009-08-14tests: skip the misc/stdbuf test if stdbuf was not builtJim Meyering
* tests/misc/stdbuf: Skip this test when stdbuf is not built. Reported by Eric Blake.
2009-07-27tests: new test for bug in ls -1U dir arg ...Jim Meyering
* tests/misc/ls-misc (multi-arg-U1): New test.
2009-07-03sort: allow SI and IEC units on separate human sort fieldsPádraig Brady
* src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort.
2009-06-27stdbuf: fix to stop -i option causing an assertionPádraig Brady
* src/stdbuf.c (main): Fix the array bounds check in the assert * tests/misc/stdbuf: Add a test for all standard streams
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-06-17stdbuf: A new program to run a command with modified stdio bufferingPádraig Brady
* AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add stdbuf command to list. * configure.ac: Only enable on ELF systems with GCC. * cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than VC_LIST, so we can add an exception, if needed. * .x-sc_system_h_headers: New file. Exempt libstdbuf.c. * Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers. * doc/coreutils.texi (stdbuf invocation): Add stdbuf info. * man/.gitignore: Ignore generated manpage. * src/.gitignore: Ignore stdbuf and libstdbuf.so binaries. * man/Makefile.am (stdbuf.1): Add dependency. * man/stdbuf.x: New file with example usage. * po/POTFILES.in: Reference new command and shared library sources. * src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf, (pkglib_PROGRAMS): Reference optional shared lib, (libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a. (libstdbuf_so_LDFLAGS): Add -shared GCC option, (libstdbuf_so_CFLAGS): Add -fPIC GCC option. (check-README): Exclude libstbuf. (check-AUTHORS): ditto. (sc_tight_scope): Exclude functions starting with __. * src/libstdbuf.c: The LD_PRELOAD shared library to control buffering. * src/stdbuf.c: New file to setup env variables before execing command. * tests/Makefile.am: Reference new test file. * tests/misc/help-version: Set expected exit codes. * tests/misc/invalid-opt: ditto. * tests/misc/stdbuf: Add 9 tests.
2009-06-13sort: Ignore fields where end position is before the start positionCliff Miller
* NEWS: Mention the fix * THANKS: Add Cliff Miller * src/sort.c (keycompare): Ensure lima >= texta * tests/misc/sort: Add 3 corresponding tests Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-05-26sort: new --human-numeric-sort option to sort KiB MB etc.Michael Speer
* NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update
2009-05-15tests: fix date-next-dow failure on older systemsPádraig Brady
* tests/misc/date-next-dow: In the strftime call use %Y-%m-%d rather than the newer %F equivalent which is not available on Solaris 8 for example.
2009-05-03tests: add tests of e.g., date -d 'next monday'Jim Meyering
* tests/misc/date-next-dow: New file. * tests/Makefile.am (TESTS): Add misc/date-next-dow. * gnulib: Update submodule to latest, for getdate.y that handles "next Monday" properly when run on a Monday.
2009-04-24tests: avoid unusual (~1-in-20) failure of a new testJim Meyering
* tests/misc/sort: Remove one of the generated tests. 363 remain in this file alone.
2009-04-23sort -m: don't segfault when output file is also an input fileJim Meyering
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and guard the use of memmove. * NEWS (Bug fixes): Mention it. * tests/misc/sort: Add tests to exercise the offending code. * THANKS: Update. Reported by Otavio Salvador in http://bugs.debian.org/525048.
2009-04-09tests: misc/ls-misc: avoid shadowing local decl of $eJim Meyering
* tests/misc/ls-misc (make_j_d): Rename latter $e to $env
2009-04-09id: fix infinite loop on some systemsPádraig Brady
Steven Parkes reported that `id -G $USER` went into an infinite loop on Darwin systems for users in more than 10 groups: http://bugs.gentoo.org/show_bug.cgi?id=264007 * gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist implementations that don't update the required size correctly, by doubling the result buffer and retrying. Also return the parameter updated by getgrouplist rather than its return value, as the documentation doesn't actually state the number of groups stored is returned by getgrouplist. * tests/misc/id-groups: Add test to exercise this logic * tests/Makefile.am: Reference new test * NEWS: Mention the fix * THANKS: Update
2009-03-29tests: don't use lang-default from individual testsJim Meyering
* tests/sample-test: Don't recommend using lang-default here. It is now run for each test automatically, via TESTS_ENVIRONMENT. * tests/dd/reblock: Don't source lang-default here. * tests/misc/truncate-fail-diag: Likewise.
2009-03-25pwd: support -L and -PEric Blake
* src/pwd.c (longopts): New variable. (logical_getcwd): New function. (main): Use it. (usage): Document new options. * doc/coreutils.texi (pwd invocation): Likewise. * NEWS: Likewise. * TODO (pwd): Mark it done. * tests/misc/pwd-option: New file. * tests/Makefile.am (TESTS): Add test. * THANKS: Update. Reported by Paul D. Smith, in savannah bug 24949.
2009-03-24tests: ls -v: exercise yet another change in gnulib's new filevercmpJim Meyering
* tests/misc/ls-misc: Add names with ~ and ~.1~ suffixes.
2009-03-18tests: adjust sort-continue not to fail under valgrindJim Meyering
* tests/misc/sort-continue: Don't run cat inside fd-limited shell. If sort fails to run in an fd-limited shell, skip the test.
2009-03-18tests: add another sort/nmerge testPaul Eggert
* tests/Makefile.am (TESTS): Add sort-merge-fdlimit. * tests/misc/sort-merge-fdlimit: New file. * doc/coreutils.texi (sort invocation): Document that we now silently lower nmerge if necessary. Patch by Paul Eggert, Nima Nikzad, Max Chang, Alexander Nguyen, Sahil Amoli, and Nick Graham.
2009-03-18sort: handle fd exhaustion better when mergingPaul Eggert
This is an alternative to my 9 March patch labeled "Silently lower nmerge; don't (sometimes incorrectly) range-check" <http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00070.html>. It differs by not using 'dup' to probe for extra file descriptors; instead, it simply calls 'open' (and 'pipe') to open files and pipes, until one of these calls fails due to file descriptor exhaustion; it then backs off by 1, does a merge with the files that it has opened, and then retries with the (now-smaller) number of files. This patch requires quite a few more changes to the source code than the earlier patch, but it is in some sense "better" because it doesn't need to call "dup" ahead of time in order to decide whether "open" or "pipe" will fail. Also, it's more robust in the case where "open" or "pipe" fails with errno==EMFILE because some system-wide limit is exhausted. * src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION. (stream_open): New function, containing guts of xfopen. (xfopen): Use it. (pipe_fork): Set errno on failure. (maybe_create_temp): New function, containing guts of create_temp. (create_temp): Use it. (open_temp): Distinguish failures due to file descriptor exhaustion from other failures, and on fd exhaustion return a notice to caller rather than dying. Don't test execlp's return value; when it returns, it *always* returns -1. (open_input_files): New function. (mergefps): New arg FPS. It's now the caller's responsibility to open the input and output files. All callers changed. (mergefiles): New function. (avoid_trashing_input, merge): Handle the case where a single merge can't merge as much as we wanted due to file descriptor exhaustion, by merging as much as we can and then retrying. * tests/Makefile.am (TESTS): Add misc/sort-continue. * tests/misc/sort-continue: New file. * THANKS: Add Glen Lenker and Matt Pham who coauthored this patch.
2009-03-12tests: groups-version: don't require that id be builtJim Meyering
* tests/misc/groups-version: groups is now independent of id.
2009-03-12tests: skip the groups-dash test when "groups" is not builtJim Meyering
* tests/misc/groups-dash: Skip if groups is not being installed. Suggested by Mike Frysinger. Also fail if groups exits with nonzero status.
2009-03-11cp: make -a option preserve xattrs, but with reduced diagnosticsOndřej Vašík
* copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'. (copy_attr_by_name): Likewise. * cp.c (main): Preserve xattrs with -a option, when possible. * doc/coreutils.texi: Document that xattrs are preserved with cp -a, with no added diagnostics. * NEWS: Mention the change. * tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.
2009-03-11cat: Fix immediate output of processed dataPádraig Brady
Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...". * NEWS: Mention the bugfix. * src/cat.c (cat): Fix the typo which stopped the writing of processed data before a blocking read() is done. * tests/misc/cat-buf: Add to ensure processed data is not buffered. * tests/Makefile.am: Reference the new test.
2009-03-08tests: add a test for newly-fixed bug in comm --check-orderJim Meyering
* tests/misc/comm (ooo-prefix): Add a test for today's fix. * NEWS (Bug fixes): Mention it.
2009-03-08tests: ls -v: exercise the bug fixed by gnulib's new filevercmpJim Meyering
* tests/misc/ls-misc (version-sort): New test. (mk_file): New function. Reported by Josh Triplett in <http://bugs.debian.org/517558>. Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902 * NEWS (Bug fixes): Mention it.
2009-03-02tests: when skipping a test, say why on screen, not just in the logJim Meyering
* tests/test-lib.sh: Redirect also to descriptor 9. Better one-line why-skip diagnostics. * tests/check.mk (TESTS_ENVIRONMENT): Redirect 9 to stderr. * tests/misc/pwd-unreadable-parent: Remove redundant "skipping..." diag.
2009-02-28tests: sort: Check skipping blanks in multibyte localesPádraig Brady
* tests/misc/sort: On Fedora 8 at least, sort -k1b,1 mishandles blanks in multibyte locales, so add test.
2009-02-26tests: stty-row-col would hang when run in the backgroundJim Meyering
* tests/misc/stty-row-col: Don't hang when run in background at least on Solaris 10 and OpenBSD.
2009-02-26sort: Fix two bugs with determining the end of fieldPádraig Brady
* src/sort.c: When no specific number of chars to skip is specified for the end field, always skip the whole field. Also never include leading spaces from next field. * tests/misc/sort: Add 2 new tests for these cases. * NEWS: Mention this bug fix. * THANKS: Add bug reporter. Reported by Davide Canova.
2009-02-22tests: reenable temporarily-disabled tests using e.g., trap '' TTOUJim Meyering
Revert "tests: skip newly-modified tests unconditionally..." This reverts commit 773a88d33f68e50a2919c8a8310c646a7e5fabc2. * tests/misc/stty: Don't skip. * tests/misc/stty-invalid: Likewise. * tests/mv/i-3: Likewise.
2009-02-21tests: skip newly-modified tests unconditionally, just to be safeJim Meyering
* tests/misc/stty-invalid: Skip. * tests/misc/stty: Likewise. * tests/mv/i-3: Likewise.
2009-02-21tests: don't let SIGTTOU/TTIN hang a backgrounded "make check"Jim Meyering
Running "make check &" would hang due to SIGTTOU and SIGTTIN signals. * tests/misc/stty: Ignore SIGTTOU. * tests/misc/stty-invalid: Likewise. * tests/mv/i-3: Ignore SIGTTIN.
2009-02-18add missing copyright datesEric Blake
* NEWS: Add 2009 to copyright. * README: Likewise. * README-hacking: Likewise. * TODO: Likewise. * doc/Makefile.am: Likewise. * m4/prereq.m4: Likewise. * src/nl.c: Likewise. * src/seq.c: Likewise. * tests/cp/cp-i: Likewise. * tests/install/install-C: Likewise. * tests/install/install-C-root: Likewise. * tests/install/install-C-selinux: Likewise. * tests/misc/seq: Likewise. * tests/mv/mv-n: Likewise.
2009-02-14seq: Fix equal width calculation when '.' added to last numberPádraig Brady
Issue reported by Samuel Hapák. <http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00139.html> * src/seq.c: Account for '.' added to "last" number. * tests/misc/seq: Add corresponding test. * NEWS: Mention the fix.
2009-01-29cp/mv: add xattr supportKamil Dudka
This patch was originally written by Andreas Grünbacher, nowadays available at http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff * bootstrap.conf: Add gnulib module verror. * po/POTFILES.in: Add lib/verror.c. * m4/xattr.m4: Check for libattr availability, new configure option --disable-xattr. * m4/prereq.m4: Require gl_FUNC_XATTR. * src/Makefile.am: Link cp, mv and ginstall with libattr. * src/copy.h: Add preserve_xattr and require_preserve_xattr to cp_options. * src/copy.c (copy_attr_error): New function to handle errors during xattr copying. (copy_attr_quote): New function to quote file name in error messages printed by libattr. (copy_attr_free): Empty function requested by libattr to free quoted string. (copy_attr_by_fd): New fd-oriented function to copy xattr. (copy_attr_by_name): New name-oriented function to copy xattr. (copy_reg, copy_internal): Call copy_extended_attributes function. * src/cp.c (usage): Mention new --preserve=xattr option. (decode_preserve_arg): Handle new --preserve=xattr option. * src/mv.c: Always attempt to preserve xattr. * src/install.c: Never attempt to preserve xattr. * tests/misc/xattr: New test for xattr support in cp, mv and install. * tests/Makefile.am: Add the new test to list. * doc/coreutils.texi: Mention xattr support, new --preserve=xattr option. * NEWS: Mention the change.
2009-01-28tests: Fixup shred-passes testPádraig Brady
* tests/misc/shred-passes: Set the $fail variable correctly. The issue was noticed by Jim Meyering.
2009-01-28tests: Add a test to verify shred's default operationsPádraig Brady
* tests/Makefile.am: add new test * tests/misc/shred-passes: Verify the operations shred does by default to overwrite and remove a zero length file.
2009-01-03tests: refactor to use the new getlimits utilityPádraig Brady
* tests/Coreutils.pm: Add function to make limits available * tests/test-lib.sh: ditto * tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW rather than using arbitrary 2^128 * tests/misc/sort: ditto * tests/misc/uniq: ditto * tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW rather than using arbitrary -2^31 * tests/misc/seq-long-double: Check for INTMAX_OFLOW rather than using arbitrary 2^63 * tests/misc/split-fail: Check --lines --bytes and --line-bytes options limits on all platforms. Note getlimits obviates the need to use expr to check if 32 bit integers are supported, which I think was invalid anyway as expr now supports bignum? * tests/misc/test: Check for UINTMAX_OFLOW rather than using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW rather than using arbitrary -2^64 * tests/misc/timeout-parameters: Check for UINT_OFLOW rather than using arbitrary 2^32 * tests/misc/truncate-overflow: Don't depend on truncate to determine if we're on a 32 or 64 bit platform and instead use the various OFF_T limits * tests/misc/sort-merge: Check for UINTMAX_OFLOW rather than using arbitrary 2^64+1 * tests/misc/unexpand: ditto
2009-01-01tests: factor ls-misc (no semantic change)Jim Meyering
* tests/misc/ls-misc: Factor out uses of "\e[0m".
2008-11-16tests: change misc/printf-surprise so that it doesn't segfault anymoreJim Meyering
* tests/misc/printf-surprise: Disable MALLOC_PERTURB_, so that "make check" no longer provokes a segfault from printf(1). Before, that would be detected as a known problem and cause the test to be skipped. Adjust the test so that a segfault once again results in test failure.
2008-10-26tests: seq: check for today's extended long double fixJim Meyering
* tests/misc/seq-long-double: New file. Test for today's bug fix. * tests/check.mk (TESTS_ENVIRONMENT): Export CC definition. * tests/Makefile.am (TESTS): Add misc/seq-long-double. * NEWS (Bug fixes): Mention it.
2008-10-26seq: improve quality of format-checking codePaul Eggert
* src/seq.c (validate_format): Remove. Migrate its checks into... (long_double_format): Report an error and exit if an error is found, instead of returning NULL. All callers changed. Use a more-consistent format for diagnostics. * tests/misc/seq: Adjust to the more-consistent format for diagnostics.
2008-10-25seq: revert Solaris 8 work-around that caused x86 regressionPaul Eggert
* src/seq.c: Don't include <math.h>, <float.h>. (abs_rel_diff): Remove. (print_numbers): Test for equality, not for an epsilonish value. This reverts 4827dd27b0c655a685947aaa01426a5ecba179f3, aka v6.10-185-g4827dd2, which broke 'seq' on the x86; for example, it causes "seq 9223372036854775807 9223372036854775808" to incorrectly output 3 numbers instead of 2. It's better to punish obsolescent hosts that have incorrectly-working floating-point than to punish correctly-working hosts. * tests/misc/seq: Use 0.9000000000000, rather than 0.90000000000000000000, to avoid tickling a bug in Solaris 8 strtold, which converts "0.9" and "0.9000000000000" correctly, but incorrectly converts "0.90000000000000000000" to a smaller value.
2008-10-23ls: use '.' (not +) as SELinux-only alt. access flag in ls -l outputJim Meyering
* src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.', any other nonempty combination of MAC and ACL to '+', and all else to the usual ' '. Suggested by Michael Stone. * tests/misc/selinux: Adapt: expect '.', not '+'. * doc/coreutils.texi (What information is listed): Document this. * NEWS (Changes in behavior): Mention it.
2008-10-15tests: add option processing tests for 'expr'Pádraig Brady
* tests/misc/expr: Add tests for various combinations of options where the first part of the expression could be confused with an option.
2008-10-15expr: remove --bignum and --no-bignum optionsPaul Eggert
* doc/coreutils.texi (expr invocation): Remove the --bignum and --no-bignum options. They weren't really needed, and they broke longstanding (albeit nonportable) scripts. * src/expr.c: Don't include <assert.h>. Include "inttostr.h", "long-options.h", "verify.h". Check at compile-time that size_t fits in unsigned long int, as the code assumes this in several places. (HAVE_GMP): Define to 0 if not defined, for convenience. (mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add): (mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn): (mpz_fits_ulong_p, mpz_get_ui, mpz_out_str): Supply substitutes when !HAVE_GMP, which work well enough for expr's purposes. (mp_integer): Remove. All integers are gmp, if gmp is available. (struct valinfo): Remove 'z' member; no longer needed. The 'i' member is always of type mpz_t. (enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode): Remove; no longer needed. (usage): Remove documentation of --bignum and --no-bignum. (integer_overflow): Abort if error misbehaves, to pacify GCC. Restore old message on arithmetic overflow, to be conservative. (die): Omit exit_status parameter; not needed (is always EXPR_FAILURE). (string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options): Remove; no longer needed. (main): Don't use getopt_long; this breaks old nonportable scripts. (int_value): Arg is unsigned, in case we have strings whose length exceeds LONG_MAX (!). (int_value, freev, printv, null, tostring, toarith): (eval6, eval4, eval3): Always use mpz_ functions, to simplify the code. (substr_value): Remove; no longer needed. (getsize): Simplify the API: one arg rather than 3. Don't assume unsigned long int fits in size_t. (promote, domult, dodivide, doadd): Remove; no longer needed. * tests/misc/expr: Don't use --bignum to test for bignum support. Instead, use big numbers to test this.
2008-10-03ls and sort: use filevercmp instead of strverscmpKamil Dudka
* src/ls.c (cmp_version): Use filevercmp instead of strverscmp. * src/sort.c (usage): Remove mna reference to strverscmp(3). (compare_version): Use filevercmp instead of strverscmp. * bootstrap.conf: Add filevercmp to list of gnulib modules. * tests/misc/sort-version: Remove conflicting string and enhance test. * NEWS: Mention the change.