Skip to content

How to Generate Mocks

Jessie Guo edited this page Mar 6, 2021 · 1 revision

First, install ruby.

If you are mocking HAL Libraries:

ruby path/to/cmock.rb -oCMockConfigs/hal-config.yml /path/to/hal/library.h

If you are mocking CMSIS Libraries:

ruby path/to/cmock.rb -oCMockConfigs/cmsis-config.yml /path/to/cmsis/library.h

If you are mocking a regular .h:

ruby path/to/cmock.rb <path to header file you want to mock>

cmock.rb is in Epsilon-Embedded-Software/UnityTestingTool/CMock/lib

Clone this wiki locally