Skip to content

Commit 7d6d6c1

Browse files
committed
WIP: disable test for Elf64_Phdr
1 parent 339161c commit 7d6d6c1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

libc-test/build.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,6 +2473,10 @@ fn test_linux(target: &str) {
24732473
// FIXME: is this necessary?
24742474
"sighandler_t" => true,
24752475

2476+
// These cannot be tested when "resolv.h" is included and are tested
2477+
// below.
2478+
"Elf64_Phdr" | "Elf32_Phdr" => true,
2479+
24762480
_ => false,
24772481
}
24782482
});
@@ -2482,6 +2486,10 @@ fn test_linux(target: &str) {
24822486
// FIXME: is this necessary?
24832487
"sockaddr_nl" if musl => true,
24842488

2489+
// These cannot be tested when "resolv.h" is included and are tested
2490+
// below.
2491+
"Elf64_Phdr" | "Elf32_Phdr" => true,
2492+
24852493
// On Linux, the type of `ut_tv` field of `struct utmpx`
24862494
// can be an anonymous struct, so an extra struct,
24872495
// which is absent in glibc, has to be defined.
@@ -2810,4 +2818,27 @@ fn test_linux(target: &str) {
28102818
t => t.to_string(),
28112819
});
28122820
cfg.generate("../src/lib.rs", "linux_fcntl.rs");
2821+
2822+
// Test Elf64_Phdr and Elf32_Phdr
2823+
// These types have a field called `p_type`, but including
2824+
// "resolve.h" defines a `p_type` macro that expands to `__p_type`
2825+
// making the tests for these fails when both are included.
2826+
let mut cfg = ctest::TestGenerator::new();
2827+
cfg.skip_fn(|_| true)
2828+
.skip_const(|_| true)
2829+
.skip_static(|_| true);
2830+
cfg.skip_struct(move |ty| {
2831+
match ty {
2832+
"Elf64_Phdr" | "Elf32_Phdr" => false,
2833+
_ => true,
2834+
}
2835+
});
2836+
cfg.skip_type(move |ty| {
2837+
match ty {
2838+
"Elf64_Phdr" | "Elf32_Phdr" => false,
2839+
_ => true,
2840+
}
2841+
});
2842+
cfg.header("linux/elf.h");
2843+
cfg.generate("../src/lib.rs", "linux_elf.rs");
28132844
}

0 commit comments

Comments
 (0)