diff --git a/crates/engine/src/cmd/diagnostics.rs b/crates/engine/src/cmd/diagnostics.rs index b31a65619f..78660e0904 100644 --- a/crates/engine/src/cmd/diagnostics.rs +++ b/crates/engine/src/cmd/diagnostics.rs @@ -78,7 +78,10 @@ pub(crate) fn kernel_asked(choice: &Value, built: bool) -> Result Vec<[f64; 3]> { /// #871's rounds at r 0.5 fit (the wall between the window and the block's side is 1.26 thick): /// 38 faces, and the closed form `issue_871_tests::rounds_that_fit_are_closed` derives. At r 1 they /// overlap, which is refused. With SMLib built, the C++ kernel gives the same. +#[cfg(feature = "native")] #[test] fn rounds_on_the_871_part() { - #[cfg(feature = "native")] let _cpp = crate::route::on_cpp(); + rounds_on_the_871_part_check(); +} + +/// The same on a build without the C++ kernel: solidcore's half alone. A test of its own, so that +/// tests/KNOWN_FAILING_TESTS's entry for the C++ comparison (rounds_on_the_871_part) is graded only where it runs. +#[cfg(not(feature = "native"))] +#[test] +fn rounds_on_the_871_part_on_solidcore() { + rounds_on_the_871_part_check(); +} + +fn rounds_on_the_871_part_check() { let p = part_871(); let e = edges_871(); let sizes = |r: f64| vec![r; e.len()]; diff --git a/crates/smlib/src/core/offset_tests.rs b/crates/smlib/src/core/offset_tests.rs index 901a673d6a..6241ed1094 100644 --- a/crates/smlib/src/core/offset_tests.rs +++ b/crates/smlib/src/core/offset_tests.rs @@ -840,10 +840,22 @@ fn offset_faces_close_a_step_wall() { /// solidcore refuses to put the rounds back (solidcore#2020, open): SolidCraft says it does not /// make that move, where the C++ kernel gives the analytic value, also checked here. With SMLib /// built, the C++ kernel gives the same at every other move. +#[cfg(feature = "native")] #[test] fn mitred_rounds_follow_a_moved_top() { - #[cfg(feature = "native")] let _cpp = crate::route::on_cpp(); + mitred_rounds_follow_a_moved_top_check(); +} + +/// The same on a build without the C++ kernel: solidcore's half alone. A test of its own, so that +/// tests/KNOWN_FAILING_TESTS's entry for the C++ comparison (mitred_rounds_follow_a_moved_top) is graded only where it runs. +#[cfg(not(feature = "native"))] +#[test] +fn mitred_rounds_follow_a_moved_top_on_solidcore() { + mitred_rounds_follow_a_moved_top_check(); +} + +fn mitred_rounds_follow_a_moved_top_check() { use super::blend::{Corners, blend}; use crate::Blend; let edges = [[20.0, 0.0, 10.0], [20.0, 30.0, 10.0], [0.0, 15.0, 10.0], [40.0, 15.0, 10.0]]; diff --git a/xtask/src/kernel_cases.rs b/xtask/src/kernel_cases.rs index 5efcd9f823..35f3d66e06 100644 --- a/xtask/src/kernel_cases.rs +++ b/xtask/src/kernel_cases.rs @@ -229,6 +229,15 @@ pub(crate) fn run_all(o: &Options, list: &[PathBuf]) -> Vec { /// Every case on each backend, one job pool for all the runs; the results per backend, in order. fn run_on(o: &Options, list: &[PathBuf], kernels: &[&str]) -> Vec> { + // Without --cli each case is `cargo run`: build the CLI once first, so the first cases don't + // spend their timeout compiling it (the C++ kernel's build most of all). + if o.cli.is_none() { + let mut c = cargo(); + c.args(["build", "-q", "--release", "-p", "solidcraft-cli"]).args(cli_features(kernels)); + if let Err(e) = c.status().map_err(|e| e.to_string()).and_then(|s| if s.success() { Ok(()) } else { Err(s.to_string()) }) { + eprintln!("kernel-cases: building solidcraft-cli failed ({e}); each case will say why"); + } + } let jobs = list.len() * kernels.len(); let next = Arc::new(Mutex::new(0usize)); let results = Arc::new(Mutex::new(vec![Value::Null; jobs]));