Using Selected Functions
With the configuration parameter EMBED_FUNCTION_NAME, a list of functions can be defined to trigger the saving of coverage data.
This configuration parameter has to be used at instrumentation time. The parameter value is a list function names. Wildcards may be used.
You could use this arrangement for example as follows:
ctcwrap ... -C EMBED_FUNCTION_NAME=foo,Cls::bar make ...
When
instrumenting the source files, if a stand-alone function foo()
or a
member function Cls::bar()
is met, logically a #pragma CTC
APPEND
line is inserted just before each return
,
throw
and function end (if control can flow to the end). With this arrangement, no source files need to be modified.