Which is quietly long, for such short file.
After digging in source code I noticed that we can speed up time of generation of mocks by switching places of two regex
lib/cmock_header_parser.rb
ln 233
from
source.gsub!(/^\s*#.*/, '')
source.gsub!(/extern\s+\"C\"\s*\{/, '')```
to
``` # remove preprocessor statements and extern "C"
source.gsub!(/extern\s+\"C\"\s*\{/, '')
source.gsub!(/^\s*#.*/, '')
decrease time
from :
real 0m16.431s
user 0m16.188s
sys 0m0.234s
to:
real 0m0.409s
user 0m0.188s
sys 0m0.219s
I didn't noticed any regression for whole project and generated mock files for ST 743 SDK.
The files compared with diff mocks looks the same. I didn't notice any regression.
Hi
I'm noticing strange problem when I'm creating mock files for file which body is for instance:
The cmock generation took:
real 0m17.064s user 0m16.453s sys 0m0.219s
Which is quietly long, for such short file. After digging in source code I noticed that we can speed up time of generation of mocks by switching places of two regex lib/cmock_header_parser.rb ln 233 from
decrease time from :
real 0m16.431s user 0m16.188s sys 0m0.234s
to: real 0m0.409s user 0m0.188s sys 0m0.219s
I didn't noticed any regression for whole project and generated mock files for ST 743 SDK. The files compared with diff mocks looks the same. I didn't notice any regression.