File tree 2 files changed +13
-1
lines changed
crates/cargo-test-macro/src
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,16 @@ fn has_command(command: &str) -> bool {
221
221
}
222
222
} ;
223
223
if !output. status . success ( ) {
224
+ // `strings` from Apple Xcode toolchain doesn't have `--version` flag.
225
+ // If we see "unknown flag" then we've found its existence!
226
+ if command == "strings"
227
+ && String :: from_utf8 ( output. stdout . clone ( ) )
228
+ . expect ( "utf8" )
229
+ . find ( "unknown flag" )
230
+ . is_some ( )
231
+ {
232
+ return true ;
233
+ }
224
234
panic ! (
225
235
"expected command `{}` to be runnable, got error {}:\n \
226
236
stderr:{}\n \
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ warning: unused variable: `unused`
447
447
. run ( ) ;
448
448
}
449
449
450
- #[ cfg( target_os = "linux" ) ]
450
+ #[ cfg( unix ) ]
451
451
#[ cargo_test( requires_strings, nightly, reason = "-Zremap-path-scope is unstable" ) ]
452
452
fn object_works ( ) {
453
453
use std:: os:: unix:: ffi:: OsStrExt ;
@@ -541,5 +541,7 @@ fn object_works() {
541
541
let stdout = run_strings ( bin_path) . stdout ;
542
542
assert ! ( memchr:: memmem:: find( & stdout, rust_src) . is_none( ) ) ;
543
543
assert ! ( memchr:: memmem:: find( & stdout, registry_src_bytes) . is_none( ) ) ;
544
+ // TODO: on macOS codegen unit partitions `.rcgu.o` are still there.
545
+ #[ cfg( not( target_os = "macos" ) ) ]
544
546
assert ! ( memchr:: memmem:: find( & stdout, pkg_root) . is_none( ) ) ;
545
547
}
You can’t perform that action at this time.
0 commit comments