mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-12 18:40:28 +01:00
6caa5d19d3
* Added overload constructor (c++11 only) taking iteratable object. It would be easier to use std::string, std::array etc to construct a message now. Making it a draft for now in case it is too greedy and needs to be more specialize. * Added equal and not euqal operator to message_t as a recommended and expected way of comparing objects in C++. * deprecated C style equal method as operator== should be used instead (point above). * Added message_t test covering all available message_t's constructors
45 lines
1005 B
CMake
45 lines
1005 B
CMake
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|
|
|
project(cppzmq-test CXX)
|
|
|
|
# place binaries and libraries according to GNU standards
|
|
|
|
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)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
|
|
endif()
|
|
|
|
include(cmake/googletest.cmake)
|
|
fetch_googletest(
|
|
${PROJECT_SOURCE_DIR}/cmake
|
|
${PROJECT_BINARY_DIR}/googletest
|
|
)
|
|
|
|
add_executable(
|
|
unit_tests
|
|
message.cpp
|
|
context.cpp
|
|
socket.cpp
|
|
poller.cpp
|
|
)
|
|
|
|
target_link_libraries(
|
|
unit_tests
|
|
gtest_main
|
|
libzmq
|
|
)
|
|
|
|
target_include_directories(unit_tests PRIVATE ..)
|
|
|
|
add_test(
|
|
NAME
|
|
unit
|
|
COMMAND
|
|
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/unit_tests
|
|
)
|