mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-17 03:03:26 +02:00
Problem: code coverage not working
Solution: build tests within cppzmq build, and add separate demo
This commit is contained in:
@@ -3,12 +3,11 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||
project(cppzmq-test CXX)
|
||||
|
||||
# place binaries and libraries according to GNU standards
|
||||
# TODO check if we should do this
|
||||
|
||||
# include(GNUInstallDirs)
|
||||
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
||||
include(GNUInstallDirs)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
# we use this to get code coverage
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
@@ -20,10 +19,6 @@ fetch_googletest(
|
||||
${PROJECT_SOURCE_DIR}/cmake
|
||||
${PROJECT_BINARY_DIR}/googletest
|
||||
)
|
||||
|
||||
find_package(cppzmq)
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_executable(
|
||||
unit_tests
|
||||
@@ -36,6 +31,8 @@ target_link_libraries(
|
||||
libzmq
|
||||
)
|
||||
|
||||
target_include_directories(unit_tests PRIVATE ..)
|
||||
|
||||
add_test(
|
||||
NAME
|
||||
unit
|
||||
|
Reference in New Issue
Block a user