summaryrefslogtreecommitdiffstats
path: root/tests/misc
AgeCommit message (Collapse)AuthorLines
7 daysyes: use a zero-copy implementation via (vm)splicePádraig Brady-0/+20
A good reference for the concepts used here is: https://mazzo.li/posts/fast-pipes.html We don't consider huge pages or busy loops here, but use vmsplice(), and splice() to get significant speedups: i7-5600U-laptop $ taskset 1 yes | taskset 2 pv > /dev/null ... [4.98GiB/s] i7-5600U-laptop $ taskset 1 src/yes | taskset 2 pv > /dev/null ... [34.1GiB/s] IBM,9043-MRX $ taskset 1 yes | taskset 2 pv > /dev/null ... [11.6GiB/s] IBM,9043-MRX $ taskset 1 src/yes | taskset 2 pv > /dev/null ... [175GiB/s] Also throughput to file (on BTRFS) was seen to increase significantly. With a Fedora 43 laptop improving from 690MiB/s to 1.1GiB/s. * bootstrap.conf: Ensure sys/uio.h is present. This was an existing transitive dependency. * m4/jm-macros.m4: Define HAVE_SPLICE appropriately. We assume vmsplice() is available if splice() is as they were introduced at the same time to Linux and glibc. * src/yes.c (repeat_pattern): A new function to efficiently duplicate a pattern in a buffer with memcpy calls that double in size. This also makes the setup for the existing write() path more efficient. (pipe_splice_size): A new function to increase the kernel pipe buffer if possible, and use an appropriately sized buffer based on that (25%). (splice_write): A new function to call vmplice() when outputting to a pipe, and also splice() if outputting to a non-pipe. * tests/misc/yes.sh: Verify the non-pipe output case, (main): Adjust to always calling write on the minimal buffer first, then trying vmsplice(), then falling back to write from bigger buffer. and the vmsplice() fallback to write() case. * NEWS: Mention the improvement.
14 daysmaint: tests: decouple debug output determinationPádraig Brady-14/+3
* tests/misc/warning-errors.sh: Simply check there is output to stderr before checking that output induces an error.
14 daystests: avoid false test failure when using address sanitizerCollin Funk-0/+3
* tests/misc/warning-errors.sh: Skip commands which have been built with sanitizers, since standard error will not be closed and checked for errors. Reported by Bruno Haible.
14 daystests: avoid failure on systems without an optimized 'cksum' or 'wc -l'Collin Funk-0/+10
* tests/misc/warning-errors.sh: Expect 'wc' and 'cksum' to exit successfully if there is not an optimized 'wc -l' implementation or CRC32 implementation. Reported by Bruno Haible.
2026-02-26id: promptly diagnose write errorsCollin Funk-0/+1
* NEWS: Mention the improvement. * src/id.c (print_stuff): Call fflush for each listed user to check for write errors. * tests/misc/io-errors.sh: Add an invocation of 'id'.
2026-02-26groups: promptly diagnose write errorsCollin Funk-0/+1
* NEWS: Mention the improvement. * src/groups.c (main): Call fflush for each listed user to check for write errors. * tests/misc/io-errors.sh: Add an invocation of 'groups'.
2026-02-26tests: ensure failure to write warnings is handled gracefullyPádraig Brady-0/+63
* tests/misc/warning-errors.sh: Add a new test to ensure failure to write warnings is diagnosed in the exit status. * tests/local.mk: Reference the new test.
2026-02-26maint: fix description of tests/misc/io-errors.shPádraig Brady-1/+1
* tests/misc/io-errors.sh: Promptness is checked in write-errors.sh, not this test.
2026-02-23tests: whoami, logname: verify error handlingoech3-0/+31
* tests/df/no-mtab-status-masked-proc.sh: Tweak unshare check. * tests/local.mk: Reference new test. * tests/misc/user.sh: Add new test using unshare -U, to verify that whoami and logname diagnose failure correctly. https://github.com/coreutils/coreutils/pull/195
2026-02-21tests: shuf: check that write errors are promptly diagnosedCollin Funk-0/+1
* tests/misc/write-errors.sh: Add a shuf invocation that would run forever if write errors weren't diagnosed.
2026-02-18maint: tests: avoid ENOSPC specific handlingPádraig Brady-2/+3
* tests/csplit/csplit-io-err.sh: Adjust determination of ENOSPC. * tests/csplit/split-io-err.sh: Likewise. * tests/fold/fold-zero-width.sh: Verify full ENOSPC message. * tests/tac/tac-continue.sh: Likewise. * tests/misc/io-errors.sh: Likewise. * tests/misc/write-errors.sh: Likewise.
2026-02-18tests: use system ENOSPC messagePádraig Brady-3/+3
* tests/head/head-write-error.sh: Verify ENOSPC is output. * tests/misc/yes.sh: Likewise.
2026-02-18tests: use system EACCES messagePádraig Brady-3/+3
* tests/chgrp/no-x.sh: Don't harcode "Permission denied". * tests/chmod/no-x.sh: Likewise. * tests/du/inacc-dest.sh: Likewise. * tests/du/no-x.sh: Likewise. * tests/misc/nohup.sh: Likewise. * tests/mv/part-fail.sh: Likewise. * tests/mv/perm-1.sh: Likewise. * tests/rm/fail-eacces.sh: Likewise. * tests/rm/rm1.sh: Likewise. * tests/rm/rm2.sh: Likewise. * tests/rm/unread2.sh: Likewise. * tests/rm/unreadable.pl: Likewise.
2026-02-18maint: tests: avoid AIX specific EACCES handlingPádraig Brady-2/+3
* tests/rm/inaccessible.sh: Remove AIX specific handling. * tests/cp/fail-perm.sh: Likeise. Also remove confusing EPERM/HPUX mentions. * tests/misc/sync.sh: Don't hardcode EISDIR and EACCES.
2026-02-12tests: coreutils: remove redundant validity checkoech3-3/+1
* tests/misc/coreutils.sh: Remove the check for non-empty coreutils.h, as the existing `print_ver_ coreutils` is sufficient to determine support for single binary mode. https://github.com/coreutils/coreutils/pull/189
2026-02-12tests: arch: add option parsing checkoech3-0/+2
* tests/misc/arch.sh: Ensure -- to indicate end of options is accepted. https://github.com/coreutils/coreutils/pull/191
2026-02-10tests: determine errno string more efficientlyPádraig Brady-8/+2
* tests/misc/read-errors.sh: Use getlimits_ determined EIO error string, rather than inferring the string from bash's output. See https://bugs.gnu.org/80353
2026-02-09maint: remove extraneous code from testPádraig Brady-3/+0
* tests/misc/usage_vs_refs.sh: Remove copy and paste slop. * tests/local.mk: Fix indentation.
2026-02-08nl: support multi-byte section delimitersCollin Funk-127/+0
* NEWS: Mention the improvement. * src/nl.c: Include mcel.h. (DEFAULT_SECTION_DELIMITERS): Resize to fit 2 multi-byte characters. (section_del_len): New variable. (check_section): Compare against section_del_len instead of 2. (main): Support multi-byte characters for the -d option. * tests/nl/multibyte.sh: New file. * tests/nl/nl.sh: New file, moved from tests/misc/nl.sh. * tests/local.mk (all_tests): Add the new test. Adjust the existing tests file name. * cfg.mk (exclude_file_name_regexp--sc_space_tab): Adjust Adjust the existing tests file name.
2026-02-08tests: fix false failure with dash or kshPádraig Brady-0/+1
* tests/misc/read-errors.sh: Avoid dash or ksh as they do _not_ print an error message upon EIO from read. Fixes https://bugs.gnu.org/80353
2026-02-06tests: nl: check that all files are processedCollin Funk-0/+14
* tests/misc/nl.sh: Add a test case.
2026-02-02tests: avoid false failure sync'ing busy systemsPádraig Brady-2/+6
* tests/misc/sync.sh: Increase the timeout to 60s, and restrict the case to when RUN_VERY_EXPENSIVE_TESTS=yes.
2026-01-23tests: usage_vs_refs.sh: fix false failure with AlpinePádraig Brady-1/+1
* tests/misc/usage_vs_refs.sh: Fix missing escape on literal {, required by busybox grep. Reported by Bruno Haible.
2026-01-22tests: fix false failure with pr -COLSPádraig Brady-1/+1
* tests/misc/usage_vs_getopt.sh: Fix false failure induced by commit v9.9-239-ga06f0cf67
2026-01-22doc: use TERM=dumb rather than HELP_NO_MARKUP to disable markupPádraig Brady-3/+3
This is a more standard mechanism to disable markup. * src/system.h (oputs_): Logic change to honor TERM=dumb, rather than HELP_NO_MARKUP=something. * doc/coreutils.texi: Adjust the description for --help. * man/local.mk: Ensure TERM is set to something, so that man pages have links included. * man/viewman: Just honor users $TERM. * tests/misc/getopt_vs_usage.sh: Remove env var complication, as TERM is unset automatically. * tests/misc/usage_vs_refs.sh: Likewise. * NEWS: Adjust the change in behavior note.
2026-01-21tests: avoid false failure with non standard pathPádraig Brady-2/+2
* tests/misc/usage_vs_refs.sh: Properly quote arguments to avoid false failure with paths containing spaces etc.
2026-01-21tests: avoid false failure on setgid dirPádraig Brady-3/+5
* tests/misc/mknod.sh: Skip a portion of the test in the edge case of setgid directories.
2026-01-21tests: ensure there is an anchor for each --help optionPádraig Brady-0/+71
* tests/misc/usage_vs_refs.sh: A new test to correlation options listed in --help, and anchors referenced in the texinfo (html) manual. * tests/local.mk: Add the new test.
2026-01-21doc: ls: support styling and links in --help outputPádraig Brady-2/+2
* src/ls.c (oputs): A new function that wraps puts(), but also highlights the --option-text portion, and adds links to the appropriate part of the online manual. (usage): Call oputs() rather than puts(). * doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var, which can be used in the edge case one wants to suppress ansi escapes. * tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the test continues to pass.
2026-01-19tests: sync: check that all files are processed even when errors occurCollin Funk-0/+8
* tests/misc/sync.sh: Add the test case.
2026-01-19tests: sync: also test that -d and -f don't block on a FIFOCollin Funk-1/+4
* tests/misc/sync.sh: Check 'sync fifo' with no arguments, -d, and -f separately. Only perform the check for -f if RUN_EXPENSIVE_TESTS=yes since it may be expensive.
2026-01-18tests: strace: consider splice a "read" syscallPádraig Brady-3/+3
* tests/cksum/cksum-c.sh: Add 'splice' to the injection set. * tests/misc/read-errors.sh: Likewise. From https://github.com/coreutils/coreutils/pull/167
2026-01-18tests: use `command -v` to identify binaryPádraig Brady-1/+1
* tests/misc/coreutils.sh: Be more flexibile by using `command -v` to identify the binary to be executed, rather than linking directly to the built binary.
2026-01-17tests: avoid a test hang on AIXCollin Funk-0/+1
* init.cfg (uses_strace_): New function. (require_strace_): Use it. tests/cksum/cksum-c.sh: Likewise. tests/misc/read-errors.sh: Likewise.
2026-01-16maint: spelling fixesPaul Eggert-1/+1
2026-01-15all: with multi-call binary, only process options for known namesPádraig Brady-5/+12
Setup $ ln -nsf src/coreutils foo Before $ ./foo; echo $? foo: unknown program ‘foo’ Try './foo --help' for more information. 1 ./foo --version; echo $? coreutils (GNU coreutils) 9.9.172-01993 0 After $ ./foo; echo $? coreutils: unknown program 'foo' 1 $ ./foo --version; echo $? coreutils: unknown program 'foo' 1 * src/coreutils.c (main): Don't process options if we don't know they're intended for the multi-call binary. Otherwise `foo --version` would return true, even though foo was symlinked to the multi-call binary, but not supported. * tests/misc/coreutils.sh: Add test cases. * NEWS: Mention the change in behavior.
2026-01-13tests: ensure utilities correctly diagnose read errorsPádraig Brady-0/+24
* tests/misc/read-errors.sh: Ensure each utility calls a read system call as requested. Not doing so (say by avoiding reading from a directory) is a layering violation. Also ensure we diagnose the particular error encountered.
2026-01-13paste: support multi-byte delimitersPádraig Brady-89/+0
* src/paste.c (collapse_escapes): This is the central --delimiters parsing function, so adjust to handle multi-byte chars with mcel_scanz(). Populate a delimiters length array to support characters of differing lengths. (paste_serial): Use the delimiters length array to output the appropriate delimiter. (paste_parallel): Likewise. * tests/paste/multi-byte.sh: A new test. * tests/local.mk: Reference the new test. * NEWS: Mention the improvement.
2026-01-12tests: paste -d: test supported escape sequencesPádraig Brady-0/+15
* tests/misc/paste.pl: Test all supported POSIX and GNU backslash escape sequences.
2026-01-11tests: cksum: ensure --check diagnoses read errorsPádraig Brady-0/+1
* tests/misc/read-errors.sh: Add a test case. Discussed in https://github.com/coreutils/coreutils/pull/167
2026-01-10cksum: promptly diagnose write errorsCollin Funk-0/+3
* src/cksum.c (output_file, digest_check): Check if standard output has it's error flag set after printing. * tests/misc/write-errors.sh: Add a test case that would previously run forever. * NEWS: Mention the improvement. Reorder alphabetically.
2026-01-10maint: remove redundant processing in a testPádraig Brady-3/+4
* tests/misc/write-errors.sh: This was a no-op anyway due to inadequate escaping. Also document the escaping requirement.
2026-01-10du: promptly diagnose write errorsPádraig Brady-0/+1
* src/du.c (print_size): Call write_error() if can't flush. * tests/misc/write-errors.sh: Add a test case. * NEWS: Mention the improvement.
2026-01-10wc: promptly diagnose write errorsPádraig Brady-0/+1
* src/wc.c (write_counts): Call write_error() if any pending errors. * tests/misc/write-errors.sh: Add a test case. * NEWS: Mention the improvement.
2026-01-06maint: organize mktemp tests in a subdirectoryCollin Funk-206/+0
* tests/misc/mktemp.pl: Moved to tests/mktemp/mktemp.pl. * tests/local.mk (all_tests): Adjust the file name.
2026-01-01maint: run 'make update-copyright'Collin Funk-34/+34
2025-12-27tests: kill: check that real-time signals are listedCollin Funk-0/+13
* tests/misc/kill.sh: Call getlimits_. Check for RTMIN and RTMAX in the output of 'kill -l' if the system defines SIGRTMIN and SIGRTMAX.
2025-12-27tests: check I/O error handling with /dev/full and closed pipesPádraig Brady-0/+94
* tests/misc/io-errors.sh: Verify that all commands diagnose write errors, and handle a closed pipe appropriately. * tests/local.mk: Reference the new test.
2025-12-11maint: organize tee tests in a subdirectoryCollin Funk-145/+0
* tests/misc/tee.sh: Moved to tests/tee/tee.sh. * tests/local.mk (all_tests): Adjust the file name.
2025-12-02maint: organize expand and unexpand tests in a subdirectoryCollin Funk-330/+0
* tests/misc/expand.pl: Move to tests/expand/expand.pl. * tests/misc/unexpand.pl: Move to tests/unexpand/unexpand.pl. * tests/local.mk (all_tests): Adjust file names.