Go to the documentation of this file.
14 #ifndef MS_CPP_CODECOVERAGEFRAMEWORK
15 #define MS_CPP_CODECOVERAGEFRAMEWORK
47 #if defined(_M_IX86) || defined(_M_AMD64)
51 #define CODE_COVERAGE_CONCAT(X, Y) X##Y
52 #define CODE_COVERAGE_CONCAT2(X, Y) CODE_COVERAGE_CONCAT(X, Y)
53 #define CODE_COVERAGE_TOSTRING(X) #X
54 #define CODE_COVERAGE_TOSTRING2(X) CODE_COVERAGE_TOSTRING(X)
58 #if !defined(CODE_COVERAGE_DISABLE_ALL_FILTERS)
59 #define CODE_COVERAGE_DISABLE_ALL_FILTERS
64 #if defined(CODE_COVERAGE_DISABLE_ALL_FILTERS)
69 #define ExcludeSourceFromCodeCoverage(CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN) \
70 namespace Microsoft{ namespace VisualStudio{ namespace CppCodeCoverageFramework{ namespace CODE_COVERAGE_FILTER_NAME { \
73 #define ExcludeFromCodeCoverage(CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN) \
74 namespace Microsoft{ namespace VisualStudio{ namespace CppCodeCoverageFramework{ namespace CODE_COVERAGE_FILTER_NAME { \
81 #define CODE_COVERAGE_FILTER(CODE_COVERAGE_FILTER_CATEGORY, CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN) \
82 namespace Microsoft{ namespace VisualStudio{ namespace CppCodeCoverageFramework{ namespace CODE_COVERAGE_FILTER_CATEGORY{ \
83 __pragma(optimize("", off)) \
84 __declspec(dllexport) __declspec(noinline) void* CODE_COVERAGE_FILTER_NAME() \
87 CODE_COVERAGE_CONCAT2(L, CODE_COVERAGE_TOSTRING2(CODE_COVERAGE_FILTER_NAME)) \
89 CODE_COVERAGE_FILTER_PATTERN); \
90 return CODE_COVERAGE_TOSTRING2(CODE_COVERAGE_FILTER_NAME); \
92 __pragma(optimize("", on)) \
97 #define ExcludeSourceFromCodeCoverage(CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN) \
98 CODE_COVERAGE_FILTER(SourceFilter, CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN)
102 #define ExcludeFromCodeCoverage(CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN) \
103 CODE_COVERAGE_FILTER(FunctionFilter, CODE_COVERAGE_FILTER_NAME, CODE_COVERAGE_FILTER_PATTERN)