oxiforge 0.4.0

YAML-to-Rust code generator for oxivgl LVGL UIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: GPL-3.0-only
//! Drift guard: the checked-in JSON schema must match the model types.
//!
//! Runs only with `--features schema` (CI does); all-widgets must be on
//! because the schema covers the feature-gated widget variants.
#![cfg(all(feature = "schema", feature = "all-widgets"))]

#[test]
fn checked_in_schema_matches_model() {
    let generated = oxiforge::model::generated_json_schema();
    let path = concat!(env!("CARGO_MANIFEST_DIR"), "/schemas/oxiforge.schema.json");
    let on_disk = std::fs::read_to_string(path).expect("read schemas/oxiforge.schema.json");
    assert!(
        generated == on_disk,
        "schemas/oxiforge.schema.json is out of date with src/model.rs — regenerate it:\n  \
         cargo run --features schema --bin gen_schema --target x86_64-unknown-linux-gnu"
    );
}