@@ -89,8 +89,35 @@ if(DPCTL_GENERATE_COVERAGE)
89
89
${CMAKE_DL_LIBS}
90
90
)
91
91
set (object_arg "-object;" )
92
- add_custom_target (llvm-cov
92
+ add_custom_target (run-c-api-tests
93
93
COMMAND ${CMAKE_COMMAND} -E env DPCTL_VERBOSITY=warning ${CMAKE_CURRENT_BINARY_DIR} /dpctl_c_api_tests
94
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
95
+ COMMAND_EXPAND_LISTS
96
+ DEPENDS dpctl_c_api_tests
97
+ )
98
+ add_custom_target (llvm-cov-show
99
+ COMMAND ${LLVMProfdata_EXE}
100
+ merge
101
+ -sparse default.profraw
102
+ -o
103
+ dpctl.profdata
104
+ COMMAND ${LLVMCov_EXE}
105
+ export
106
+ -format=lcov
107
+ -ignore-filename-regex=/tmp/icpx*
108
+ -instr-profile=dpctl.profdata
109
+ "${object_arg} $<JOIN:$<TARGET_OBJECTS:DPCTLSyclInterface>,;${object_arg} >"
110
+ > dpctl.lcov
111
+ COMMAND ${LLVMCov_EXE}
112
+ show
113
+ -instr-profile=dpctl.profdata
114
+ "${object_arg} $<JOIN:$<TARGET_OBJECTS:DPCTLSyclInterface>,;${object_arg} >"
115
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
116
+ COMMAND_EXPAND_LISTS
117
+ DEPENDS run-c-api-tests
118
+ )
119
+
120
+ add_custom_target (llvm-cov-report
94
121
COMMAND ${LLVMProfdata_EXE}
95
122
merge
96
123
-sparse default.profraw
@@ -109,11 +136,10 @@ if(DPCTL_GENERATE_COVERAGE)
109
136
"${object_arg} $<JOIN:$<TARGET_OBJECTS:DPCTLSyclInterface>,;${object_arg} >"
110
137
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
111
138
COMMAND_EXPAND_LISTS
112
- DEPENDS dpctl_c_api_tests
139
+ DEPENDS run-c-api-tests
113
140
)
114
141
115
142
add_custom_target (lcov-genhtml
116
- COMMAND ${CMAKE_COMMAND} -E env DPCTL_VERBOSITY=warning ${CMAKE_CURRENT_BINARY_DIR} /dpctl_c_api_tests
117
143
COMMAND ${LLVMProfdata_EXE}
118
144
merge
119
145
-sparse default.profraw
@@ -132,7 +158,7 @@ if(DPCTL_GENERATE_COVERAGE)
132
158
${COVERAGE_OUTPUT_DIR} /dpctl-c-api-coverage
133
159
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
134
160
COMMAND_EXPAND_LISTS
135
- DEPENDS dpctl_c_api_tests
161
+ DEPENDS run-c-api-tests
136
162
)
137
163
else ()
138
164
target_link_libraries (dpctl_c_api_tests
0 commit comments