Skip to content

Commit

Permalink
Add test for schemars
Browse files Browse the repository at this point in the history
  • Loading branch information
ratmice committed Nov 7, 2024
1 parent 049892c commit ac97f1e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion examples/with_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default = ["wgpu-profiler"]
# wgpu (which means the dependency used in wgpu-profiler would be incompatible)
wgpu-profiler = ["dep:wgpu-profiler", "vello/wgpu-profiler"]
# Test for dependencies which implement std traits in ways that cause type inference issues.
_ci_dep_features_to_test = ["dep:kurbo", "kurbo/schemars"]
_ci_dep_features_to_test = ["dep:kurbo", "kurbo/schemars", "dep:schemars"]

[lints]
workspace = true
Expand Down Expand Up @@ -45,6 +45,8 @@ log = { workspace = true }
tracing = { version = "0.1.40", features = ["log-always"] }
# For _ci_dep_features_to_test feature tests.
kurbo = { workspace = true, optional = true }
# For _ci_dep_features_to_test feature tests.
schemars = { version = "0.8.21", optional = true }

[target.'cfg(not(target_os = "android"))'.dependencies]
# We use android_logger on Android
Expand Down
10 changes: 10 additions & 0 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,3 +945,13 @@ fn android_main(app: AndroidApp) {

run(event_loop, args, scenes, render_cx);
}

#[cfg(all(feature = "_ci_dep_features_to_test", test))]
#[test]
// This just tests that the "kurbo" dependency we enable schemars for
// aligns to the same version that vello's peniko dependency resolves to.
fn test_kurbo_schemars_with_peniko() {
use schemars::schema_for;
let s = schema_for!(vello::peniko::kurbo::Rect);
println!("{:?}", s);
}

0 comments on commit ac97f1e

Please sign in to comment.