Skip to content

Commit 6c60b4a

Browse files
committed
Add option to disable coverage cleanup. Cleanup after rebase.
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
1 parent 9488564 commit 6c60b4a

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ option(LIBOCPP_ENABLE_DEPRECATED_WEBSOCKETPP "Websocket++ has been removed from
2020

2121
option(LIBOCPP_ENABLE_V16 "Enable OCPP 1.6 in the ocpp library" ON)
2222
option(LIBOCPP_ENABLE_V201 "Enable OCPP 2.0.1 in the ocpp library" ON)
23+
option(LIBOCPP_ENABLE_COVERAGE_CLEANUP "Cleanup 'old' coverage files before running coverage again" ON)
2324

2425
if((NOT LIBOCPP_ENABLE_V16) AND (NOT LIBOCPP_ENABLE_V201))
2526
message(FATAL_ERROR "At least one of LIBOCPP_ENABLE_V16 and LIBOCPP_ENABLE_V201 needs to be ON")

tests/CMakeLists.txt

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,43 +82,24 @@ add_custom_command(TARGET libocpp_unit_tests POST_BUILD
8282

8383
set(GCOVR_ADDITIONAL_ARGS "--gcov-ignore-parse-errors=negative_hits.warn")
8484

85-
target_include_directories(libocpp_unit_tests PUBLIC
86-
${CMAKE_CURRENT_SOURCE_DIR}
87-
${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/common
88-
)
89-
target_link_libraries(libocpp_unit_tests PRIVATE
90-
ocpp
91-
GTest::gmock_main
92-
GTest::gtest_main
93-
)
94-
9585
set(GCOVR_DEPENDENCIES libocpp_unit_tests)
9686

97-
add_subdirectory(lib/ocpp/common)
98-
99-
if(LIBOCPP_ENABLE_V16)
100-
add_subdirectory(lib/ocpp/v16)
101-
endif()
102-
103-
if(LIBOCPP_ENABLE_V201)
104-
add_subdirectory(lib/ocpp/v201)
105-
endif()
106-
10787
# If ev-coverage is installed, remove gcda files and orphaned object / gcno files.
10888
find_program(EV_COVERAGE ev-coverage)
10989

11090
if (NOT EV_COVERAGE)
11191
message("The \"ev-dev-tools\" Python3 package is not installed. You can install it going to
11292
`everest-utils/ev-dev-tools` and type `pip install .`")
11393
else()
114-
add_custom_target(cleanup_coverage
115-
COMMAND
116-
${EV_COVERAGE}
117-
remove_files
118-
--source-dirs=${LIBOCPP_ROOT_SRC_DIR}
119-
--build-dir=${LIBOCPP_ROOT_BUILD_DIR})
120-
list(APPEND GCOVR_DEPENDENCIES cleanup_coverage)
121-
endif()
94+
if(LIBOCPP_ENABLE_COVERAGE_CLEANUP)
95+
add_custom_target(cleanup_coverage
96+
COMMAND
97+
${EV_COVERAGE}
98+
remove_files
99+
--build-dir=${LIBOCPP_ROOT_BUILD_DIR})
100+
list(APPEND GCOVR_DEPENDENCIES cleanup_coverage)
101+
endif() # LIBOCPP_ENABLE_COVERAGE_CLEANUP
102+
endif() # EV_COVERAGE
122103

123104
# Run gcovr with the number of processors in this system
124105
ProcessorCount(number_of_procs)

0 commit comments

Comments
 (0)