Phase 1: Build modernization and test fixes#26
Merged
Conversation
Fix 4 test failures across 2 suites: - phev_core: fix doubleMessage checksums and split-test logic that used decode return value (1=success) as byte offset instead of data[1]+2 - phev_core: add missing case 0x2f (START_RESP) to phev_core_unencodedIncomingMessage, which caused start response messages to be silently dropped by the splitter - phev_register: fix start_ack and end_to_end tests (same 0x2f root cause) - phev_register: rework test setup (memset srvCtx, reset state vars) Split monolithic test_runner into 6 per-suite CTest executables via phev_add_test() helper in test/CMakeLists.txt. Add individual run_*.c runner files for each suite. Additional fixes: - phev_pipe: VIN null-terminator fix - phev_register: null guard for settings.ctx, merge REG_DISP and REGISTRATION_COMPLETE handling, null-check errorHandler before call - test_phev.c, test_phev_service.c: add missing msg_utils.h includes
Provides standardized build configurations: - dev: Debug + tests + compile_commands.json (daily development) - release: Release without tests (production builds) - ci: Release + tests + compile_commands.json (CI pipeline) Usage: cmake --preset dev && cmake --build --preset dev && ctest --preset dev
The stub macro was a no-op placeholder. The WANT_SPLINT option was already removed from CMakeLists.txt in a prior commit. Only AGENTS.md still references it and will be updated separately.
The previous workflow only ran 'docker build' which never executes the Dockerfile CMD. Tests never ran in CI. Replace with native cmake preset-based workflow: configure (--preset ci) → build → ctest. Also upgrade actions/checkout from v2 to v4.
Replace manual cmake flags with --preset ci for configure, build, and test stages. Keeps the Dockerfile as a self-contained way to build and test the project in a clean environment.
- .travis.yml: Travis CI is no longer used; replaced by GitHub Actions - runtests.bat: Windows docker helper, superseded by CMake presets - .gitmodules: referenced non-existent external/ submodules; deps are now handled via FetchContent or vendored directly - PHEV - Sheet1.csv: protocol register reference spreadsheet, not part of the build or runtime
Add CMakeUserPresets.json, compile_commands.json, common IDE dirs (.idea), editor swap files, and OS metadata files.
Documents the project's 4-space indent, Allman braces, middle pointer alignment conventions. Not enforced automatically — intended for editor integration and manual use.
Documents what has been done in Phase 1 and what remains for Phase 2 (test migration) and Phase 3 (directory restructure). Includes the test audit findings: 75 of 220 test functions are never wired.
Rewrite to reflect current project state: - CMakePresets.json for build configuration - Per-suite test runners (6 CTest targets) - FetchContent for cJSON and Unity - Vendored msg-core sources - .clang-format for style documentation - CI runs tests natively via cmake presets - Remove stale splint, submodule, and monolithic-runner references - Document the 75 unwired tests and orphaned test files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernize the build system and fix all test failures as the first phase of a 3-phase restructure plan.
Test Fixes
test_phev_core(bad checksums + misuse of decode return value) andtest_phev_register(missingcase 0x2finphev_core_unencodedIncomingMessagesilently dropped START_RESP messages)phev_add_test()helperrun_*.crunner files for each suiteBuild Modernization
CMakePresets.jsonwith dev/release/ci presetsdocker build, neverdocker run).travis.yml,runtests.bat,.gitmodules(submodules don't exist),PHEV - Sheet1.csv,splint.cmake.gitignorewith IDE, CMake, and OS patterns.clang-formatdocumenting existing code styleTODO.mdtracking the 3-phase restructure planAGENTS.mdto reflect current project stateTest Results
All 6 suites pass (150 tests total, 0 failures):
test_phev_core(52),test_phev_pipe(18),test_phev_service(56),test_phev_model(8),test_phev(2),test_phev_register(14)