summaryrefslogtreecommitdiffstats
path: root/tests/by-util
diff options
context:
space:
mode:
authorLaurent Cheylus <foxy@free.fr>2024-07-06 22:29:20 +0200
committerLaurent Cheylus <foxy@free.fr>2024-07-06 22:45:10 +0200
commit008dd38a0da00d698230e422afa2a0e39f41c397 (patch)
treeab2bb145495ab1f16f40a6d44a43f65647e99a41 /tests/by-util
parentc25ba39ce62a91c70181fcbf8f8df47f7b180592 (diff)
tests: fix warnings on OpenBSD for unused imports in by-util/test_*
Signed-off-by: Laurent Cheylus <foxy@free.fr>
Diffstat (limited to 'tests/by-util')
-rw-r--r--tests/by-util/test_du.rs3
-rw-r--r--tests/by-util/test_install.rs1
-rw-r--r--tests/by-util/test_ls.rs1
-rw-r--r--tests/by-util/test_nohup.rs1
-rw-r--r--tests/by-util/test_pinky.rs4
5 files changed, 10 insertions, 0 deletions
diff --git a/tests/by-util/test_du.rs b/tests/by-util/test_du.rs
index 103a504b4..ef6179e02 100644
--- a/tests/by-util/test_du.rs
+++ b/tests/by-util/test_du.rs
@@ -11,11 +11,14 @@ use regex::Regex;
use crate::common::util::expected_result;
use crate::common::util::TestScenario;
+#[cfg(not(target_os = "openbsd"))]
const SUB_DIR: &str = "subdir/deeper";
const SUB_DEEPER_DIR: &str = "subdir/deeper/deeper_dir";
const SUB_DIR_LINKS: &str = "subdir/links";
const SUB_DIR_LINKS_DEEPER_SYM_DIR: &str = "subdir/links/deeper_dir";
+#[cfg(not(target_os = "openbsd"))]
const SUB_FILE: &str = "subdir/links/subwords.txt";
+#[cfg(not(target_os = "openbsd"))]
const SUB_LINK: &str = "subdir/links/sublink.txt";
#[test]
diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs
index a21cc52fd..c00c5a5db 100644
--- a/tests/by-util/test_install.rs
+++ b/tests/by-util/test_install.rs
@@ -5,6 +5,7 @@
// spell-checker:ignore (words) helloworld nodir objdump n'source
use crate::common::util::{is_ci, run_ucmd_as_root, TestScenario};
+#[cfg(not(target_os = "openbsd"))]
use filetime::FileTime;
use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt};
diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs
index 386e81e79..2e3f31290 100644
--- a/tests/by-util/test_ls.rs
+++ b/tests/by-util/test_ls.rs
@@ -15,6 +15,7 @@ use crate::common::util::TestScenario;
#[cfg(all(unix, feature = "chmod"))]
use nix::unistd::{close, dup};
use regex::Regex;
+#[cfg(not(target_os = "openbsd"))]
use std::collections::HashMap;
#[cfg(target_os = "linux")]
use std::ffi::OsStr;
diff --git a/tests/by-util/test_nohup.rs b/tests/by-util/test_nohup.rs
index db19114b6..028e29166 100644
--- a/tests/by-util/test_nohup.rs
+++ b/tests/by-util/test_nohup.rs
@@ -4,6 +4,7 @@
// file that was distributed with this source code.
// spell-checker:ignore winsize Openpty openpty xpixel ypixel ptyprocess
use crate::common::util::TestScenario;
+#[cfg(not(target_os = "openbsd"))]
use std::thread::sleep;
// General observation: nohup.out will not be created in tests run by cargo test
diff --git a/tests/by-util/test_pinky.rs b/tests/by-util/test_pinky.rs
index 0fff402df..93f265cc7 100644
--- a/tests/by-util/test_pinky.rs
+++ b/tests/by-util/test_pinky.rs
@@ -3,8 +3,12 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
+#[cfg(target_os = "openbsd")]
+use crate::common::util::TestScenario;
+#[cfg(not(target_os = "openbsd"))]
use crate::common::util::{expected_result, TestScenario};
use pinky::Capitalize;
+#[cfg(not(target_os = "openbsd"))]
use uucore::entries::{Locate, Passwd};
#[test]