48 lines
1.2 KiB
CMake
48 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.25)
|
|
project(bproto_test)
|
|
enable_testing()
|
|
|
|
include("../../backend_output/c/HCP.cmake")
|
|
|
|
# include CTest support
|
|
include(CTest)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
# Adding Unity test framework
|
|
add_library(unity STATIC Unity/src/unity.c)
|
|
target_include_directories(unity PUBLIC Unity/src)
|
|
|
|
# Normal test target
|
|
add_executable(test_runner
|
|
src/main.c
|
|
src/test_messages.c
|
|
)
|
|
|
|
target_link_libraries(test_runner PUBLIC
|
|
bproto
|
|
unity
|
|
gcov
|
|
)
|
|
|
|
target_include_directories(test_runner PUBLIC
|
|
${CMAKE_CURRENT_LIST_DIR}/src
|
|
)
|
|
|
|
target_compile_options(test_runner PRIVATE -fprofile-arcs -ftest-coverage -fPIC -O0 --coverage)
|
|
target_compile_options(bproto PRIVATE -fprofile-arcs -ftest-coverage -fPIC -O0 --coverage)
|
|
target_link_options(test_runner PRIVATE -fprofile-arcs -ftest-coverage -fPIC --coverage)
|
|
target_link_options(bproto PRIVATE -fprofile-arcs -ftest-coverage -fPIC --coverage)
|
|
|
|
# Python Integration test build
|
|
add_executable(test_integration_python
|
|
src/test_python_integration.c
|
|
)
|
|
|
|
target_link_libraries(test_integration_python PUBLIC
|
|
bproto
|
|
gcov
|
|
)
|
|
|
|
target_include_directories(test_integration_python PUBLIC
|
|
${CMAKE_CURRENT_LIST_DIR}/src
|
|
) |