Use rustdoc output to create a list of public API

Rather than collecting a list of file names in `libm-test/build.rs`,
just use a script to parse rustdoc's JSON output.
This commit is contained in:
Trevor Gross
2024-12-31 22:56:36 +00:00
parent 489524413b
commit ed72c4ec69
6 changed files with 283 additions and 69 deletions

View File

@@ -23,9 +23,6 @@ pub use test_traits::{CheckOutput, GenerateInput, Hex, TupleCall};
/// propagate.
pub type TestResult<T = (), E = anyhow::Error> = Result<T, E>;
// List of all files present in libm's source
include!(concat!(env!("OUT_DIR"), "/all_files.rs"));
/// True if `EMULATED` is set and nonempty. Used to determine how many iterations to run.
pub const fn emulated() -> bool {
match option_env!("EMULATED") {
@@ -34,3 +31,12 @@ pub const fn emulated() -> bool {
Some(_) => true,
}
}
/// True if `CI` is set and nonempty.
pub const fn ci() -> bool {
match option_env!("CI") {
Some(s) if s.is_empty() => false,
None => false,
Some(_) => true,
}
}