Skip to content

Commit e020764

Browse files
committed
Updated formatting for cmake-format 0.6.4
1 parent 6f854b7 commit e020764

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

Diff for: code-coverage.cmake

+37-21
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,19 @@ function(target_code_coverage TARGET_NAME)
202202
set(options AUTO ALL EXTERNAL)
203203
set(single_value_keywords COVERAGE_TARGET_NAME)
204204
set(multi_value_keywords EXCLUDE OBJECTS ARGS)
205-
cmake_parse_arguments(target_code_coverage "${options}" "${single_value_keywords}"
206-
"${multi_value_keywords}" ${ARGN})
205+
cmake_parse_arguments(
206+
target_code_coverage "${options}" "${single_value_keywords}"
207+
"${multi_value_keywords}" ${ARGN})
207208

208209
if(NOT target_code_coverage_COVERAGE_TARGET_NAME)
209210
# If a specific name was given, use that instead.
210211
set(target_code_coverage_COVERAGE_TARGET_NAME ${TARGET_NAME})
211212
endif()
212213

213-
message(STATUS "For the target ${target_code_coverage_COVERAGE_TARGET_NAME}, these are the arguments given to use: ${target_code_coverage_ARGS}")
214+
message(
215+
STATUS
216+
"For the target ${target_code_coverage_COVERAGE_TARGET_NAME}, these are the arguments given to use: ${target_code_coverage_ARGS}"
217+
)
214218

215219
if(CODE_COVERAGE)
216220

@@ -253,7 +257,8 @@ function(target_code_coverage TARGET_NAME)
253257
)
254258
endif()
255259

256-
add_dependencies(ccov-libs ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
260+
add_dependencies(ccov-libs
261+
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
257262
endif()
258263
endif()
259264

@@ -277,18 +282,22 @@ function(target_code_coverage TARGET_NAME)
277282
# Run the executable, generating raw profile data
278283
add_custom_target(
279284
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
280-
COMMAND LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw
281-
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
285+
COMMAND
286+
LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw
287+
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
282288
COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
283289
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
284-
COMMAND echo "${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw " >>
285-
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
290+
COMMAND
291+
echo
292+
"${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw "
293+
>> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
286294
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
287295

288296
# Merge the generated profile data so llvm-cov can process it
289297
add_custom_target(
290298
ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}
291-
COMMAND ${LLVM_PROFDATA_PATH} merge -sparse ${target_code_coverage_COVERAGE_TARGET_NAME}.profraw -o
299+
COMMAND ${LLVM_PROFDATA_PATH} merge -sparse
300+
${target_code_coverage_COVERAGE_TARGET_NAME}.profraw -o
292301
${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
293302
DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
294303

@@ -305,31 +314,34 @@ function(target_code_coverage TARGET_NAME)
305314
ccov-show-${target_code_coverage_COVERAGE_TARGET_NAME}
306315
COMMAND
307316
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
308-
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata -show-line-counts-or-regions
309-
${EXCLUDE_REGEX}
317+
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
318+
-show-line-counts-or-regions ${EXCLUDE_REGEX}
310319
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME})
311320

312321
# Print out a summary of the coverage information to the command line
313322
add_custom_target(
314323
ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME}
315-
COMMAND ${LLVM_COV_PATH} report $<TARGET_FILE:${TARGET_NAME}>
316-
${SO_OBJECTS} -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
317-
${EXCLUDE_REGEX}
324+
COMMAND
325+
${LLVM_COV_PATH} report $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
326+
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
327+
${EXCLUDE_REGEX}
318328
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME})
319329

320330
# Generates HTML output of the coverage information for perusal
321331
add_custom_target(
322332
ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
323333
COMMAND
324334
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
325-
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata -show-line-counts-or-regions
335+
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
336+
-show-line-counts-or-regions
326337
-output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}
327338
-format="html" ${EXCLUDE_REGEX}
328339
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME})
329340

330341
elseif(CMAKE_COMPILER_IS_GNUCXX)
331342
set(COVERAGE_INFO
332-
"${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.info")
343+
"${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.info"
344+
)
333345

334346
# Run the executable, generating coverage information
335347
add_custom_target(
@@ -370,9 +382,10 @@ function(target_code_coverage TARGET_NAME)
370382
# Generates HTML output of the coverage information for perusal
371383
add_custom_target(
372384
ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
373-
COMMAND ${GENHTML_PATH} -o
374-
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}
375-
${COVERAGE_INFO}
385+
COMMAND
386+
${GENHTML_PATH} -o
387+
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}
388+
${COVERAGE_INFO}
376389
DEPENDS ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME})
377390
endif()
378391

@@ -395,7 +408,9 @@ function(target_code_coverage TARGET_NAME)
395408
if(NOT TARGET ccov-report)
396409
add_custom_target(ccov-report)
397410
endif()
398-
add_dependencies(ccov-report ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME})
411+
add_dependencies(
412+
ccov-report
413+
ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME})
399414
endif()
400415
endif()
401416

@@ -408,7 +423,8 @@ function(target_code_coverage TARGET_NAME)
408423
)
409424
endif()
410425

411-
add_dependencies(ccov-all-processing ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
426+
add_dependencies(ccov-all-processing
427+
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
412428
endif()
413429
endif()
414430
endif()

0 commit comments

Comments
 (0)