Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 9e343ff

Browse files
committed
Update
1 parent 770906b commit 9e343ff

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

crates/libm-test/build.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mod musl_reference_tests {
6363
let files = fs::read_dir(math_src)
6464
.unwrap()
6565
.map(|f| f.unwrap().path())
66-
.filter(|f| !f.is_dir())
66+
.filter(file_needs_test)
6767
.collect::<Vec<_>>();
6868

6969
let mut math = Vec::new();
@@ -95,6 +95,19 @@ mod musl_reference_tests {
9595
generate_unit_tests(&math);
9696
}
9797

98+
/// Check whether a path within `src/math` should get tests generated.
99+
fn file_needs_test(path: &PathBuf) -> bool {
100+
// Skip directories
101+
if path.is_dir() {
102+
return false;
103+
}
104+
105+
let fname = path.file_name().unwrap().to_str().unwrap();
106+
107+
// Musl doesn't support `f16` or `f128`
108+
!(fname.contains("f16") || fname.contains("f128"))
109+
}
110+
98111
/// A "poor man's" parser for the signature of a function
99112
fn parse(s: &str) -> Function {
100113
let s = eat(s, "pub fn ");

0 commit comments

Comments
 (0)