Commit Graph
48 Commits
Author SHA1 Message Date
xtqqczzeandDaniel Hofstetter 57135cb9bd refactor: replace rustix::pipe with std::io::pipe 2026-05-19 16:11:49 +02:00
oech3andDaniel Hofstetter 0ca9039fd7 tee: remove unsafe from test code 2026-04-27 09:16:56 +02:00
Kevin BurkeandSylvestre Ledru b17025b663 tee: add short-read regression test
Upstream commit 9f50c8b42 ("tee: fix input with sleep") already
contains the functional fix for short reads from a paused writer.
Keep the regression coverage so we do not reintroduce the bug.

The test writes one small chunk, waits long enough for a buggy tee to
exit, then writes a second chunk and asserts both stdout and the output
file receive both writes.
2026-04-13 07:37:50 +02:00
AnthonyandGitHub 36ac85b1f3 tests: add WASI integration test support via wasmtime 2026-04-12 15:19:04 +02:00
oech3andSylvestre Ledru 531991d344 tee: fix < . message and strip errno 2026-04-01 22:24:50 +02:00
Yuri AstrakhanandGitHub 3559049c24 chore: a few more Clippy fixes (#10697) 2026-02-04 08:09:47 +01:00
Sylvestre LedruandGitHub d94332468d tee: allow multiple -a flags (#10293)
Fixes issue where tee rejected multiple append flags with error
"the argument '--append' cannot be used multiple times".
GNU tee accepts multiple -a flags, so this adds compatibility.
2026-01-17 11:24:20 -08:00
Cả thế giới là RustandGitHub f86061076b tests(tee): Add GNU-compat write-error and broken-pipe tests (#4627) (#8797)
Add comprehensive test coverage for tee --output-error and broken pipe behavior:

- test_output_error_flag_without_value_defaults_warn_nopipe: Verify default behavior
- test_output_error_presence_only_broken_pipe_unix: Non-crash on SIGPIPE
- test_broken_pipe_early_termination_stdout_only: Early termination robustness
- test_write_failure_reports_error_and_nonzero_exit: Error reporting validation

These tests address remaining gaps from GNU test suite tests/misc/tee.sh and
tests/misc/write-errors.sh highlighted in #4627. Platform-specific guards
(#[cfg(unix)], FreeBSD exclusion) ensure cross-platform compatibility.
2025-10-04 21:20:54 +02:00
Dorian Peron 6e23d4e979 tests: patch tests to simplify imports 2025-07-01 03:36:46 +02:00
Daniel Hofstetter cccaba63c2 tee: move test to "linux_only" module 2025-06-19 09:42:22 +02:00
Maxim e354ddea02 tee: remove output buffering
To comply with POSIX standard `tee` implementation must not buffer
its output, so we replace std::io::copy implementation that does
buffering with the custom one.
2025-06-19 09:28:38 +09:00
Maxim 1613cdba10 tests/tee: move no_more_writable test to linux_only module 2025-06-19 00:37:26 +09:00
Maxim 7310c7fca1 tests/tee: enable no_more_writable test 2025-06-19 00:35:53 +09:00
Yuri Astrakhan 982805d3cd chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru a85539f530 Run cargo fmt on the tree 2025-03-24 21:33:12 +01:00
Sylvestre Ledru 18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Daniel Hofstetter be1b2b7632 tee: fix use of deprecated function in tests
use pipe_in_and_wait() instead of pipe_in_and_wait_with_output()
2025-02-22 16:21:08 +01:00
Dorian Peron e550e3d72e test(tee): Add test for broken pipe behavior with -p 2025-02-06 12:25:34 +01:00
Daniel Hofstetter 3281d3ef55 tee: fix warning from ref_as_ptr lint in test 2024-11-18 09:45:44 +01:00
n4n5 ab67947321 fix clippy tests 2024-06-30 16:27:08 +02:00
Sylvestre LedruandGitHub 4090d468c0 Merge pull request #6162 from BenWiederhake/dev-undo-custom-exit-codes
all: Undo custom exit codes
2024-04-25 08:11:41 +02:00
Ben Wiederhake 3854569856 tee: ensure that -h and --help are identical 2024-04-14 15:42:13 +02:00
Ben Wiederhake 25245bde65 tee: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Ben Wiederhake 8ab825c49f tee: correctly handle writing to read-only files 2024-03-31 18:47:32 +02:00