Skip to content

Commit f78bfe2

Browse files
committed
Added coverage test option to the CMakeFiles.
Issue #4 : Add gcov support for x86 build.
1 parent ddb0ff6 commit f78bfe2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ cmake_minimum_required(VERSION 3.13)
55

66
add_library(rpp_driver INTERFACE)
77

8+
# Win/Unix specific option.
9+
if((${WIN32}) OR (${UNIX}))
10+
target_compile_options(rpp_driver
11+
INTERFACE
12+
--coverage
13+
)
14+
endif()
15+
816
add_subdirectory(codec)
917
add_subdirectory(i2c)
1018
add_subdirectory(gpio)

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ add_executable(${PROJECT_NAME} ${SOURCES})
1313
GTest::gmock_main
1414
rpp_driver
1515
)
16+
target_link_options(${PROJECT_NAME}
17+
PRIVATE --coverage)
1618

1719
include(GoogleTest)
1820
gtest_discover_tests(${PROJECT_NAME})

0 commit comments

Comments
 (0)