temp_sensor
An imagined temperature sensor peripheral with ADC, timer, and USART subsystems. The firmware is organized in classic embedded C layers using a design patterns and hardware stand-ins to enable testing. Test suite only.
See the project README for full details. The README is linked here for convenience but is also exported with the example project.
Exporting
After exporting, run ceedling test:all from the project root to execute the
full test suite.
About
temp_sensor demonstrates a range of Ceedling test-build features using a
layered architecture typical of embedded development with the benefit of a
design pattern to enable testing. Mocks generated by CMock isolate each component
among the MCH design pattern implementation for unit testing.
The project also illustrates a pure-C approach to resolving hardware peripheral accesses for testing using the same symbol names as provided by a vendor.
Example integration tests demonstrate exercising cross-module and integrated behavior.
Platform standin technique
This project demonstrates the practice of creating custom structs as standins for real hardware access by coopting the macros, symbol names, and operations provided by the platform vendor.
MCH design pattern
This project implements the Model-Conductor-Hardware design pattern:
- Model modules manage state and logic
- Hardware modules abstract hardware interfaces
- Conductors link the two together and service them
Optional mixins
The project ships two mixin files that activate optional features:
add_gcov— enables gcov coverage collection and reporting (requiresgcovandgcovr). Run withceedling gcov:all --mixin=mixin/add_gcov.yml.add_unity_helper— activates a custom Unity assertion forEXAMPLE_STRUCT_T, enabling more detailed failure messages for struct comparisons. Run withceedling test:all --mixin=mixin/add_unity_helper.yml.
See the Mixins documentation for more on how to use and write mixin files.