mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
cfe1b4ef3de98b8489ef8f47e5d1912abf9d69dc
First squash all multiline macro's, it makes parsing easier. Otherwise the regex to remove the macro would become more comples if we have to deal with newlines etc. When we have a match, we check if the last line in the pre_match is the beginning of a macro declaration. If it is, we remove the beginning of this macro declaration (#define<space>) and remove the body of the macro from the post_match, which is basically everything until the next newline. There is a possible edge case (pretty unlikely but still): if there is no newline in the post_match, meaning it is a macro at the end of the line, we should delete it as well, hence the '[\n]?' in the post match regex.
CMock - Mock/stub generator for C
Getting Started
If you're using Ceedling, there is no need to install CMock. It will handle it for you. For everyone else, the simplest way is to grab it off github. You can also download it as a zip if you prefer. The Github method looks something like this:
> git clone --recursive https://github.com/throwtheswitch/cmock.git
> cd cmock
> bundle install # Ensures you have all RubyGems needed
If you plan to help with the development of CMock (or just want to verify that it can perform its self tests on your system) then you can enter the test directory and then ask it to test:
> cd test
> rake # Run all CMock self tests
API Documentation
- Not sure what you're doing?
- Interested in our MIT-style license?
- Are there examples?
- They are all in /examples
- Any other resources to check out?
- Definitely! Check out our developer portal on ThrowTheSwitch.org
Description
Languages
C
58.9%
Ruby
23.2%
Assembly
9.5%
Tcl
7.9%
Batchfile
0.4%
