Commit graph

133 commits

Author SHA1 Message Date
Laurent Cheylus
de742e905b
tests: disable failed tests for tail on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:19 +02:00
n4n5
ab67947321
fix clippy tests 2024-06-30 16:27:08 +02:00
Sylvestre Ledru
09e53f3d2d tests: fix some clippy warnings 2024-05-25 09:06:16 +02:00
Daniel Hofstetter
a816960c33 tests: remove 'target_pointer_width = "128"' 2024-05-20 23:27:53 +02:00
Daniel Hofstetter
320bdcf29e tail: remove useless use of vec! in test 2024-05-12 15:32:24 +02:00
Daniel Hofstetter
692cdfac34 cp/tail: use #[ignore] to disable tests
instead of a cfg attribute
2024-05-12 15:15:44 +02:00
Daniel Hofstetter
0ad7389b61 tail: remove #[cfg(not(windows))] from const 2024-05-09 15:28:34 +02:00
Daniel Hofstetter
aef7933d96 tail: use #[ignore] to disable tests
instead of a cfg attribute
2024-05-09 15:07:10 +02:00
Sylvestre Ledru
13cfe2d8e5 test: replace at.write by at.touch 2024-04-21 13:23:24 +02:00
Sylvestre Ledru
3a72d5c5cb test tail: replace fixtures by at for consistency 2024-04-21 13:20:38 +02:00
Ben Wiederhake
88a2ea4f3b tail: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Sylvestre Ledru
f0286eb77d tail: allow multiple usage of --pid to match upstream (regression of 9.5)
tested by tests/tail/pid
2024-03-30 07:28:31 +01:00
Daniel Hofstetter
91b19b7c56 cp,tail: fix warnings in tests on Android 2023-11-05 13:56:39 +01:00
Terts Diepraam
c3f9e19a3b all: normalize license notice in all *.rs files 2023-08-24 12:21:09 +02:00
Daniel Hofstetter
5d03d2d9d4 clippy: fix warnings introduced by Rust 1.71.0 2023-07-13 17:35:33 +02:00
Sylvestre Ledru
7a7842b5b8
Merge pull request #4756 from Joining7943/tail-refactor-and-fix-input
`tail`: Refactor `paths::Input::from` and `Settings::inputs`
2023-07-03 14:09:57 +02:00
Daniel Hofstetter
b248b9d34c tail: disable some tests on Android 2023-05-27 08:02:03 +02:00
Joining7943
c6f6c87780 tests/tail: Change static global variables to const 2023-04-23 23:11:40 +02:00
Joining7943
ae60045f3f tail: Fix printed header for stdin should be the same on all platforms 2023-04-21 21:55:28 +02:00
Joining7943
20e32971dd tail/args: Fix parsing when -F is used together with --retry or --follow 2023-04-18 21:47:20 +02:00
Daniel Hofstetter
7a888da409 tests: remove all "extern crate" statements 2023-04-10 08:31:31 +02:00
Daniel Hofstetter
0140f4f7d0 tests: fix "unresolved import" warnings on Windows 2023-03-20 16:26:31 +01:00
Daniel Hofstetter
94aeba9854 tests: fix unused imports warnings on Windows 2023-03-20 16:06:56 +01:00
Daniel Hofstetter
6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Joining7943
946aab37ed Cargo: Bump fundu version v0.3.0 -> v0.4.2. Adjust test in test_tail. 2023-03-12 15:37:44 +01:00
Benjamin Bara
9b49f368c7 tail: parse default before obsolete 2023-02-28 18:58:12 +01:00
Benjamin Bara
f6edea2d05 tail: enable non-utf8 paths 2023-02-28 18:58:12 +01:00
Benjamin Bara
dc34e89d50 tail: skip clap for obsolete args 2023-02-28 18:58:12 +01:00
Benjamin Bara
b83c30b12e tail: improve GNU compatibility 2023-02-28 18:58:12 +01:00
Joining7943
0ed6a9f882 tail: Fix parsing of sleep interval. Use duration parser from fundu crate.
Activate tests for parsing sleep interval
2023-02-12 20:23:55 +01:00
Joining7943
c809bb3888 tests/tail: Disable test_follow_with_pid on freebsd because of intermittent failures in the ci 2023-01-28 13:02:33 +01:00
Daniel Hofstetter
f6b646e4e5 clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00
Joining7943
1fadeb43b2 tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr`
produces too many newlines.
2023-01-22 14:56:19 +01:00
Joining7943
463c58afd0 tests/tail: Remove redundant set_stdin(Stdio::null()) 2023-01-03 16:30:12 +01:00
Joining7943
9b35c5d5c1 tests/util: Use Stdio::null as default in UCommand for Child stdin instead of Stdio::piped 2023-01-03 16:30:08 +01:00
Joining7943
b339f6d80c tests/tail: Add all additional tests written during refactoring tail from tip of refactoring branch
Other changes summmary:
* Use module level imports instead of fully qualified imports where appropriate
* Fix intermittent failing test_positive_zero_bytes because of broken pipe
* Cleanup old disabled test for warning of following indefinitely
2022-12-13 16:16:14 +01:00
Joining7943
d57545d09c tail: Refactor: Handle warnings and early exits in one place. Remove InputService ...
Other changes summary:
* Cleanup imports
* Remove stdin_is_pipe_of_fifo function
* Rename WatcherService to Observer
2022-12-13 16:16:08 +01:00
Joining7943
4a2ced5940 tests: Adjust some tests to use improved UChild. test_tac: Ignore pipe tests on windows.
Summary:
* Disable test_retry6 on android because of intermittent failures
* Use wait() instead of wait_with_output in test_cat, test_cp, test_sort
* tests/sort: Simplify usage of test_sigpipe_panic
* Fix tests in test_tee.

tests/tac:
There was a change in the `tests/common/util.rs` test api concerning piped input which may have
revealed a bug in the implementation of tac. Please see also
https://github.com/uutils/coreutils/pull/4136
2022-12-02 13:13:10 +01:00
Joining7943
4f54eedb74 tests/util: Improve UChild. Cleanup redundant functions in util.rs.
A short summary of changes:

* Add some basic tests for UChild and the run methods.
* Try more often in a fixed interval to create the tempfile for CapturedOutput.
* Fix drop order of struct fields for better cleanup of temporary files/dirs.
* Mark UChild::wait_with_output and UChild::pipe_in_and_wait_with_output deprecated
* Make CapturedOutput private
* Panic in stdout_all, stdout_all_bytes etc. if output is not captured.
* Rename some methods, refactor, clean up, fix documentation, add try_... methods
2022-12-02 08:06:48 +01:00
Joining7943
982fb682e9 tests: Use UChild in tests. Rename run_no_wait_child to run_no_wait and return UChild
tests/tail:
* test_stdin_redirect_file:. Test fails now when assert_alive()!
The follow test `tail -f < file` where file's content is `foo` fails with:
    Assertion failed. Expected 'tail' to be running but exited with status=exit status: 0

I also tried on the command line and can confirm that tail isn't runnning when following by
descriptor. The test is deactivated until the implementation is fixed.

* test_follow_stdin_descriptor
* test_follow_stdin_explicit_indefinitely.
* test_follow_single
* test_follow_non_utf8_bytes
* test_follow_multiple
* test_follow_name_multiple
* test_follow_invalid_pid
* test_single_big_args
* test_retry3
* test_retry4
* test_retry5
* test_retry7
* test_retry8
* test_retry9
* test_follow_descriptor_vs_rename1
* test_follow_descriptor_vs_rename2
* test_follow_name_retry_headers
* test_follow_name_remove
* test_follow_name_truncate1
* test_follow_name_truncate2
* test_follow_name_truncate3
* test_follow_name_truncate4
* test_follow_truncate_fast
* test_follow_name_move_create1
* test_follow_name_move_create2
* test_follow_name_move1
* test_follow_name_move2
* test_follow_name_move_retry1
* test_follow_name_move_retry2
* test_follow_inotify_only_regular
* test_fifo
* test_illegal_seek

tests/cat:
* test_dev_full
* test_dev_full_show_all
* test_dev_random
* test_fifo_symlink

tests/dd:
* test_random_73k_test_lazy_fullblock
* test_sync_delayed_reader

tests/factor:
* test_parallel

tests/rm:
* test_rm_force_prompts_order
* test_rm_descend_directory
* test_rm_prompts

tests/seq:
* the helper run method

tests/sort:
* test_sigpipe_panic

tests/tee:
* the helper run_tee method

tests/tty:
* test_tty module

tests/yes:
* the helper run method
2022-12-02 08:06:45 +01:00
Joining7943
040a5e8301 tests/util: Implement UChild. UCommand: implement stderr_to_stdout, capture output as default
See pr #4136 (https://github.com/uutils/coreutils/pull/4136)
2022-12-02 08:05:05 +01:00
Joining7943
9b446bf261 tests/tail: Fix clippy warning same-item-push. Do not push same flag twice. 2022-12-02 08:05:05 +01:00
Daniel Hofstetter
9a2174ba02 chore: standardize creation of empty strings 2022-12-01 13:49:23 +01:00
Joining7943
1725151ef8 tests/tail: Fix tests to reflect changes from the refactoring #3905 2022-10-05 13:32:35 +02:00
Joining7943
c32d61dcfb tests/tail: Add system tests for ---presume-input-pipe 2022-09-21 16:39:52 +02:00
Joining7943
951c51e740 tail: large refactoring and cleanup of the tail code base. See also #3905 for details 2022-09-13 22:54:36 +02:00
Terts Diepraam
9177cb7b24 all: add tests for usage error exit code 2022-09-10 20:59:42 +02:00
Joining7943
2658f8ae5b tail: improve performance of piped stdin
Rewrite handling of stdin when it is piped and read input in chunks.

Fixes https://github.com/uutils/coreutils/issues/3842
2022-09-09 13:51:37 +02:00
Jan Scheer
88d3aee71c tail: fix offset for stdin redirect if multiple input files 2022-09-05 10:09:04 +02:00
Jan Scheer
74f359bd76 tail: use same-file crate to get a handle of stdin redirected file 2022-09-05 10:09:04 +02:00