diff options
Diffstat (limited to 'libc-test')
-rw-r--r-- | libc-test/Cargo.toml | 5 | ||||
-rwxr-xr-x | libc-test/build.rs | 19 | ||||
-rw-r--r-- | libc-test/semver/android.txt | 1 | ||||
-rw-r--r-- | libc-test/semver/linux.txt | 1 | ||||
-rw-r--r-- | libc-test/test/linux_if_arp.rs | 12 |
5 files changed, 37 insertions, 1 deletions
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 7b8bae6efd..2eb5a0870d 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -37,6 +37,11 @@ path = "test/linux_fcntl.rs" harness = false [[test]] +name = "linux-if-arp" +path = "test/linux_if_arp.rs" +harness = false + +[[test]] name = "linux-ipv6" path = "test/linux_ipv6.rs" harness = false diff --git a/libc-test/build.rs b/libc-test/build.rs index 653b83164e..e4f3a54e41 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2703,6 +2703,9 @@ fn test_linux(target: &str) { | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => true, + // The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests + // because including `linux/if_arp.h` causes some conflicts: + "ARPHRD_CAN" => true, // Require Linux kernel 5.1: "F_SEAL_FUTURE_WRITE" => true, @@ -3064,7 +3067,6 @@ fn test_linux_like_apis(target: &str) { cfg.header("elf.h"); cfg.skip_fn(|_| true) .skip_static(|_| true) - .skip_fn(|_| true) .skip_const(|_| true) .type_name(move |ty, _is_struct, _is_union| ty.to_string()) .skip_struct(move |ty| match ty { @@ -3077,6 +3079,21 @@ fn test_linux_like_apis(target: &str) { }); cfg.generate("../src/lib.rs", "linux_elf.rs"); } + + if linux || android { + // Test `ARPHRD_CAN`. + let mut cfg = ctest_cfg(); + cfg.header("linux/if_arp.h"); + cfg.skip_fn(|_| true) + .skip_static(|_| true) + .skip_const(move |name| match name { + "ARPHRD_CAN" => false, + _ => true, + }) + .skip_struct(|_| true) + .skip_type(|_| true); + cfg.generate("../src/lib.rs", "linux_if_arp.rs"); + } } fn which_freebsd() -> Option<i32> { diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 117d50e361..bd89dd1e6a 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -69,6 +69,7 @@ ARPHRD_ASH ARPHRD_ATM ARPHRD_AX25 ARPHRD_BIF +ARPHRD_CAN ARPHRD_CHAOS ARPHRD_CISCO ARPHRD_CSLIP diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 128e9d9c1c..76de49a8ce 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -92,6 +92,7 @@ ARPHRD_ASH ARPHRD_ATM ARPHRD_AX25 ARPHRD_BIF +ARPHRD_CAN ARPHRD_CHAOS ARPHRD_CISCO ARPHRD_CSLIP diff --git a/libc-test/test/linux_if_arp.rs b/libc-test/test/linux_if_arp.rs new file mode 100644 index 0000000000..50be071d45 --- /dev/null +++ b/libc-test/test/linux_if_arp.rs @@ -0,0 +1,12 @@ +#![allow(bad_style, improper_ctypes, unused, deprecated)] + +extern crate libc; +use libc::*; + +#[cfg(any(target_os = "linux", target_os = "android"))] +include!(concat!(env!("OUT_DIR"), "/linux_if_arp.rs")); + +#[cfg(not(any(target_os = "linux", target_os = "android")))] +fn main() { + println!("PASSED 0 tests"); +} |