Skip to content

Commit 5966184

Browse files
committed
std: only test dlsym! on platforms where it is actually used
`dlsym` doesn't work for finding libc symbols on platforms like linux-musl, so the test will fail.
1 parent 82f5cdf commit 5966184

File tree

1 file changed

+10
-0
lines changed
  • library/std/src/sys/pal/unix/weak

1 file changed

+10
-0
lines changed

library/std/src/sys/pal/unix/weak/tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
use super::*;
22

33
#[test]
4+
#[cfg(any(
5+
target_vendor = "apple",
6+
all(target_os = "linux", target_env = "gnu"),
7+
target_os = "freebsd",
8+
))]
49
fn dlsym_existing() {
510
const TEST_STRING: &'static CStr = c"Ferris!";
611

@@ -22,6 +27,11 @@ fn dlsym_existing() {
2227
}
2328

2429
#[test]
30+
#[cfg(any(
31+
target_vendor = "apple",
32+
all(target_os = "linux", target_env = "gnu"),
33+
target_os = "freebsd",
34+
))]
2535
fn dlsym_missing() {
2636
// Try to find a symbol that definitely does not exist.
2737
dlsym! {

0 commit comments

Comments
 (0)