Skip to content

Commit

Permalink
fixup! chore: CI to test CPP SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKasar committed Dec 3, 2024
1 parent cc6a007 commit 1dd80eb
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/sdks/manage/src/cpp/sdk/cpptest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,35 @@ if(ENABLE_UNIT_TESTS)
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
)

set_target_properties(${UNIT_TESTS_APP} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)

include(GoogleTest)
gtest_discover_tests(${UNIT_TESTS_APP})
endif()
endif()

if(ENABLE_COVERAGE)
include(${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake)

set(COVERAGE_MAIN "coverage")
set(COVERAGE_EXCLUDES
"${CMAKE_SOURCE_DIR}/build/*"
"${CMAKE_SOURCE_DIR}/cmake/*"
"${CMAKE_SOURCE_DIR}/include/*"
"${CMAKE_SOURCE_DIR}/test/*"
"/usr/include/*")

set(COVERAGE_EXTRA_FLAGS)
set(COVERAGE_DEPENDENCIES ${UNIT_TESTS_APP})

setup_target_for_coverage_gcovr_html(
NAME ${COVERAGE_MAIN}
BASE_DIRECTORY ${CMAKE_SOURCE_DIR}
EXECUTABLE ctest
EXECUTABLE_ARGS "--test-dir ../build/ --output-on-failure"
DEPENDENCIES ${COVERAGE_DEPENDENCIES}
)

endif()

0 comments on commit 1dd80eb

Please sign in to comment.