File tree Expand file tree Collapse file tree 6 files changed +45
-12
lines changed Expand file tree Collapse file tree 6 files changed +45
-12
lines changed Original file line number Diff line number Diff line change @@ -41,4 +41,4 @@ script:
41
41
- ./ci_build.sh
42
42
43
43
after_success :
44
- - coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*libzmq/"
44
+ - coveralls --root . -E ".*external.*" -E ".*CMakeFiles.*" -E ".*tests/" -E ".*demo/" -E ".* libzmq/"
Original file line number Diff line number Diff line change @@ -63,3 +63,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
63
63
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} )
64
64
install (FILES ${CMAKE_CURRENT_SOURCE_DIR} /libzmq-pkg-config/FindZeroMQ.cmake
65
65
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} /libzmq-pkg-config )
66
+
67
+ enable_testing ()
68
+ add_subdirectory (tests )
Original file line number Diff line number Diff line change @@ -29,11 +29,13 @@ pushd .
29
29
mkdir build
30
30
cd build
31
31
cmake ..
32
+ cmake --build .
32
33
sudo make -j4 install
34
+ make test ARGS=" -V"
33
35
popd
34
36
35
- # build cppzmq tests
36
- cd tests
37
+ # build cppzmq demo
38
+ cd demo
37
39
mkdir build
38
40
cd build
39
41
cmake ..
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.0 FATAL_ERROR )
2
+
3
+ project (cppzmq-demo CXX )
4
+
5
+ find_package (cppzmq )
6
+
7
+ enable_testing ()
8
+ add_executable (
9
+ demo
10
+ main.cpp
11
+ )
12
+
13
+ target_link_libraries (
14
+ demo
15
+ libzmq
16
+ )
17
+
18
+ add_test (
19
+ NAME
20
+ demo
21
+ COMMAND
22
+ ${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_BINDIR}/demo
23
+ )
Original file line number Diff line number Diff line change
1
+ #include < zmq.hpp>
2
+
3
+ int main (int argc, char ** argv)
4
+ {
5
+ zmq::context_t context;
6
+
7
+ return 0 ;
8
+ }
Original file line number Diff line number Diff line change @@ -3,12 +3,11 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
3
3
project (cppzmq-test CXX )
4
4
5
5
# place binaries and libraries according to GNU standards
6
- # TODO check if we should do this
7
6
8
- # include(GNUInstallDirs)
9
- # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
10
- # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
11
- # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
7
+ include (GNUInstallDirs )
8
+ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_LIBDIR} )
9
+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_LIBDIR} )
10
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_BINDIR} )
12
11
13
12
# we use this to get code coverage
14
13
if (CMAKE_CXX_COMPILER_ID MATCHES GNU )
@@ -20,10 +19,6 @@ fetch_googletest(
20
19
${PROJECT_SOURCE_DIR} /cmake
21
20
${PROJECT_BINARY_DIR} /googletest
22
21
)
23
-
24
- find_package (cppzmq )
25
-
26
- enable_testing ()
27
22
28
23
add_executable (
29
24
unit_tests
@@ -36,6 +31,8 @@ target_link_libraries(
36
31
libzmq
37
32
)
38
33
34
+ target_include_directories (unit_tests PRIVATE .. )
35
+
39
36
add_test (
40
37
NAME
41
38
unit
You can’t perform that action at this time.
0 commit comments