Skip to content

Commit 53baf08

Browse files
committed
Theoretically test statics
There are none of them in `libc` except for `__progname` on Android, but that one cannot be tested because it's not present in any header files.
1 parent 267375e commit 53baf08

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libc-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ path = ".."
99
default-features = false
1010

1111
[build-dependencies]
12-
ctest = "0.2"
12+
ctest = "0.2.1"
1313

1414
[features]
1515
default = [ "use_std" ]

libc-test/build.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ fn main() {
432432
cfg.skip_struct(move |ty| {
433433
match ty {
434434
"sockaddr_nl" => musl,
435+
"ucontext_t" => true,
435436

436437
// On Linux, the type of `ut_tv` field of `struct utmpx`
437438
// can be an anonymous struct, so an extra struct,
@@ -639,6 +640,7 @@ fn main() {
639640
s if ios && s.starts_with("RTV_") => true,
640641
s if ios && s.starts_with("DLT_") => true,
641642

643+
"NFT_MSG_MAX" => true,
642644
_ => false,
643645
}
644646
});
@@ -789,6 +791,14 @@ fn main() {
789791
}
790792
});
791793

794+
cfg.skip_static(move |name| {
795+
match name {
796+
// Internal constant, not declared in any headers.
797+
"__progname" if android => true,
798+
_ => false,
799+
}
800+
})
801+
792802
cfg.skip_fn_ptrcheck(move |name| {
793803
match name {
794804
// dllimport weirdness?
@@ -844,7 +854,8 @@ fn main() {
844854
// fails on a lot of platforms.
845855
let mut cfg = ctest::TestGenerator::new();
846856
cfg.skip_type(|_| true)
847-
.skip_fn(|_| true);
857+
.skip_fn(|_| true)
858+
.skip_static(|_| true);
848859
if android || linux {
849860
// musl defines these directly in `fcntl.h`
850861
if musl {

0 commit comments

Comments
 (0)