aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sort (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-10-29sort: fix silent exit upon SIGPIPE from --compress-programPádraig Brady1-4/+22
* src/sort.c (main): Ignore SIGPIPE so we've more control over how we handle for stdout and compression programs. (sort_die): Handle EPIPE from stdout and mimic a standard SIGPIPE, otherwise reverting to a standard exit(SORT_FAILURE); * tests/sort/sort-compress-proc.sh: Add a test case. * NEWS: Mention the bug fix.
2025-10-25sort: use the more efficient posix_spawn to invoke --compress-programCollin Funk1-0/+9
* NEWS: Mention the improvement. Mention that 'sort' will continue without compressing temporary files if the program specified by --compress-program cannot be executed. * doc/coreutils.texi (sort invocation): Document the behavior when the program specified by --compress-program cannot be executed. * src/sort.c: Include spawn.h. (MAX_FORK_TRIES_COMPRESS, MAX_FORK_TRIES_DECOMPRESS): Remove definition. (MAX_TRIES_COMPRESS, MAX_TRIES_DECOMPRESS): New definitions based on MAX_FORK_TRIES_COMPRESS and MAX_FORK_TRIES_DECOMPRESS. (async_safe_die): Remove function. (posix_spawn_file_actions_move_fd): New function. (pipe_fork): Remove function. (pipe_child): New function based on pipe_fork. Return an error number instead of a pid. Use posix_spawnp instead of calling fork and expecting the caller to exec. (maybe_create_temp): Call pipe_child instead of pipe_fork. Print a warning to standard error if --compress-program cannot be executed and the error is different than the previous call. Remove code for the child process. (open_temp): Remove code for the child process. Improve error message. * tests/sort/sort-compress.sh: Add a test case for when the program specified by --compress-program does not exist.
2025-08-05maint: use consistent references to standard files in messagesCollin Funk1-2/+2
* cfg.mk (sc_standard_outputs): Add a grep command for source files. * src/du.c (main): Use standard input instead of stdin, standard output instead of stdout, and standard error instead of stderr in messages. * src/nohup.c (main): Likewise. * src/sort.c (main): Likewise. * src/split.c (main): Likewise. * src/stdbuf.c (main): Likewise. * src/wc.c (main): Likewise. * tests/du/files0-from.pl (@Tests): Adjust test case to new messages. * tests/sort/sort-files0-from.pl: Likewise. * tests/wc/wc-files0-from.pl: Likewise.
2025-07-12tests: sort: add a test for equivalent floatsPádraig Brady1-0/+3
* tests/sort/sort-float.sh: Ensure equivalent floats are treated as such.
2025-07-11tests: fix fraction comparison in sort-floatPaul Eggert1-6/+12
Problem reported by Cosima Neidahl <https://bugs.gnu.org/78985#13>. * tests/sort/sort-float.sh: At top level, use C locale at first. (dbl_minima_order): Assume C locale. Use string comparison for the fractional parts. 2025-07-10 Paul Eggert <eggert@cs.ucla.edu> tests: fix integer overflow in sort-float Problem reported by Cosima Neidahl <https://bugs.gnu.org/78985>. * tests/sort/sort-float.sh (dbl_minima_order): Use expr instead of test, to avoid problems with integers too large for the shell.
2025-07-10tests: fix integer overflow in sort-floatPaul Eggert1-1/+2
Problem reported by Cosima Neidahl <https://bugs.gnu.org/78985>. * tests/sort/sort-float.sh (dbl_minima_order): Use expr instead of test to compare fractions, to avoid problems with integers too large for the shell.
2025-05-28tests: sort: expand multiple output testingPádraig Brady1-0/+5
* tests/sort/sort.pl: Ensure duplicate output strings are supported.
2025-05-20sort: fix buffer under-read (CWE-127)Pádraig Brady1-0/+35
* src/sort.c (begfield): Check pointer adjustment to avoid Out-of-range pointer offset (CWE-823). (limfield): Likewise. * tests/sort/sort-field-limit.sh: Add a new test, which triggers with ASAN or Valgrind. * tests/local.mk: Reference the new test. * NEWS: Mention bug fix introduced in v7.2 (2009). Fixes https://bugs.gnu.org/78507
2025-04-04tests: fix false failure with multi-byte thousands separatorsPádraig Brady1-0/+3
* tests/sort/sort-h-thousands-sep.sh: sv_SE defaults to UTF-8 on macOS 18, so avoid the test for multi-byte separators. Fixes https://bugs.gnu.org/77509
2025-01-22sort: drop "note" from a --debug messagePádraig Brady1-12/+12
* src/sort.c (key_warnings): Remove "note " from the start of a usually informational message, as this simplifies translation. * tests/sort/sort-debug-warn.sh": Adjust accordingly. Fixes https://bugs.gnu.org/75763
2025-01-01maint: update all copyright year number rangesPádraig Brady24-24/+24
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2024-02-27tests: simplify treatment of the $LOCALE_FR_UTF8 variablePádraig Brady1-3/+1
* tests/df/problematic-chars.sh: Rely on gnulib setting this to "none" where not usable. * tests/misc/sleep.sh: Likewise. * tests/printf/printf-mb.sh: Likewise. * tests/printf/printf-quote.sh: Likewise. * tests/sort/sort-debug-keys.sh: Likewise.
2024-01-01maint: update all copyright year number rangesPádraig Brady24-24/+24
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Manually update copyright year, until we fully sync with gnulib at a later stage. * tests/sample-test: Adjust to use the single most recent year.
2023-12-29tests: run locale tests on more systemsPádraig Brady1-10/+11
* tests/misc/numfmt.pl: Determine the thousands grouping character in use, rather than skipping locale tests when it's not a space. For example fr_FR.UTF-8 uses "NARROW NO-BREAK SPACE" as the grouping char on modern glibc systems at least. * tests/sort/sort-h-thousands-sep.sh: Likewise.
2023-08-28maint: spelling fixes, including author namesPaul Eggert1-2/+2
Most of this just affects commentary and documentations. The only significant behavior change is translating author names via proper_name_lite rather than proper_name_utf8, or not translating them at all. proper_name_lite is good enough for coreutils and avoids the bloat that had coreutils not using Gnulib proper_name. * bootstrap.conf (gnulib_modules): Use propername-lite instead of propername. (XGETTEXT_OPTIONS): Look for proper_name_lite instead of for proper_name_utf8. * cfg.mk (local-checks-to-skip): Remove sc_proper_name_utf8_requires_ICONV, since we no longer use proper_name_utf8. (old_NEWS_hash): Update. (sc_check-I18N-AUTHORS): Remove; no longer needed.
2023-08-27sort: port sort-merge-fdlimit test to Solaris 10Paul Eggert1-1/+8
* tests/sort/sort-merge-fdlimit.sh: Give 'sort' fd 6 too. Needed for the same reason sort-continue.sh needed a ulimit -n boost.
2023-08-27sort: port sort-continue test back to Solaris 10Paul Eggert1-5/+11
* tests/sort/sort-continue.sh: Use ulimit -n 7 not -n 6. On Solaris 10 'sort' uses Gnulib mkostemp, which calls Gnulib getrandom, which opens /dev/urandom to calculate the temp file's name, which means 'sort' needs one more file descriptor to work.
2023-08-15tests: fix false failure due to locale on alpinePádraig Brady1-1/+5
* tests/sort/sort-debug-keys.sh: Decimal point was seen to be '.' on fr_FR.UTF-8 on Alpine Linux 3.18, so add an extra guard to ensure we've a ',' as the decimal point on this locale. Fixes https://bugs.gnu.org/65310
2023-06-19tests: move tests to a directory per utilitySylvestre Ledru24-0/+2248
* cfg.mk: Adjust syntax check exclusion paths. * tests/local.mk: Adjust for renamed tests.
2008-05-09tests: remove directory, tests/sort/Jim Meyering1-303/+0
* configure.ac (AC_CONFIG_FILES): Remove tests/sort/Makefile. * tests/Makefile.am (SUBDIRS): Remove sort. * tests/misc/sort: New file, with tests from... * tests/sort/Test.pm: ...here. Remove file.
2008-02-20sort: add --sort=... option.Andreas Schwab1-0/+4
* src/sort.c (SORT_OPTION): New enum. (sort_args, sort_types): Define. (usage, long_options, main): New option --sort. * tests/sort/Test.pm: Test it. * doc/coreutils.texi (sort invocation): Document --sort option. * NEWS: Mention this.
2008-02-02Clarify a comment.Jim Meyering1-3/+4
* tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL.
2007-10-20Adjust tests to pass, now that Test.pm ones use check.mk.Jim Meyering1-3/+0
* tests/check.mk (vc_exe_in_TESTS): Adjust regexp not to match the "TESTS = $x-tests" line in each Test.pm-derived Makefile.am file. * tests/sort/main: Remove this unused file.
2007-08-25Remove all .cvsignore files from version control.Jim Meyering1-7/+0
2007-07-24sort: add a test to exercise the affected code.Jim Meyering1-1/+5
* tests/sort/Test.pm (realloc-buf): Exercise the code that changed yesterday. No other test in all of "make check" does this. * NEWS: Mention the fix.
2007-07-23Update all copyright notices to use the newer form.Jim Meyering1-5/+3
2007-07-20Document and add a test for today's sort bug fix.Jim Meyering1-2/+6
* NEWS: Describe the bug fix. * tests/sort/Test.pm (obs-inval): Add a test for today's fix.
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering1-1/+1
2007-05-13Remove the generated tests/*/Makefile.am files from version control.Jim Meyering1-99/+0
* tests/cut/Makefile.am: git-remove this generated file. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise. * .cvsignore, .gitignore: Ignore these generated files. * src/.cvsignore, src/.gitignore: Add chcon here, ... * .cvsignore, .gitignore: ... not here.
2007-01-26merge from trunkJim Meyering2-35/+41
2007-01-13Put CU_TEST_NAME in the environment for each test run by "make check".Jim Meyering1-0/+1
* Transform all Makefile.am files so that when running "make check", CU_TEST_NAME is set to the name of the test. This is so that when I run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" on the entire package it is more convenient to map a leak or error found in a valgrind log file back to the offending test. Use this command: (echo tests/Makefile.am.in; find tests -name Makefile.am) \ |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2006-12-13Remove some arbitrary restrictions on size fields,Paul Eggert2-2/+5
so that commands like "sort -k 18446744073709551616" no longer fail merely because 18446744073709551616 doesn't fit in uintmax_t. The trick is that these fields can all be treated as effectively infinity; their exact values don't matter, since no internal buffer can be that long. * src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX if the code assumes this. Silently truncate too-large values to SIZE_MAX, as the remaining code will do the right thing in this case. * src/sort.c (parse_field_count): Likewise. * src/uniq.c (size_opt, main): Likewise. * tests/join/Test.pm (bigfield): New test. * tests/sort/Test.pm (bigfield): New test. * tests/uniq/Test.pm (121): New test. Signed-off-by: Jim Meyering <jim@meyering.net>
2006-08-22* aclocal.m4, config.hin, configure:Paul Eggert1-5/+4
Remove from CVS, since ./bootstrap generates them automatically. * .cvsignore: Add INSTALL, Makefile.in, *.cache, *.lineno, *.log. Remove more-specific entries. This catches files like configure.lineno. * man/.cvsignore: Add Makefile.in. * src/.cvsignore: Add Makefile.in. Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c. For .cvsignore file under the tests directory: Add Makefile.in. Sort entries if necessary. Remove *.I, *.E, *.X, *.O, *-tests, build-script, mk-script if they're never created in this directory. * build-aux/.cvsignore: New file. * doc/.cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf, coreutils.ps, coreutils.tps. Remove coreutils.cm (dunno what it is, but the makefile doesn't mention it). Remove coreutils.info as it is subsumed by coreutils.info*. * lib/.cvsignore: Add Makefile.in, getdate.tab.h. Remove stat.c, sysexit.h. * m4/.cvsignore: Remove Makefile, dev-ino.m4, glibc2.m4, intdiv0.m4, inttypes-h.m4, inttypes-pri.m4, jm-glibc-io.m4, lcmessage.m4, lock.m4, printf-posix.m4, same-inode.m4, size_max.m4, uintmax_t.m4, ulonglong.m4, visibility.m4, xsize.m4. Many of these are put in automatically by ../bootstrap, but that's a bootstrap bug that I plan to fix shortly. * po/.cvsignore: More ../bootstrap-related fixes, plus remove old cruft. Add *.po, LINGUAS, Makevars. Remove *.cat, *.msg, cat-id-dbl.c, messages.mo, stamp-cat-id.
2006-08-21Remove from CVS, since the bootstrap script generates them automatically.Paul Eggert1-660/+0
2006-08-19.Jim Meyering1-1/+22
2006-08-19Some of my 2006-07-03 changes to tests/*/Makefile.am were beingJim Meyering1-3/+4
backed out due to updates provoked by the copyright changes. * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that it propagates to the derived Makefile.am files. ($(srcdir)/Makefile.am): Mark generated .am files as read-only, so we don't mistakenly edit them again. * tests/cut/Makefile.am: Regenerate. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise.
2006-08-17Add/fix copyright notices and adjust to latest GNU FDL.Paul Eggert2-1/+39
2006-08-15.Jim Meyering1-39/+46
2006-08-09Regenerate.Paul Eggert1-13/+15
2006-08-09Regenerate.Paul Eggert1-34/+36
2006-07-17Regenerate.Paul Eggert1-36/+35
2006-07-09Regenerate.Paul Eggert1-40/+62
2006-07-03* tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):Jim Meyering1-1/+1
Add $VG_PATH_PREFIX as a prefix to $PATH
2006-05-06.Jim Meyering1-2/+0
2006-03-26.Jim Meyering1-3/+4
2006-03-12.Jim Meyering1-6/+6
2006-02-20.Jim Meyering1-5/+7
2006-01-12.Jim Meyering1-5/+8
2006-01-04.Jim Meyering1-14/+14
2005-12-21.Jim Meyering1-1/+2