Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Factor Crossdock support out into separate build
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Ringer <[email protected]>
  • Loading branch information
ringerc committed Feb 1, 2018
1 parent 0020198 commit 3a35900
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 32 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ if (BUILD_TESTING)
enable_testing()
add_custom_target(check COMMAND echo "run make test instead")
endif()

add_subdirectory(src/jaegertracing)
add_subdirectory(crossdock)
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ Most other cmake standard variables
<https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html> are
supported.

## Running tests

A set of mocked, server-less tests may be run with

make test

Integration tests using Crossdock <https://github.com/crossdock/crossdock>
may be enabled with the `cmake` option `-DJAEGERTRACING_BUILD_CROSSDOCK=1`
then running `make crossdock-run`.

[ci-img]: https://travis-ci.org/jaegertracing/cpp-client.svg?branch=master
[ci]: https://travis-ci.org/jaegertracing/cpp-client
[cov-img]: https://codecov.io/gh/jaegertracing/cpp-client/branch/master/graph/badge.svg
Expand Down
38 changes: 38 additions & 0 deletions crossdock/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.3)

project(jaegertracing_crossdock LANGUAGES CXX)

if(JAEGERTRACING_BUILD_CROSSDOCK)
add_executable(crossdock Server.cpp)
target_include_directories(crossdock PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
target_link_libraries(crossdock PUBLIC jaegertracing-static)

set(JAEGER_CROSSDOCK_URL
"https://raw.githubusercontent.com/jaegertracing/jaeger/master/docker-compose/\
jaeger-docker-compose.yml")
file(DOWNLOAD ${JAEGER_CROSSDOCK_URL} "${CMAKE_CURRENT_BINARY_DIR}/jaeger-docker-compose.yml")
find_program(DOCKER_COMPOSE_EXE docker-compose)
if (NOT DOCKER_COMPOSE_EXE)
message(WARNING "cannot build crossdock support requested by -DJAEGERTRACING_BUILD_CROSSDOCK: docker-compose not found")
else()
set(DOCKER_COMPOSE_CMD ${DOCKER_COMPOSE_EXE}
-f "${CMAKE_CURRENT_SOURCE_DIR}/docker-compose.yml"
-f "${CMAKE_CURRENT_BINARY_DIR}/jaeger-docker-compose.yml")
add_custom_target(crossdock-kill
COMMAND ${DOCKER_COMPOSE_CMD} kill
COMMAND ${DOCKER_COMPOSE_CMD} rm --force)
add_custom_target(crossdock-run
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
add_custom_target(crossdock-fresh
COMMAND ${DOCKER_COMPOSE_CMD} pull
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
add_custom_target(crossdock-logs
COMMAND ${DOCKER_COMPOSE_CMD} logs)
message(STATUS "crossdock enabled, use 'make crossdock-run'")
endif()
endif()
32 changes: 0 additions & 32 deletions src/jaegertracing/CMakeLists-UnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ if(BUILD_TESTING)
"*Test.cpp")
endif()

if(JAEGERTRACING_BUILD_CROSSDOCK)
set(CROSSDOCK_SRC crossdock/Server.cpp)
add_executable(crossdock ${CROSSDOCK_SRC})
target_include_directories(crossdock PUBLIC
$<BUILD_INTERFACE:${jaegertracing_SOURCE_DIR}/crossdock>)
target_link_libraries(crossdock PUBLIC jaegertracing-static)

set(JAEGER_CROSSDOCK_URL
"https://raw.githubusercontent.com/jaegertracing/jaeger/master/docker-compose/\
jaeger-docker-compose.yml")
file(DOWNLOAD ${JAEGER_CROSSDOCK_URL}
"${jaegertracing_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml")
find_program(DOCKER_COMPOSE_EXE docker-compose REQUIRED)
set(DOCKER_COMPOSE_CMD ${DOCKER_COMPOSE_EXE}
-f ${jaegertracing_SOURCE_DIR}/crossdock/docker-compose.yml
-f ${jaegertracing_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml)
add_custom_target(crossdock-kill
COMMAND ${DOCKER_COMPOSE_CMD} kill
COMMAND ${DOCKER_COMPOSE_CMD} rm --force)
add_custom_target(crossdock-run
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
add_custom_target(crossdock-fresh
COMMAND ${DOCKER_COMPOSE_CMD} pull
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
add_custom_target(crossdock-logs
COMMAND ${DOCKER_COMPOSE_CMD} logs)
endif()


if(BUILD_TESTING)
set(TEST_SRC
Expand Down

0 comments on commit 3a35900

Please sign in to comment.