diff --git a/tests/by-util/test_cat.rs b/tests/by-util/test_cat.rs index 6fef828abe2..dc45b3605e2 100644 --- a/tests/by-util/test_cat.rs +++ b/tests/by-util/test_cat.rs @@ -484,9 +484,7 @@ fn test_domain_socket() { let child = new_ucmd!().args(&[socket_path]).run_no_wait(); barrier.wait(); - let stdout = &child.wait_with_output().unwrap().stdout; - let output = String::from_utf8_lossy(stdout); - assert_eq!("a\tb", output); + child.wait().unwrap().stdout_is("a\tb"); thread.join().unwrap(); } diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index 9ced1d130e9..e24df9ab279 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -2330,10 +2330,7 @@ fn test_copy_contents_fifo() { // At this point the child process should have terminated // successfully with no output. The `outfile` should have the // contents of `fifo` copied into it. - let output = child.wait_with_output().unwrap(); - assert!(output.status.success()); - assert!(output.stdout.is_empty()); - assert!(output.stderr.is_empty()); + child.wait().unwrap().no_stdout().no_stderr().success(); assert_eq!(at.read("outfile"), "foo"); } diff --git a/tests/by-util/test_sort.rs b/tests/by-util/test_sort.rs index 38dea5b72bf..6e71f266416 100644 --- a/tests/by-util/test_sort.rs +++ b/tests/by-util/test_sort.rs @@ -977,10 +977,7 @@ fn test_sigpipe_panic() { // Dropping the stdout should not lead to an error. // The "Broken pipe" error should be silently ignored. child.close_stdout(); - assert_eq!( - String::from_utf8(child.wait_with_output().unwrap().stderr), - Ok(String::new()) - ); + child.wait().unwrap().no_stderr(); } #[test] diff --git a/tests/by-util/test_tac.rs b/tests/by-util/test_tac.rs index 6f8a729899c..72fc185b9e6 100644 --- a/tests/by-util/test_tac.rs +++ b/tests/by-util/test_tac.rs @@ -7,6 +7,8 @@ fn test_invalid_arg() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_stdin_default() { new_ucmd!() .pipe_in("100\n200\n300\n400\n500") @@ -15,6 +17,8 @@ fn test_stdin_default() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_stdin_non_newline_separator() { new_ucmd!() .args(&["-s", ":"]) @@ -24,6 +28,8 @@ fn test_stdin_non_newline_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_stdin_non_newline_separator_before() { new_ucmd!() .args(&["-b", "-s", ":"]) @@ -76,11 +82,14 @@ fn test_invalid_input() { } #[test] +#[cfg(not(windows))] // FIXME: https://github.com/uutils/coreutils/issues/4204 fn test_no_line_separators() { new_ucmd!().pipe_in("a").succeeds().stdout_is("a"); } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_before_trailing_separator_no_leading_separator() { new_ucmd!() .arg("-b") @@ -90,6 +99,8 @@ fn test_before_trailing_separator_no_leading_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_before_trailing_separator_and_leading_separator() { new_ucmd!() .arg("-b") @@ -99,6 +110,8 @@ fn test_before_trailing_separator_and_leading_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_before_leading_separator_no_trailing_separator() { new_ucmd!() .arg("-b") @@ -108,6 +121,8 @@ fn test_before_leading_separator_no_trailing_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_before_no_separator() { new_ucmd!() .arg("-b") @@ -117,11 +132,15 @@ fn test_before_no_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_before_empty_file() { new_ucmd!().arg("-b").pipe_in("").succeeds().stdout_is(""); } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_multi_char_separator() { new_ucmd!() .args(&["-s", "xx"]) @@ -131,6 +150,8 @@ fn test_multi_char_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_multi_char_separator_overlap() { // The right-most pair of "x" characters in the input is treated as // the only line separator. That is, "axxx" is interpreted as having @@ -161,6 +182,8 @@ fn test_multi_char_separator_overlap() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_multi_char_separator_overlap_before() { // With the "-b" option, the line separator is assumed to be at the // beginning of the line. In this case, That is, "axxx" is @@ -203,6 +226,8 @@ fn test_multi_char_separator_overlap_before() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_null_separator() { new_ucmd!() .args(&["-s", ""]) @@ -212,6 +237,8 @@ fn test_null_separator() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_regex() { new_ucmd!() .args(&["-r", "-s", "[xyz]+"]) @@ -240,6 +267,8 @@ fn test_regex() { } #[test] +// FIXME: See https://github.com/uutils/coreutils/issues/4204 +#[cfg(not(windows))] fn test_regex_before() { new_ucmd!() .args(&["-b", "-r", "-s", "[xyz]+"]) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index 07c2d760a14..e59dcf3ea35 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -1404,8 +1404,12 @@ fn test_retry5() { } } +// intermittent failures on android with diff +// Diff < left / right > : +// ==> existing <== +// >X #[test] -#[cfg(not(target_os = "windows"))] // FIXME: for currently not working platforms +#[cfg(all(not(target_os = "windows"), not(target_os = "android")))] // FIXME: for currently not working platforms fn test_retry6() { // inspired by: gnu/tests/tail-2/retry.sh // Ensure that --follow=descriptor (without --retry) does *not* try @@ -3002,8 +3006,7 @@ fn test_pipe_when_lines_option_given_input_size_is_one_byte_greater_than_buffer_ // FIXME: windows: this test failed with timeout in the CI. Running this test in // a Windows VirtualBox image produces no errors. #[test] -// TODO: switch back on -// #[cfg(not(target_os = "windows"))] +#[cfg(not(target_os = "windows"))] fn test_pipe_when_lines_option_given_input_size_has_multiple_size_of_buffer_size() { let total_lines = 100; let random_string = RandomString::generate_with_delimiter( @@ -3310,8 +3313,7 @@ fn test_pipe_when_bytes_option_given_input_size_is_one_byte_greater_than_buffer_ // FIXME: windows: this test failed with timeout in the CI. Running this test in // a Windows VirtualBox image produces no errors. #[test] -// TODO: switch back on -// #[cfg(not(target_os = "windows"))] +#[cfg(not(target_os = "windows"))] fn test_pipe_when_bytes_option_given_input_size_has_multiple_size_of_buffer_size() { let random_string = RandomString::generate(AlphanumericNewline, CHUNK_BUFFER_SIZE * 3); let random_string = random_string.as_str(); diff --git a/tests/by-util/test_tee.rs b/tests/by-util/test_tee.rs index 1a555995d9f..5a2f26724ef 100644 --- a/tests/by-util/test_tee.rs +++ b/tests/by-util/test_tee.rs @@ -134,6 +134,7 @@ mod linux_only { #[allow(deprecated)] let output = proc + .ignore_stdin_write_error() .run_no_wait() .pipe_in_and_wait_with_output(content.as_bytes()); diff --git a/tests/common/util.rs b/tests/common/util.rs index 3873d888c59..3ae4dff4f1c 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -362,7 +362,6 @@ impl CmdResult { self.no_stderr().stdout_is_bytes(msg) } - // TODO: implement same functionality asserting as String instead /// like stdout_only(...), but expects the contents of the file at the provided relative path pub fn stdout_only_fixture>(&self, file_rel_path: T) -> &Self { let contents = read_scenario_fixture(&self.tmpd, file_rel_path);