Skip to content

Latest commit

 

History

History
99 lines (82 loc) · 5.53 KB

File metadata and controls

99 lines (82 loc) · 5.53 KB

Restructure TODO

Tracks the multi-phase restructure of the phevcore build system and project layout. Each phase is one PR.

Phase 1 — Build modernization ✓

  • Add CMakePresets.json (dev / release / ci)
  • Remove splint.cmake stub
  • Fix GitHub Actions CI to run tests natively
  • Update Dockerfile to use presets
  • Remove dead files (.travis.yml, runtests.bat, .gitmodules, CSV)
  • Expand .gitignore
  • Add .clang-format
  • Update AGENTS.md to reflect changes

Phase 2 — Test migration ✓

  • Choose test framework: greatest (v1.5.0)
  • Add framework via FetchContent
  • Convert test_phev_core.c (82 tests — 66 pass, 16 fail from previously-unwired tests)
  • Convert test_phev_pipe.c (31 tests — 21 pass, 10 fail from previously-unwired tests)
  • Convert test_phev_service.c (70 tests — 60 pass, 9 fail, 1 skip from previously-unwired tests)
  • Convert test_phev_model.c (8 tests — all pass)
  • Convert test_phev.c (2 tests — all pass)
  • Convert test_phev_register.c (14 tests — all pass)
  • Wire all previously-unwired test functions (35 fail + 1 skip are pre-existing bugs, not regressions)
  • Triage orphaned files:
    • test_phev_config.c — converted to greatest (12 tests, all pass), fixture test/config.json created
    • test_phev_controller.c — deleted (requires CMock + missing source phev_controller.c)
    • test_phev_response_handler.c — deleted (empty, 0 tests)
  • Delete all run_*.c Unity shims
  • Delete test_runner.c and Unity FetchContent (Unity was already removed)
  • Verify all 219 tests run across 7 suites — 183 pass, 35 fail, 1 skip (zero regressions)

Bug fixes applied during migration

  • Fixed include/logger.h hexdump() stack-buffer-underflow (line 89)
  • Added missing phev_core_validateChecksumXOR declaration to include/phev_core.h
  • Skipped test_phev_service_jsonInputTransformer — pre-existing segfault from NULL pipe context

Phase 3 — Directory restructure ✓

  • Move src/ into src/msg/ + src/phev/
  • Move include/ into include/msg/ + include/phev/
  • Update all #include directives (79 directives across 24 files)
  • Split CMake into two targets: msg_core (static) + phev (static, links msg_core)
  • Gate dead transport backends (msg_gcp_mqtt, msg_mqtt_paho) behind BUILD_TRANSPORT_BACKENDS option
  • Update install rules for new directory layout
  • Tests remain in test/ (no msg-layer tests exist; all 7 suites test phev)
  • Dockerfile and CI already use presets — no changes needed
  • Update AGENTS.md to reflect restructure

Phase 4 — Fix SKIPped tests (branch: phase4/fix-skipped-tests) ✓

Goal: fix all 36 tests that were SKIPped (pre-existing bugs from previously-unwired test functions) and reduce the skip count to zero.

Source fixes applied

  • phev_core_getType() — XOR-decode the type byte before classifying (src/phev/phev_core.c)
  • phev_core_encodeMessage() — apply XOR to encoded bytes (src/phev/phev_core.c)
  • phev_service_jsonInputTransformer() — guard against NULL ctx->pipe (src/phev/phev_service.c)
  • phev_pipe_outputChainInputTransformer() — use decoded phevMessage->XOR instead of message->ctx for XOR detection; return decoded message when XOR is active (src/phev/phev_pipe.c)
  • phev_pipe_commandResponder() — propagate XOR from message->ctx to phevMsg.XOR so response is correctly encoded (src/phev/phev_pipe.c)
  • phev_core_xorDataOutbound() / phev_core_XOROutboundMessage() — use message->length instead of data[1]+2 to handle concatenated messages (src/phev/phev_core.c)
  • phev_service_validateCommand() — add missing "update" operation validation (src/phev/phev_service.c)

test_phev_core.c — 16 SKIPs → 0 (all 82 pass)

  • Group 1 (4 tests): fix checksums and expected data for XOR-encoded messages
  • Group 2 (5 tests): fix expected XOR values and command/ack expectations
  • Group 3 (4 tests): fix expected ping constant (0xf6 → 0xf9)
  • Group 4 (3 tests): fix expected data arrays for XOR encoding

test_phev_service.c — 10 SKIPs → 0 (all 70 pass)

  • Group 6 (5 tests): update expected data and checksum for XOR encoding
  • Group 7 (4 tests): fix expected bytes for service-layer encoding
  • Group 10 (1 test, line 263): validateCommand() missing "update" operation

test_phev_pipe.c — 10 SKIPs → 0 (all 31 pass)

  • Group 5 (3 tests): commandXOR propagation through pipe context
  • Group 6 (2 tests): outputChainInputTransformer with XOR
  • Group 7 (1 test + 1 bonus): XOR handling with NULL pipe context / ping response
  • Group 8 (2 tests): sendMac / start_my18 wiring — fix xorDataOutbound length
  • Group 9 (1 test): waitForConnection retry loop — add failing connect stub

Summary

  • Started: 36 SKIPped tests (16 + 10 + 10)
  • Fixed: 36 (all)
  • Remaining: 0
  • All 219 tests pass across 7 suites, 0 fail, 0 skip

Phase 5 — Cleanup ✓

  • Remove dead transport source files (msg_gcp_mqtt.*, msg_mqtt_paho.*)
  • Remove stale config.h (unused)
  • Remove BUILD_TRANSPORT_BACKENDS option and install block from CMakeLists.txt
  • Clean up stale remote branches (deleted 6: phase1-3, add-license-1, register_fix, robustxor)
  • Clean up stale local branches (deleted phase1-3)
  • Update AGENTS.md to reflect all-tests-passing and removal of transport backends
  • Final CI verification — dev preset build + all 219 tests pass, release preset builds clean