Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 2.98 KB

File metadata and controls

85 lines (64 loc) · 2.98 KB

Build and test

Toolchain

  • Rust edition: 2024 (set in Cargo.toml).
  • Minimum supported Rust version (MSRV): stable Rust with edition 2024 support.
  • No nightly features required.

Verification matrix

Every change must keep all of the following green. This is the contract for "passing CI" until a real CI pipeline exists.

cargo build                              # Compiles without errors
cargo test                               # 56 tests pass (40 unit + 12 integration + 4 doc-tests)
cargo clippy --all-targets -- -D warnings  # Zero warnings (including examples/)
cargo doc --no-deps                      # Zero warnings

CLI smoke tests against the committed example files:

cargo run -- convert  -i examples/example.xml  -o /tmp/test.json
cargo run -- convert  -i /tmp/test.json        -o /tmp/test.xml
cargo run -- info     -i examples/example.xml
cargo run -- validate -i examples/example.xml --verify-crc

The validate --verify-crc invocation must report 0 errors across all 24 leads (2 waveforms × 12 leads in the example).

Test inventory

Layer Count Where
Unit tests (error) 7 src/error.rs
Unit tests (patient) 4 src/patient.rs
Unit tests (test_demographics) 3 src/test_demographics.rs
Unit tests (diagnosis) 3 src/diagnosis.rs
Unit tests (waveform) 7 src/waveform.rs
Unit tests (measurements) 3 src/measurements.rs
Unit tests (order) 3 src/order.rs
Unit tests (io_xml) 6 src/io_xml.rs
Unit tests (io_json) 4 src/io_json.rs
Integration tests 12 tests/integration_test.rs
Doc-tests 4 src/lib.rs, src/io_xml.rs, src/io_json.rs, src/resting_ecg.rs
Total 56

If you add or remove tests, update this table and the corresponding count in /AGENTS.md and /spec.md.

Examples directory

examples/ contains both data and an example binary:

  • example.xml — canonical 12-lead, 2-waveform MUSE XML sample. Used by integration tests.
  • example.json — same data in JSON. Must remain bit-equivalent (as parsed serde_json::Value) to the JSON produced from example.xml.
  • example_new.xml — alternate sample used by test_roundtrip.rs.
  • restecg.dtd — reference DTD shipped with MUSE XML files.
  • test_roundtrip.rs — standalone example binary (cargo run --example test_roundtrip).

To regenerate example.xml and example.json after a schema change:

cargo run --bin generate_examples

The generator lives at src/bin/generate_examples.rs and must produce files that satisfy every integration test in tests/integration_test.rs.

What "done" looks like for an agent

Before reporting a task complete, the agent must have personally run, and seen pass, at minimum:

  1. cargo build
  2. cargo test
  3. cargo clippy --all-targets -- -D warnings

If any check is skipped, say so explicitly in the final summary. Do not claim success on the basis of "the code looks right".