From 664a85fd9783bca066926ae19ff0a5f8578838f4 Mon Sep 17 00:00:00 2001 From: Arslan-TR Date: Sun, 25 Oct 2026 18:22:52 +0300 Subject: [PATCH] tests: fix more, stty and nohup compilation on redox pty_path is not available on redox, so gate the PTY-based more and stty tests accordingly, and only import at_and_ucmd in the nohup test that uses it. --- tests/by-util/test_more.rs | 2 ++ tests/by-util/test_nohup.rs | 4 +++- tests/by-util/test_stty.rs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_more.rs b/tests/by-util/test_more.rs index 1fc51d068dd..ed57691e159 100644 --- a/tests/by-util/test_more.rs +++ b/tests/by-util/test_more.rs @@ -3,6 +3,8 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#![cfg(all(unix, not(target_os = "redox")))] + #[cfg(unix)] use std::fs::File; #[cfg(unix)] diff --git a/tests/by-util/test_nohup.rs b/tests/by-util/test_nohup.rs index 778cbb3af15..98ff0dd9fb9 100644 --- a/tests/by-util/test_nohup.rs +++ b/tests/by-util/test_nohup.rs @@ -9,7 +9,7 @@ use std::thread::sleep; use uutests::new_ucmd; #[cfg(unix)] -use uutests::{at_and_ucmd, util::TestScenario, util_name}; +use uutests::{util::TestScenario, util_name}; // General observation: nohup.out will not be created in tests run by cargo test // because stdin/stdout is not attached to a TTY. @@ -38,6 +38,8 @@ fn test_nohup_exit_codes() { target_os = "openbsd" ))] fn test_nohup_multiple_args_and_flags() { + use uutests::at_and_ucmd; + let (at, mut ucmd) = at_and_ucmd!(); ucmd.args(&["touch", "-t", "1006161200", "file1", "file2"]) diff --git a/tests/by-util/test_stty.rs b/tests/by-util/test_stty.rs index 157758db903..2161074d9b6 100644 --- a/tests/by-util/test_stty.rs +++ b/tests/by-util/test_stty.rs @@ -5,7 +5,7 @@ // spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh econl igpar ispeed ospeed NCCS nonhex gstty notachar cbreak evenp oddp CSIZE -#![cfg(unix)] +#![cfg(all(unix, not(target_os = "redox")))] use uutests::util::{expected_result, pty_path}; use uutests::{at_and_ts, new_ucmd, unwrap_or_return};