Closed informatimago closed 8 months ago
I would love to keep strippable backwards compatible so I am a bit afraid what will happen if you move it to after concatenating multi-line declarations, as I have no idea how far that goes. When you remove something with certain define it helps reduce the number of needed includes for the mocks. It is not about non-mocked functions but it is about
STATIC INLINE blah(int bla)
to end up as blah(int bla)
, and I do not want to list every single function in my project that needs this stripped (hence I have only STATIC
and INLINE
in my strippables.
Ok, so I shall leave strippable alone and only have a new feature to disable mocking certain functions.
My understanding of :strippable is that it allows to give regular expressions that should match an "attribute" or macro call, and this matched string is removed.
Currently, this is done before concatenating multi-line declarations into a single line.
So if the macro "call" may cover several lines it will be harder to write the regexp to match it.
Then, I've noticed that it's used to actually remove a declaration from consideration for mocking, by matching the name of the function that we don't want cmock to process. That prevented the regexp identifying the function declaration to match and seemed to work, but with my patch that implements a small parser, it just gives a parsing error instead (perhaps I should ignore these?)
This leds me to suggest the following modification and addition:
move the processing of :strippable after concatenating multi-line declarations into a single line.
introduce a new array of identifier naming the functions we don't want to mocking. This array could be used to filter out function declarations (by name or regexp on the name).
If this seems acceptable, I will implement it (already done half of it).