From 07b583a99a8566057fe81921b46bdf3e9e6191e3 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Thu, 29 Mar 2018 18:14:34 +0200 Subject: [PATCH] Problem: test not using cppzmq Solution: add dependency on cppzmq --- .travis.yml | 4 ++-- ci_build.sh | 4 ++-- tests/CMakeLists.txt | 3 ++- tests/example_add.cpp | 9 +++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b8f2f6..18b2e6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ addons: env: matrix: # - BUILD_TYPE=cmake DRAFT=enabled - - BUILD_TYPE=cmake + - BUILD_TYPE=cmake ZMQ_VERSION=4.2.5 matrix: include: @@ -41,4 +41,4 @@ script: - ./ci_build.sh after_success: - - coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" + - coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*libzmq/" diff --git a/ci_build.sh b/ci_build.sh index 98cd945..ea3e6b6 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -7,9 +7,9 @@ install_zeromq() { mkdir 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 - cd zeromq-${ZMQ_VERSION} + cd libzmq-${ZMQ_VERSION} mkdir build cd build diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f33c634..ea10621 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,7 +21,7 @@ fetch_googletest( ${PROJECT_BINARY_DIR}/googletest ) -#find_package(cppzmq) +find_package(cppzmq) enable_testing() @@ -33,6 +33,7 @@ add_executable( target_link_libraries( unit_tests gtest_main + libzmq ) add_test( diff --git a/tests/example_add.cpp b/tests/example_add.cpp index dc5ca5b..25c9609 100644 --- a/tests/example_add.cpp +++ b/tests/example_add.cpp @@ -1,8 +1,9 @@ #include "gtest/gtest.h" +#include -TEST(example, add) +TEST(create_context, add) { - double res; - res = 1.0 + 2.0; - ASSERT_NEAR(res, 3.0, 1.0e-11); + zmq::context_t context; + + }