Problem: test not using cppzmq

Solution: add dependency on cppzmq
This commit is contained in:
Simon Giesecke 2018-03-29 18:14:34 +02:00
parent e5ca9a0a95
commit 07b583a99a
4 changed files with 11 additions and 9 deletions

View File

@ -18,7 +18,7 @@ addons:
env: env:
matrix: matrix:
# - BUILD_TYPE=cmake DRAFT=enabled # - BUILD_TYPE=cmake DRAFT=enabled
- BUILD_TYPE=cmake - BUILD_TYPE=cmake ZMQ_VERSION=4.2.5
matrix: matrix:
include: include:
@ -41,4 +41,4 @@ script:
- ./ci_build.sh - ./ci_build.sh
after_success: after_success:
- coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" - coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*libzmq/"

View File

@ -7,9 +7,9 @@ install_zeromq() {
mkdir libzmq mkdir libzmq
cd libzmq cd libzmq
curl -L https://github.com/zeromq/libzmq/releases/download/v${ZMQ_VERSION}/zeromq-${ZMQ_VERSION}.tar.gz >zeromq.tar.gz curl -L https://github.com/zeromq/libzmq/archive/v${ZMQ_VERSION}.tar.gz >zeromq.tar.gz
tar -xvzf zeromq.tar.gz tar -xvzf zeromq.tar.gz
cd zeromq-${ZMQ_VERSION} cd libzmq-${ZMQ_VERSION}
mkdir build mkdir build
cd build cd build

View File

@ -21,7 +21,7 @@ fetch_googletest(
${PROJECT_BINARY_DIR}/googletest ${PROJECT_BINARY_DIR}/googletest
) )
#find_package(cppzmq) find_package(cppzmq)
enable_testing() enable_testing()
@ -33,6 +33,7 @@ add_executable(
target_link_libraries( target_link_libraries(
unit_tests unit_tests
gtest_main gtest_main
libzmq
) )
add_test( add_test(

View File

@ -1,8 +1,9 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <zmq.hpp>
TEST(example, add) TEST(create_context, add)
{ {
double res; zmq::context_t context;
res = 1.0 + 2.0;
ASSERT_NEAR(res, 3.0, 1.0e-11);
} }