Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/electronvector/mocking-hardware-ceedling-cmock
Example for mocking embedded hardware with Ceedling and CMock.
https://github.com/electronvector/mocking-hardware-ceedling-cmock
Last synced: 2 months ago
JSON representation
Example for mocking embedded hardware with Ceedling and CMock.
- Host: GitHub
- URL: https://github.com/electronvector/mocking-hardware-ceedling-cmock
- Owner: ElectronVector
- Created: 2015-11-04T21:51:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-04T22:52:13.000Z (about 9 years ago)
- Last Synced: 2023-10-20T19:39:12.839Z (about 1 year ago)
- Language: C
- Size: 871 KB
- Stars: 14
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# An Example Using Ceedling and CMock to Mock Embedded Hardware
This is the companion to my blog available here:
http://www.electronvector.com/blog/mocking-embedded-hardware-interfaces-with-ceedling-and-cmockIt provides an example for using Ceedling and CMock to generate mocks for embedded hardware. This lets us compile and run our tests independently on our host machine.
## Requirements
Rake is required for executing the tests. It's generally installed as a part of a Ruby installation.
## Running the Tests
Run the tests with: `rake test:all`
## Source
The source files are in the `src` folder. There is one module named `tempSensor` which implements an interface to an I2C temperature sensor. There is an i2c.h file which is used to generate mocks for the processor I2C hardware.
## Tests
The tempSensor module is tested with the `test/test_tempSensor.c` file.
## Vagrant
The included Vagrantfile can be used to launch an environment capable of building the tests. To launch the environment, run: `vagrant up`.
Once the evironment has loaded, connect to it with: `vagrant ssh`.