//! `joule-code-conformance` — round-trip the published wire vectors. //! //! Usage: `joule-code-conformance verify ` (e.g. `verify ../conformance/v1`). //! Exits non-zero if any vector FAILs (CI-ready). SKIPs (derived fields pending //! regeneration, see `conformance/v1/regeneration.md`) do not fail the run. use std::path::PathBuf; use std::process::ExitCode; fn main() -> ExitCode { let args: Vec = std::env::args().collect(); match args.get(1).map(String::as_str) { Some("verify") => { let dir = PathBuf::from(args.get(2).map(String::as_str).unwrap_or("conformance/v1")); match joule_code_conformance::verify_pack(&dir) { Ok(report) => { for line in &report.lines { println!("{line}"); } println!( "\n{} passed, {} failed, {} skipped (pending regeneration)", report.pass, report.fail, report.skip ); if report.fail > 0 { ExitCode::FAILURE } else { ExitCode::SUCCESS } } Err(e) => { eprintln!("error: {e}"); ExitCode::FAILURE } } } _ => { eprintln!("usage: joule-code-conformance verify "); ExitCode::FAILURE } } }