Files
DD3-LoRa-Bridge-MultiSender/docs/TESTS.md
acidburns 0577464ec5 refactor: stabilize legacy-core linking and header ownership
- Make include/ the canonical declarations for data_model/html_util/json_codec and convert dd3_legacy_core header copies to thin forwarders.
- Add stable public forwarders for app_context/receiver_pipeline/sender_state_machine and update refactor smoke test to stop using ../../src includes.
- Force-link dd3_legacy_core from setup() to ensure deterministic PlatformIO LDF linking across firmware envs.
- Refresh docs (README, Requirements, docs/TESTS.md) to reflect current module paths and smoke-test include strategy.
2026-02-20 23:29:50 +01:00

49 lines
1.9 KiB
Markdown

# Legacy Unity Tests
This change intentionally keeps the existing PlatformIO legacy Unity harness unchanged.
No `platformio.ini`, CI, or test-runner configuration was modified.
## Compile-Only (Legacy Gate)
Use compile-only checks in environments that do not have a connected board:
```powershell
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing
pio test -e lilygo-t3-v1-6-1-868-test --without-uploading --without-testing
```
Suite-specific compile checks:
```powershell
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing -f test_html_escape
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing -f test_payload_codec
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing -f test_lora_transport
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing -f test_json_codec
pio test -e lilygo-t3-v1-6-1-test --without-uploading --without-testing -f test_refactor_smoke
```
## Full On-Device Unity Run
When hardware is connected, run full legacy Unity tests:
```powershell
pio test -e lilygo-t3-v1-6-1-test
pio test -e lilygo-t3-v1-6-1-868-test
```
## Suite Coverage
- `test_html_escape`: `html_escape`, `url_encode_component`, and `sanitize_device_id` edge/adversarial coverage.
- `test_payload_codec`: payload schema v3 roundtrip/reject paths and golden vectors.
- `test_lora_transport`: CRC16, frame encode/decode integrity, and chunk reassembly behavior.
- `test_json_codec`: state JSON key stability and Home Assistant discovery payload manufacturer/key stability.
- `test_refactor_smoke`: baseline include/type smoke and manufacturer constant guard, using stable public headers from `include/` (no `../../src` includes).
## Manufacturer Drift Guard
Run the static guard script to enforce Home Assistant manufacturer wiring:
```powershell
powershell -ExecutionPolicy Bypass -File test/check_ha_manufacturer.ps1
```