Skip to content

Commit 95728d1

Browse files
Ulrich Hornungcre4ture
Ulrich Hornung
authored andcommitted
fix FixMEs for freebsd (reduced binary size)
1 parent 58a32ab commit 95728d1

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

tests/by-util/test_install.rs

+10-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::common::util::{is_ci, run_ucmd_as_root, TestScenario};
88
use filetime::FileTime;
99
use std::fs;
1010
use std::os::unix::fs::{MetadataExt, PermissionsExt};
11-
#[cfg(not(any(windows, target_os = "freebsd")))]
11+
#[cfg(not(windows))]
1212
use std::process::Command;
1313
#[cfg(any(target_os = "linux", target_os = "android"))]
1414
use std::thread::sleep;
@@ -610,13 +610,17 @@ fn test_install_copy_then_compare_file_with_extra_mode() {
610610
}
611611

612612
const STRIP_TARGET_FILE: &str = "helloworld_installed";
613-
#[cfg(not(any(windows, target_os = "freebsd")))]
613+
#[cfg(all(not(windows), not(target_os = "freebsd")))]
614614
const SYMBOL_DUMP_PROGRAM: &str = "objdump";
615-
#[cfg(not(any(windows, target_os = "freebsd")))]
615+
#[cfg(target_os = "freebsd")]
616+
const SYMBOL_DUMP_PROGRAM: &str = "llvm-objdump";
617+
#[cfg(not(windows))]
616618
const STRIP_SOURCE_FILE_SYMBOL: &str = "main";
617619

618620
fn strip_source_file() -> &'static str {
619-
if cfg!(target_os = "macos") {
621+
if cfg!(target_os = "freebsd") {
622+
"helloworld_freebsd"
623+
} else if cfg!(target_os = "macos") {
620624
"helloworld_macos"
621625
} else if cfg!(target_arch = "arm") || cfg!(target_arch = "aarch64") {
622626
"helloworld_android"
@@ -626,8 +630,7 @@ fn strip_source_file() -> &'static str {
626630
}
627631

628632
#[test]
629-
// FixME: Freebsd fails on 'No such file or directory'
630-
#[cfg(not(any(windows, target_os = "freebsd")))]
633+
#[cfg(not(windows))]
631634
fn test_install_and_strip() {
632635
let scene = TestScenario::new(util_name!());
633636
let at = &scene.fixtures;
@@ -650,8 +653,7 @@ fn test_install_and_strip() {
650653
}
651654

652655
#[test]
653-
// FixME: Freebsd fails on 'No such file or directory'
654-
#[cfg(not(any(windows, target_os = "freebsd")))]
656+
#[cfg(not(windows))]
655657
fn test_install_and_strip_with_program() {
656658
let scene = TestScenario::new(util_name!());
657659
let at = &scene.fixtures;
@@ -677,8 +679,6 @@ fn test_install_and_strip_with_program() {
677679

678680
#[cfg(all(unix, feature = "chmod"))]
679681
#[test]
680-
// FixME: Freebsd fails on 'No such file or directory'
681-
#[cfg(not(target_os = "freebsd"))]
682682
fn test_install_and_strip_with_program_hyphen() {
683683
let scene = TestScenario::new(util_name!());
684684

@@ -717,8 +717,6 @@ fn test_install_and_strip_with_program_hyphen() {
717717

718718
#[cfg(all(unix, feature = "chmod"))]
719719
#[test]
720-
// FixME: Freebsd fails on 'No such file or directory'
721-
#[cfg(not(target_os = "freebsd"))]
722720
fn test_install_on_invalid_link_at_destination() {
723721
let scene = TestScenario::new(util_name!());
724722

@@ -748,8 +746,6 @@ fn test_install_on_invalid_link_at_destination() {
748746

749747
#[cfg(all(unix, feature = "chmod"))]
750748
#[test]
751-
// FixME: Freebsd fails on 'No such file or directory'
752-
#[cfg(not(target_os = "freebsd"))]
753749
fn test_install_on_invalid_link_at_destination_and_dev_null_at_source() {
754750
let scene = TestScenario::new(util_name!());
755751

307 KB
Binary file not shown.

0 commit comments

Comments
 (0)