Skip to content

Commit

Permalink
Make tests for bsd passed
Browse files Browse the repository at this point in the history
* Include some header files
* Ingore tests for p_type field of `Elf*_Phdr` because of
  conflicting with p_type macro from resolve.h
  • Loading branch information
tesuji committed Oct 25, 2020
1 parent dbf50c9 commit 2058e37
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ fn test_openbsd(target: &str) {
cfg.flag("-Wno-deprecated-declarations");

headers! { cfg:
"elf.h",
"errno.h",
"fcntl.h",
"limits.h",
"link.h",
"locale.h",
"stddef.h",
"stdint.h",
Expand Down Expand Up @@ -387,7 +389,9 @@ fn test_openbsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "DIR" | "Dl_info" => ty.to_string(),
"FILE" | "DIR" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => {
ty.to_string()
}

// OSX calls this something else
"sighandler_t" => "sig_t".to_string(),
Expand Down Expand Up @@ -870,9 +874,11 @@ fn test_netbsd(target: &str) {

headers! {
cfg:
"elf.h",
"errno.h",
"fcntl.h",
"limits.h",
"link.h",
"locale.h",
"stddef.h",
"stdint.h",
Expand Down Expand Up @@ -1633,6 +1639,7 @@ fn test_freebsd(target: &str) {
"ctype.h",
"dirent.h",
"dlfcn.h",
"elf.h",
"errno.h",
"fcntl.h",
"glob.h",
Expand All @@ -1641,6 +1648,7 @@ fn test_freebsd(target: &str) {
"langinfo.h",
"libutil.h",
"limits.h",
"link.h",
"locale.h",
"machine/reg.h",
"mqueue.h",
Expand Down Expand Up @@ -1709,7 +1717,8 @@ fn test_freebsd(target: &str) {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(),
"FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
| "Elf64_Phdr" => ty.to_string(),

// FIXME: https://github.com/rust-lang/libc/issues/1273
"sighandler_t" => "sig_t".to_string(),
Expand Down Expand Up @@ -1909,6 +1918,10 @@ fn test_freebsd(target: &str) {
// `void*`:
("stack_t", "ss_sp") if Some(10) == freebsd_ver => true,

// There "p_type" macro defined in `resolv.h`.
("Elf32_Phdr", "p_type") => true,
("Elf64_Phdr", "p_type") => true,

_ => false,
}
});
Expand Down

0 comments on commit 2058e37

Please sign in to comment.