Skip to content

Commit 5ede8aa

Browse files
committed
Enable disabled tests
1 parent 516f3ef commit 5ede8aa

File tree

2 files changed

+16
-150
lines changed

2 files changed

+16
-150
lines changed

libc-test/build.rs

Lines changed: 11 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,11 +1635,7 @@ fn test_emscripten(target: &str) {
16351635
assert!(target.contains("emscripten"));
16361636

16371637
let mut cfg = ctest::TestGenerator::new();
1638-
// FIXME: still necessary?
1639-
cfg.define("_GNU_SOURCE", None);
1640-
1641-
// FIXME: still necessary?
1642-
cfg.flag("-Wno-deprecated-declarations");
1638+
cfg.define("_GNU_SOURCE", None); // FIXME: ??
16431639

16441640
headers! { cfg:
16451641
"aio.h",
@@ -1732,11 +1728,7 @@ fn test_emscripten(target: &str) {
17321728
cfg.type_name(move |ty, is_struct, is_union| {
17331729
match ty {
17341730
// Just pass all these through, no need for a "struct" prefix
1735-
// FIXME: is this necessary?
1736-
"FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
1737-
| "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
1738-
| "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
1739-
| "Elf64_Chdr" => ty.to_string(),
1731+
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(),
17401732

17411733
t if is_union => format!("union {}", t),
17421734

@@ -1756,7 +1748,7 @@ fn test_emscripten(target: &str) {
17561748
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
17571749
s.replace("e_nsec", ".tv_nsec")
17581750
}
1759-
// FIXME: is this necessary?
1751+
// FIXME: appears that `epoll_event.data` is an union
17601752
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
17611753
s => s.to_string(),
17621754
}
@@ -1774,157 +1766,28 @@ fn test_emscripten(target: &str) {
17741766

17751767
cfg.skip_struct(move |ty| {
17761768
match ty {
1777-
// FIXME: is this necessary?
1778-
"sockaddr_nl" => true,
1779-
17801769
// This is actually a union, not a struct
17811770
// FIXME: is this necessary?
17821771
"sigval" => true,
17831772

1784-
// Linux kernel headers used on musl are too old to have this
1785-
// definition. Because it's tested on other Linux targets, skip it.
1786-
// FIXME: is this necessary?
1787-
"input_mask" => true,
1788-
1789-
// These are tested as part of the linux_fcntl tests since there are
1790-
// header conflicts when including them with all the other structs.
1791-
// FIXME: is this necessary?
1792-
"termios2" => true,
1793-
17941773
_ => false,
17951774
}
17961775
});
17971776

1798-
cfg.skip_signededness(move |c| match c {
1799-
// FIXME: is this necessary?
1800-
"LARGE_INTEGER" | "float" | "double" => true,
1801-
// FIXME: is this necessary?
1802-
n if n.starts_with("pthread") => true,
1803-
_ => false,
1804-
});
1805-
1806-
cfg.skip_const(move |name| {
1777+
cfg.skip_fn(move |name| {
18071778
match name {
1808-
// FIXME: is this necessary?
1809-
"SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
1810-
// FIXME: is this necessary?
1811-
"SIGUNUSED" => true, // removed in glibc 2.26
1812-
1813-
// types on musl are defined a little differently
1814-
// FIXME: is this necessary?
1815-
n if n.contains("__SIZEOF_PTHREAD") => true,
1816-
1817-
// Skip constants not defined in MUSL but just passed down to the
1818-
// kernel regardless
1819-
// FIXME: is this necessary?
1820-
"RLIMIT_NLIMITS"
1821-
| "TCP_COOKIE_TRANSACTIONS"
1822-
| "RLIMIT_RTTIME"
1823-
| "MSG_COPY"
1824-
=>
1825-
{
1826-
true
1827-
}
1828-
1829-
// weird signed extension or something like that?
1830-
// FIXME: is this necessary?
1831-
"MS_NOUSER" => true,
1832-
// FIXME: is this necessary?
1833-
"MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
1834-
1835-
// Musl uses old, patched kernel headers
1836-
// FIXME: is this necessary?
1837-
"FALLOC_FL_COLLAPSE_RANGE"
1838-
| "FALLOC_FL_ZERO_RANGE"
1839-
| "FALLOC_FL_INSERT_RANGE"
1840-
| "FALLOC_FL_UNSHARE_RANGE"
1841-
| "RENAME_NOREPLACE"
1842-
| "RENAME_EXCHANGE"
1843-
| "RENAME_WHITEOUT"
1844-
// ALG_SET_AEAD_* constants are available starting from kernel 3.19
1845-
| "ALG_SET_AEAD_ASSOCLEN"
1846-
| "ALG_SET_AEAD_AUTHSIZE"
1847-
=>
1848-
{
1849-
true
1850-
}
1851-
1852-
// musl uses old kernel headers
1853-
// These are constants used in getrandom syscall
1854-
// FIXME: is this necessary?
1855-
"GRND_NONBLOCK" | "GRND_RANDOM" => true,
1856-
1857-
1858-
// These constants are tested in a separate test program generated below because there
1859-
// are header conflicts if we try to include the headers that define them here.
1860-
// FIXME: is this necessary?
1861-
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
1862-
// FIXME: is this necessary?
1863-
"F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
1864-
| "F_SEAL_WRITE" => true,
1865-
// FIXME: is this necessary?
1866-
"BOTHER" => true,
1867-
1868-
// FIXME: is this necessary?
1869-
"MFD_CLOEXEC" | "MFD_ALLOW_SEALING" => true,
1870-
// MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
1871-
// x86_64 and i686 builders it seems to be available for all targets, so at least test
1872-
// it there.
1873-
// FIXME: is this necessary?
1874-
"MFD_HUGETLB" =>
1875-
{
1876-
true
1877-
}
1878-
1879-
// These are defined for Solaris 11, but the crate is tested on
1880-
// illumos, where they are currently not defined
1881-
// FIXME: is this necessary?
1882-
"EADI"
1883-
| "PORT_SOURCE_POSTWAIT"
1884-
| "PORT_SOURCE_SIGNAL"
1885-
| "PTHREAD_STACK_MIN" => true,
1886-
1887-
// These change all the time from release to release of linux
1888-
// distros, let's just not bother trying to verify them. They
1889-
// shouldn't be used in code anyway...
1890-
// FIXME: is this necessary?
1891-
"AF_MAX" | "PF_MAX" => true,
1779+
// FIXME: https://github.com/rust-lang/libc/issues/1272
1780+
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" => true,
18921781

18931782
_ => false,
18941783
}
18951784
});
18961785

1897-
cfg.skip_fn(move |name| {
1898-
// skip those that are manually verified
1786+
cfg.skip_const(move |name| {
18991787
match name {
1900-
// FIXME: is this necessary?
1901-
"execv" | // crazy stuff with const/mut
1902-
"execve" |
1903-
"execvp" |
1904-
"execvpe" |
1905-
"fexecve" => true,
1906-
1907-
"getrlimit" | "getrlimit64" | // non-int in 1st arg
1908-
"setrlimit" | "setrlimit64" | // non-int in 1st arg
1909-
"prlimit" | "prlimit64" | // non-int in 2nd arg
1910-
1911-
// int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that
1912-
// they match the interface defined by Linux verbatim, but they conflict with other
1913-
// send*/recv* syscalls
1914-
// FIXME: is this necessary?
1915-
"sendmmsg" | "recvmmsg" => true,
1916-
1917-
// FIXME: is this necessary?
1918-
"dladdr" => true, // const-ness only added recently
1919-
1920-
// FIXME: is this necessary?
1921-
"lio_listio" => true,
1922-
1923-
// Definition of those functions as changed since unified headers from NDK r14b
1924-
// These changes imply some API breaking changes but are still ABI compatible.
1925-
// We can wait for the next major release to be compliant with the new API.
1926-
// FIXME: unskip these for next major release
1927-
"strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
1788+
// FIXME: deprecated - SIGNUNUSED was removed in glibc 2.26
1789+
// users should use SIGSYS instead
1790+
"SIGUNUSED" => true,
19281791

19291792
_ => false,
19301793
}
@@ -1966,9 +1829,7 @@ fn test_emscripten(target: &str) {
19661829
field == "ssi_arch"))
19671830
});
19681831

1969-
// FIXME: remove
1970-
cfg.fn_cname(move |name, _cname| name.to_string());
1971-
1832+
// FIXME: test linux like
19721833
cfg.generate("../src/lib.rs", "main.rs");
19731834
}
19741835

src/unix/notbsd/emscripten/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,11 @@ pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
12291229
pub const TCP_FASTOPEN: ::c_int = 23;
12301230
pub const TCP_TIMESTAMP: ::c_int = 24;
12311231

1232+
#[doc(hidden)]
1233+
#[deprecated(
1234+
since = "0.2.55",
1235+
note = "Use SIGSYS instead"
1236+
)]
12321237
pub const SIGUNUSED: ::c_int = ::SIGSYS;
12331238

12341239
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;

0 commit comments

Comments
 (0)