Rusty Wire uses three test layers:
- Rust tests via
cargo test(unit + integration) scripts/test-itu-region-bands.shfor region-band regression checksscripts/test-multi-optima.shfor non-resonant multi-optima regression sweepsscripts/test-nec-calibration.shfor conductor-calibration regression checks
All of the above can be run together:
./scripts/test-all.shcargo testUseful variants:
cargo test -- --nocapture
cargo test cli_integrationIntegration tests live in tests/cli_integration.rs and validate real binary behavior, including:
- no-argument help output
- invalid input validation (for example velocity and mixed-unit window flags)
- region-aware band listing
- transformer recommendation resolution
- export path behavior for single and multi-format runs
- no-argument invocation prints help
- mixed meter/feet constraints return a validation error
- invalid velocity values return a validation error
--list-bands --region 2shows region-specific output- recommended transformer defaults resolve correctly for non-resonant runs and EFHW mode
- multiple export formats ignore a custom
--outputpath and use default names - single-format export respects the requested
--outputpath
These tests are intentionally high-level so that clap parsing and the real CLI flow are both covered.
- Add an advise-mode cross-tool validation script that calls
fnec-rustfor the top-ranked wire + transformer candidates. - Record per-candidate sustainability status (for example: validated, warning, rejected) based on agreed efficiency/thermal thresholds.
- Use this as a regression guard when optimizer scoring weights or practical-limit coefficients are changed.
Run:
./scripts/test-multi-optima.shPurpose:
- builds the project
- sweeps band selections, velocity factors, and wire-length windows
- stops at the first case where multiple non-resonant optima are found
This is not a unit test. It is an empirical regression script used to confirm that the optimization logic still produces multiple-optima cases under realistic parameter sweeps.
Environment variables:
BIN: path to the binary to execute, defaulttarget/debug/rusty-wireSWEEP_OUT: path to the temporary sweep output file, default/tmp/rw_sweep_result.txt
The sweep uses CLI band names/ranges (for example 40m, 20m,17m, 40m-10m) to match the current --bands parser behavior.
Run:
./scripts/test-itu-region-bands.shChecks listed ranges for Regions 1, 2, and 3.
Run:
./scripts/test-nec-calibration.shChecks:
- template dataset fit stays at documented values (
k = 0.011542,RMSE = 0.000000) - parser accepts blank lines and
#comment lines in calibration CSV input - malformed rows are rejected with non-zero exit
./scripts/test-multi-optima.shBuilds and sweeps parameter combinations, then exits at the first confirmed multi-optima case.
Environment variables for the sweep script:
BINdefault:target/debug/rusty-wireSWEEP_OUTdefault:/tmp/sweep_out.txt
Full suite (format + compile + unit + all regression scripts):
./scripts/test-all.shDefault pre-push verification (Rust only):
cargo fmt
cargo check
cargo testOn version bump (before tagging):
cargo sbom
cargo sbom-cdx
git add sbom/For the full release flow (including manual real-terminal screenshot refresh),
see docs/release-checklist.md.
When changing region or band behavior:
cargo test
./scripts/test-itu-region-bands.shWhen changing non-resonant optimization behavior:
cargo test
./scripts/test-multi-optima.shWhen changing conductor-diameter correction constants:
cargo test
./scripts/test-nec-calibration.sh