mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cf9a2944c2 | ||
|
94297f9833 | ||
|
957233cf95 | ||
|
5397cef9d1 | ||
|
f6c1f5dc0f | ||
|
c4145e9ef1 | ||
|
4123ebc9d4 | ||
|
88f897536e | ||
|
e3c55a0ff8 | ||
|
60f27b94b2 | ||
|
adfa0e2c95 | ||
|
c2bea85b90 |
@@ -220,6 +220,9 @@ if(PROJECT_PACKAGE_DEPENDENCIES)
|
|||||||
get_filename_component(prefix ${msgpack_include}/.. ABSOLUTE)
|
get_filename_component(prefix ${msgpack_include}/.. ABSOLUTE)
|
||||||
elseif(${dep} STREQUAL OFI)
|
elseif(${dep} STREQUAL OFI)
|
||||||
get_filename_component(prefix ${${dep}_INCLUDE_DIRS}/.. ABSOLUTE)
|
get_filename_component(prefix ${${dep}_INCLUDE_DIRS}/.. ABSOLUTE)
|
||||||
|
elseif(${dep} STREQUAL nanomsg)
|
||||||
|
get_target_property(nn_include nanomsg INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
get_filename_component(prefix ${nn_include}/.. ABSOLUTE)
|
||||||
elseif(${dep} STREQUAL Doxygen)
|
elseif(${dep} STREQUAL Doxygen)
|
||||||
get_target_property(doxygen_bin Doxygen::doxygen INTERFACE_LOCATION)
|
get_target_property(doxygen_bin Doxygen::doxygen INTERFACE_LOCATION)
|
||||||
get_filename_component(prefix ${doxygen_bin} DIRECTORY)
|
get_filename_component(prefix ${doxygen_bin} DIRECTORY)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<!-- {#mainpage} -->
|
<!-- {#mainpage} -->
|
||||||
# FairMQ [](COPYRIGHT) [](https://alfa-ci.gsi.de/blue/organizations/jenkins/FairRootGroup%2FFairMQ/branches) [](https://codecov.io/gh/FairRootGroup/FairMQ/branch/master)
|
# FairMQ [](COPYRIGHT) [](https://alfa-ci.gsi.de/blue/organizations/jenkins/FairRootGroup%2FFairMQ/branches) [](https://codecov.io/gh/FairRootGroup/FairMQ/branch/master) [](https://www.codacy.com/app/dennisklein/FairMQ?utm_source=github.com&utm_medium=referral&utm_content=FairRootGroup/FairMQ&utm_campaign=Badge_Grade)
|
||||||
|
|
||||||
C++ Message Queuing Library and Framework
|
C++ Message Queuing Library and Framework
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@ set_and_check(@PROJECT_NAME@_CMAKEMODDIR @PACKAGE_CMAKE_INSTALL_PREFIX@/@PROJECT
|
|||||||
set(@PROJECT_NAME@_CXX_STANDARD_REQUIRED @CMAKE_CXX_STANDARD_REQUIRED@)
|
set(@PROJECT_NAME@_CXX_STANDARD_REQUIRED @CMAKE_CXX_STANDARD_REQUIRED@)
|
||||||
set(@PROJECT_NAME@_CXX_STANDARD @CMAKE_CXX_STANDARD@)
|
set(@PROJECT_NAME@_CXX_STANDARD @CMAKE_CXX_STANDARD@)
|
||||||
set(@PROJECT_NAME@_CXX_EXTENSIONS @CMAKE_CXX_EXTENSIONS@)
|
set(@PROJECT_NAME@_CXX_EXTENSIONS @CMAKE_CXX_EXTENSIONS@)
|
||||||
|
set(@PROJECT_NAME@_VERSION_HOTFIX @PROJECT_VERSION_HOTFIX@)
|
||||||
|
|
||||||
### Import cmake modules
|
### Import cmake modules
|
||||||
set(CMAKE_MODULE_PATH ${@PROJECT_NAME@_CMAKEMODDIR} ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${@PROJECT_NAME@_CMAKEMODDIR} ${CMAKE_MODULE_PATH})
|
||||||
|
@@ -123,8 +123,14 @@ macro(set_fairmq_defaults)
|
|||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "Whether to build shared libraries or static archives")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Set -fPIC as default for all library types
|
# Set -fPIC as default for all library types
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Generate compile_commands.json file (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
|
# Generate compile_commands.json file (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
@@ -174,6 +180,12 @@ macro(set_fairmq_defaults)
|
|||||||
# Rationale in https://github.com/ninja-build/ninja/issues/814
|
# Rationale in https://github.com/ninja-build/ninja/issues/814
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT PROJECT_VERSION_TWEAK)
|
||||||
|
set(PROJECT_VERSION_HOTFIX 0)
|
||||||
|
else()
|
||||||
|
set(PROJECT_VERSION_HOTFIX ${PROJECT_VERSION_TWEAK})
|
||||||
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
function(join VALUES GLUE OUTPUT)
|
function(join VALUES GLUE OUTPUT)
|
||||||
|
@@ -38,146 +38,144 @@ endif()
|
|||||||
# libFairMQ header files #
|
# libFairMQ header files #
|
||||||
##########################
|
##########################
|
||||||
set(FAIRMQ_PUBLIC_HEADER_FILES
|
set(FAIRMQ_PUBLIC_HEADER_FILES
|
||||||
DeviceRunner.h
|
DeviceRunner.h
|
||||||
EventManager.h
|
EventManager.h
|
||||||
FairMQChannel.h
|
FairMQChannel.h
|
||||||
FairMQDevice.h
|
FairMQDevice.h
|
||||||
FairMQLogger.h
|
FairMQLogger.h
|
||||||
FairMQMessage.h
|
FairMQMessage.h
|
||||||
FairMQParts.h
|
FairMQParts.h
|
||||||
FairMQPoller.h
|
FairMQPoller.h
|
||||||
FairMQUnmanagedRegion.h
|
FairMQUnmanagedRegion.h
|
||||||
FairMQSocket.h
|
FairMQSocket.h
|
||||||
FairMQStateMachine.h
|
FairMQStateMachine.h
|
||||||
FairMQTransportFactory.h
|
FairMQTransportFactory.h
|
||||||
Tools.h
|
Tools.h
|
||||||
Transports.h
|
Transports.h
|
||||||
options/FairMQProgOptions.h
|
options/FairMQProgOptions.h
|
||||||
options/FairProgOptions.h
|
options/FairProgOptions.h
|
||||||
Plugin.h
|
Plugin.h
|
||||||
PluginManager.h
|
PluginManager.h
|
||||||
PluginServices.h
|
PluginServices.h
|
||||||
runFairMQDevice.h
|
runFairMQDevice.h
|
||||||
tools/CppSTL.h
|
tools/CppSTL.h
|
||||||
tools/Network.h
|
tools/Network.h
|
||||||
tools/Process.h
|
tools/Process.h
|
||||||
tools/RateLimit.h
|
tools/RateLimit.h
|
||||||
tools/Strings.h
|
tools/Strings.h
|
||||||
tools/Unique.h
|
tools/Unique.h
|
||||||
tools/Version.h
|
tools/Version.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(FAIRMQ_PRIVATE_HEADER_FILES
|
set(FAIRMQ_PRIVATE_HEADER_FILES
|
||||||
devices/FairMQBenchmarkSampler.h
|
devices/FairMQBenchmarkSampler.h
|
||||||
devices/FairMQMerger.h
|
devices/FairMQMerger.h
|
||||||
devices/FairMQMultiplier.h
|
devices/FairMQMultiplier.h
|
||||||
devices/FairMQProxy.h
|
devices/FairMQProxy.h
|
||||||
devices/FairMQSink.h
|
devices/FairMQSink.h
|
||||||
devices/FairMQSplitter.h
|
devices/FairMQSplitter.h
|
||||||
options/FairMQParser.h
|
options/FairMQParser.h
|
||||||
options/FairMQSuboptParser.h
|
options/FairMQSuboptParser.h
|
||||||
options/FairProgOptionsHelper.h
|
options/FairProgOptionsHelper.h
|
||||||
plugins/Builtin.h
|
plugins/Builtin.h
|
||||||
plugins/Control.h
|
plugins/Control.h
|
||||||
StateMachine.h
|
StateMachine.h
|
||||||
shmem/FairMQMessageSHM.h
|
shmem/FairMQMessageSHM.h
|
||||||
shmem/FairMQPollerSHM.h
|
shmem/FairMQPollerSHM.h
|
||||||
shmem/FairMQUnmanagedRegionSHM.h
|
shmem/FairMQUnmanagedRegionSHM.h
|
||||||
shmem/FairMQSocketSHM.h
|
shmem/FairMQSocketSHM.h
|
||||||
shmem/FairMQTransportFactorySHM.h
|
shmem/FairMQTransportFactorySHM.h
|
||||||
shmem/Common.h
|
shmem/Common.h
|
||||||
shmem/Manager.h
|
shmem/Manager.h
|
||||||
shmem/Monitor.h
|
shmem/Region.h
|
||||||
shmem/Region.h
|
zeromq/FairMQMessageZMQ.h
|
||||||
zeromq/FairMQMessageZMQ.h
|
zeromq/FairMQPollerZMQ.h
|
||||||
zeromq/FairMQPollerZMQ.h
|
zeromq/FairMQUnmanagedRegionZMQ.h
|
||||||
zeromq/FairMQUnmanagedRegionZMQ.h
|
zeromq/FairMQSocketZMQ.h
|
||||||
zeromq/FairMQSocketZMQ.h
|
zeromq/FairMQTransportFactoryZMQ.h
|
||||||
zeromq/FairMQTransportFactoryZMQ.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_NANOMSG_TRANSPORT)
|
if(BUILD_NANOMSG_TRANSPORT)
|
||||||
set(FAIRMQ_PRIVATE_HEADER_FILES ${FAIRMQ_PRIVATE_HEADER_FILES}
|
set(FAIRMQ_PRIVATE_HEADER_FILES ${FAIRMQ_PRIVATE_HEADER_FILES}
|
||||||
nanomsg/FairMQMessageNN.h
|
nanomsg/FairMQMessageNN.h
|
||||||
nanomsg/FairMQPollerNN.h
|
nanomsg/FairMQPollerNN.h
|
||||||
nanomsg/FairMQUnmanagedRegionNN.h
|
nanomsg/FairMQUnmanagedRegionNN.h
|
||||||
nanomsg/FairMQSocketNN.h
|
nanomsg/FairMQSocketNN.h
|
||||||
nanomsg/FairMQTransportFactoryNN.h
|
nanomsg/FairMQTransportFactoryNN.h
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_OFI_TRANSPORT)
|
if(BUILD_OFI_TRANSPORT)
|
||||||
set(FAIRMQ_PRIVATE_HEADER_FILES ${FAIRMQ_PRIVATE_HEADER_FILES}
|
set(FAIRMQ_PRIVATE_HEADER_FILES ${FAIRMQ_PRIVATE_HEADER_FILES}
|
||||||
ofi/Context.h
|
ofi/Context.h
|
||||||
ofi/Message.h
|
ofi/Message.h
|
||||||
ofi/Poller.h
|
ofi/Poller.h
|
||||||
ofi/Socket.h
|
ofi/Socket.h
|
||||||
ofi/TransportFactory.h
|
ofi/TransportFactory.h
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# libFairMQ source files #
|
# libFairMQ source files #
|
||||||
##########################
|
##########################
|
||||||
set(FAIRMQ_SOURCE_FILES
|
set(FAIRMQ_SOURCE_FILES
|
||||||
DeviceRunner.cxx
|
DeviceRunner.cxx
|
||||||
FairMQChannel.cxx
|
FairMQChannel.cxx
|
||||||
FairMQDevice.cxx
|
FairMQDevice.cxx
|
||||||
FairMQLogger.cxx
|
FairMQLogger.cxx
|
||||||
FairMQMessage.cxx
|
FairMQMessage.cxx
|
||||||
FairMQPoller.cxx
|
FairMQPoller.cxx
|
||||||
FairMQSocket.cxx
|
FairMQSocket.cxx
|
||||||
FairMQStateMachine.cxx
|
FairMQStateMachine.cxx
|
||||||
FairMQTransportFactory.cxx
|
FairMQTransportFactory.cxx
|
||||||
devices/FairMQBenchmarkSampler.cxx
|
devices/FairMQBenchmarkSampler.cxx
|
||||||
devices/FairMQMerger.cxx
|
devices/FairMQMerger.cxx
|
||||||
devices/FairMQMultiplier.cxx
|
devices/FairMQMultiplier.cxx
|
||||||
devices/FairMQProxy.cxx
|
devices/FairMQProxy.cxx
|
||||||
devices/FairMQSplitter.cxx
|
devices/FairMQSplitter.cxx
|
||||||
options/FairMQParser.cxx
|
options/FairMQParser.cxx
|
||||||
options/FairMQProgOptions.cxx
|
options/FairMQProgOptions.cxx
|
||||||
options/FairMQSuboptParser.cxx
|
options/FairMQSuboptParser.cxx
|
||||||
Plugin.cxx
|
Plugin.cxx
|
||||||
PluginManager.cxx
|
PluginManager.cxx
|
||||||
PluginServices.cxx
|
PluginServices.cxx
|
||||||
plugins/Control.cxx
|
plugins/Control.cxx
|
||||||
StateMachine.cxx
|
StateMachine.cxx
|
||||||
shmem/FairMQMessageSHM.cxx
|
shmem/FairMQMessageSHM.cxx
|
||||||
shmem/FairMQPollerSHM.cxx
|
shmem/FairMQPollerSHM.cxx
|
||||||
shmem/FairMQUnmanagedRegionSHM.cxx
|
shmem/FairMQUnmanagedRegionSHM.cxx
|
||||||
shmem/FairMQSocketSHM.cxx
|
shmem/FairMQSocketSHM.cxx
|
||||||
shmem/FairMQTransportFactorySHM.cxx
|
shmem/FairMQTransportFactorySHM.cxx
|
||||||
shmem/Manager.cxx
|
shmem/Manager.cxx
|
||||||
shmem/Monitor.cxx
|
shmem/Region.cxx
|
||||||
shmem/Region.cxx
|
tools/Network.cxx
|
||||||
tools/Network.cxx
|
tools/Process.cxx
|
||||||
tools/Process.cxx
|
tools/Unique.cxx
|
||||||
tools/Unique.cxx
|
zeromq/FairMQMessageZMQ.cxx
|
||||||
zeromq/FairMQMessageZMQ.cxx
|
zeromq/FairMQPollerZMQ.cxx
|
||||||
zeromq/FairMQPollerZMQ.cxx
|
zeromq/FairMQUnmanagedRegionZMQ.cxx
|
||||||
zeromq/FairMQUnmanagedRegionZMQ.cxx
|
zeromq/FairMQSocketZMQ.cxx
|
||||||
zeromq/FairMQSocketZMQ.cxx
|
zeromq/FairMQTransportFactoryZMQ.cxx
|
||||||
zeromq/FairMQTransportFactoryZMQ.cxx
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BUILD_NANOMSG_TRANSPORT)
|
if(BUILD_NANOMSG_TRANSPORT)
|
||||||
set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES}
|
set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES}
|
||||||
nanomsg/FairMQMessageNN.cxx
|
nanomsg/FairMQMessageNN.cxx
|
||||||
nanomsg/FairMQPollerNN.cxx
|
nanomsg/FairMQPollerNN.cxx
|
||||||
nanomsg/FairMQUnmanagedRegionNN.cxx
|
nanomsg/FairMQUnmanagedRegionNN.cxx
|
||||||
nanomsg/FairMQSocketNN.cxx
|
nanomsg/FairMQSocketNN.cxx
|
||||||
nanomsg/FairMQTransportFactoryNN.cxx
|
nanomsg/FairMQTransportFactoryNN.cxx
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_OFI_TRANSPORT)
|
if(BUILD_OFI_TRANSPORT)
|
||||||
set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES}
|
set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES}
|
||||||
ofi/Context.cxx
|
ofi/Context.cxx
|
||||||
ofi/Message.cxx
|
ofi/Message.cxx
|
||||||
ofi/Poller.cxx
|
ofi/Poller.cxx
|
||||||
ofi/Socket.cxx
|
ofi/Socket.cxx
|
||||||
ofi/TransportFactory.cxx
|
ofi/TransportFactory.cxx
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +195,7 @@ if(FAST_BUILD)
|
|||||||
else()
|
else()
|
||||||
set(_target FairMQ)
|
set(_target FairMQ)
|
||||||
endif()
|
endif()
|
||||||
add_library(${_target} SHARED
|
add_library(${_target}
|
||||||
${FAIRMQ_SOURCE_FILES}
|
${FAIRMQ_SOURCE_FILES}
|
||||||
${FAIRMQ_PUBLIC_HEADER_FILES} # for IDE integration
|
${FAIRMQ_PUBLIC_HEADER_FILES} # for IDE integration
|
||||||
${FAIRMQ_PRIVATE_HEADER_FILES} # for IDE integration
|
${FAIRMQ_PRIVATE_HEADER_FILES} # for IDE integration
|
||||||
@@ -211,12 +209,12 @@ endif()
|
|||||||
# include directories #
|
# include directories #
|
||||||
#######################
|
#######################
|
||||||
target_include_directories(${_target}
|
target_include_directories(${_target}
|
||||||
PUBLIC # consumers inherit public include directories
|
PUBLIC # consumers inherit public include directories
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<INSTALL_INTERFACE:include/fairmq>
|
$<INSTALL_INTERFACE:include/fairmq>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -234,25 +232,26 @@ if(optional_deps)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${_target}
|
target_link_libraries(${_target}
|
||||||
INTERFACE # only consumers link against interface dependencies
|
INTERFACE # only consumers link against interface dependencies
|
||||||
|
|
||||||
PUBLIC # libFairMQ AND consumers of libFairMQ link aginst public dependencies
|
PUBLIC # libFairMQ AND consumers of libFairMQ link aginst public dependencies
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
dl
|
dl
|
||||||
Boost::boost
|
$<$<PLATFORM_ID:Linux>:rt>
|
||||||
Boost::program_options
|
Boost::boost
|
||||||
Boost::thread
|
Boost::program_options
|
||||||
Boost::system
|
Boost::thread
|
||||||
Boost::filesystem
|
Boost::system
|
||||||
Boost::regex
|
Boost::filesystem
|
||||||
Boost::date_time
|
Boost::regex
|
||||||
Boost::signals
|
Boost::date_time
|
||||||
FairLogger::FairLogger
|
Boost::signals
|
||||||
|
FairLogger::FairLogger
|
||||||
|
|
||||||
PRIVATE # only libFairMQ links against private dependencies
|
PRIVATE # only libFairMQ links against private dependencies
|
||||||
libzmq
|
libzmq
|
||||||
${NANOMSG_DEPS}
|
${NANOMSG_DEPS}
|
||||||
${OFI_DEPS}
|
${OFI_DEPS}
|
||||||
)
|
)
|
||||||
set_target_properties(${_target} PROPERTIES
|
set_target_properties(${_target} PROPERTIES
|
||||||
VERSION ${PROJECT_GIT_VERSION}
|
VERSION ${PROJECT_GIT_VERSION}
|
||||||
@@ -299,8 +298,17 @@ target_link_libraries(fairmq-splitter FairMQ)
|
|||||||
add_executable(runConfigExample options/runConfigEx.cxx)
|
add_executable(runConfigExample options/runConfigEx.cxx)
|
||||||
target_link_libraries(runConfigExample FairMQ)
|
target_link_libraries(runConfigExample FairMQ)
|
||||||
|
|
||||||
add_executable(fairmq-shmmonitor shmem/runMonitor.cxx)
|
add_executable(fairmq-shmmonitor shmem/Monitor.cxx shmem/Monitor.h shmem/runMonitor.cxx)
|
||||||
target_link_libraries(fairmq-shmmonitor FairMQ)
|
target_link_libraries(fairmq-shmmonitor PUBLIC
|
||||||
|
Threads::Threads
|
||||||
|
$<$<PLATFORM_ID:Linux>:rt>
|
||||||
|
Boost::boost
|
||||||
|
Boost::date_time
|
||||||
|
Boost::program_options
|
||||||
|
)
|
||||||
|
target_include_directories(fairmq-shmmonitor PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(fairmq-uuid-gen run/runUuidGenerator.cxx)
|
add_executable(fairmq-uuid-gen run/runUuidGenerator.cxx)
|
||||||
target_link_libraries(fairmq-uuid-gen FairMQ)
|
target_link_libraries(fairmq-uuid-gen FairMQ)
|
||||||
@@ -310,27 +318,28 @@ target_link_libraries(fairmq-uuid-gen FairMQ)
|
|||||||
# install #
|
# install #
|
||||||
###########
|
###########
|
||||||
install(
|
install(
|
||||||
TARGETS
|
TARGETS
|
||||||
FairMQ
|
FairMQ
|
||||||
fairmq-bsampler
|
fairmq-bsampler
|
||||||
fairmq-merger
|
fairmq-merger
|
||||||
fairmq-multiplier
|
fairmq-multiplier
|
||||||
fairmq-proxy
|
fairmq-proxy
|
||||||
fairmq-sink
|
fairmq-sink
|
||||||
fairmq-splitter
|
fairmq-splitter
|
||||||
fairmq-shmmonitor
|
fairmq-shmmonitor
|
||||||
fairmq-uuid-gen
|
fairmq-uuid-gen
|
||||||
|
|
||||||
EXPORT ${PROJECT_EXPORT_SET}
|
EXPORT ${PROJECT_EXPORT_SET}
|
||||||
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR}
|
||||||
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${PROJECT_INSTALL_LIBDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# preserve relative path and prepend fairmq
|
# preserve relative path and prepend fairmq
|
||||||
foreach(HEADER ${FAIRMQ_PUBLIC_HEADER_FILES})
|
foreach(HEADER ${FAIRMQ_PUBLIC_HEADER_FILES})
|
||||||
get_filename_component(_path ${HEADER} DIRECTORY)
|
get_filename_component(_path ${HEADER} DIRECTORY)
|
||||||
file(TO_CMAKE_PATH ${PROJECT_INSTALL_INCDIR}/${_path} _destination)
|
file(TO_CMAKE_PATH ${PROJECT_INSTALL_INCDIR}/${_path} _destination)
|
||||||
install(FILES ${HEADER}
|
install(FILES ${HEADER}
|
||||||
DESTINATION ${_destination}
|
DESTINATION ${_destination}
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
@@ -7,16 +7,19 @@
|
|||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include "DeviceRunner.h"
|
#include "DeviceRunner.h"
|
||||||
#include <fairmq/Tools.h>
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <fairmq/Tools.h>
|
||||||
|
#include <fairmq/Version.h>
|
||||||
|
|
||||||
using namespace fair::mq;
|
using namespace fair::mq;
|
||||||
|
|
||||||
DeviceRunner::DeviceRunner(int argc, char* const argv[])
|
DeviceRunner::DeviceRunner(int argc, char* const argv[], bool printLogo)
|
||||||
: fRawCmdLineArgs(tools::ToStrVector(argc, argv, false))
|
: fRawCmdLineArgs(tools::ToStrVector(argc, argv, false))
|
||||||
, fConfig()
|
, fConfig()
|
||||||
, fDevice(nullptr)
|
, fDevice(nullptr)
|
||||||
, fPluginManager(fRawCmdLineArgs)
|
, fPluginManager(fRawCmdLineArgs)
|
||||||
|
, fPrintLogo(printLogo)
|
||||||
, fEvents()
|
, fEvents()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -33,26 +36,34 @@ auto DeviceRunner::Run() -> int
|
|||||||
fEvents.Emit<hooks::SetCustomCmdLineOptions>(*this);
|
fEvents.Emit<hooks::SetCustomCmdLineOptions>(*this);
|
||||||
////////////////////////
|
////////////////////////
|
||||||
|
|
||||||
fPluginManager.ForEachPluginProgOptions([&](boost::program_options::options_description options){
|
fPluginManager.ForEachPluginProgOptions(
|
||||||
fConfig.AddToCmdLineOptions(options);
|
[&](boost::program_options::options_description options) {
|
||||||
});
|
fConfig.AddToCmdLineOptions(options);
|
||||||
|
});
|
||||||
fConfig.AddToCmdLineOptions(fPluginManager.ProgramOptions());
|
fConfig.AddToCmdLineOptions(fPluginManager.ProgramOptions());
|
||||||
|
|
||||||
////// CALL HOOK ///////
|
////// CALL HOOK ///////
|
||||||
fEvents.Emit<hooks::ModifyRawCmdLineArgs>(*this);
|
fEvents.Emit<hooks::ModifyRawCmdLineArgs>(*this);
|
||||||
////////////////////////
|
////////////////////////
|
||||||
|
|
||||||
if (fConfig.ParseAll(fRawCmdLineArgs, true))
|
if (fConfig.ParseAll(fRawCmdLineArgs, true)) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fPrintLogo) {
|
||||||
|
LOG(info) << std::endl
|
||||||
|
<< " ______ _ _______ _________ " << std::endl
|
||||||
|
<< " / ____/___ _(_)_______ |/ /_ __ \\ version " << FAIRMQ_GIT_VERSION << std::endl
|
||||||
|
<< " / /_ / __ `/ / ___/__ /|_/ /_ / / / build " << FAIRMQ_BUILD_TYPE << std::endl
|
||||||
|
<< " / __/ / /_/ / / / _ / / / / /_/ / " << FAIRMQ_REPO_URL << std::endl
|
||||||
|
<< " /_/ \\__,_/_/_/ /_/ /_/ \\___\\_\\ " << FAIRMQ_LICENSE << " © " << FAIRMQ_COPYRIGHT << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
////// CALL HOOK ///////
|
////// CALL HOOK ///////
|
||||||
fEvents.Emit<hooks::InstantiateDevice>(*this);
|
fEvents.Emit<hooks::InstantiateDevice>(*this);
|
||||||
////////////////////////
|
////////////////////////
|
||||||
|
|
||||||
if (!fDevice)
|
if (!fDevice) {
|
||||||
{
|
|
||||||
LOG(error) << "getDevice(): no valid device provided. Exiting.";
|
LOG(error) << "getDevice(): no valid device provided. Exiting.";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -61,16 +72,14 @@ auto DeviceRunner::Run() -> int
|
|||||||
|
|
||||||
// Handle --print-channels
|
// Handle --print-channels
|
||||||
fDevice->RegisterChannelEndpoints();
|
fDevice->RegisterChannelEndpoints();
|
||||||
if (fConfig.Count("print-channels"))
|
if (fConfig.Count("print-channels")) {
|
||||||
{
|
|
||||||
fDevice->PrintRegisteredChannels();
|
fDevice->PrintRegisteredChannels();
|
||||||
fDevice->ChangeState(FairMQDevice::END);
|
fDevice->ChangeState(FairMQDevice::END);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle --version
|
// Handle --version
|
||||||
if (fConfig.Count("version"))
|
if (fConfig.Count("version")) {
|
||||||
{
|
|
||||||
std::cout << "User device version: " << fDevice->GetVersion() << std::endl;
|
std::cout << "User device version: " << fDevice->GetVersion() << std::endl;
|
||||||
std::cout << "FAIRMQ_INTERFACE_VERSION: " << FAIRMQ_INTERFACE_VERSION << std::endl;
|
std::cout << "FAIRMQ_INTERFACE_VERSION: " << FAIRMQ_INTERFACE_VERSION << std::endl;
|
||||||
fDevice->ChangeState(FairMQDevice::END);
|
fDevice->ChangeState(FairMQDevice::END);
|
||||||
@@ -99,18 +108,15 @@ auto DeviceRunner::Run() -> int
|
|||||||
|
|
||||||
auto DeviceRunner::RunWithExceptionHandlers() -> int
|
auto DeviceRunner::RunWithExceptionHandlers() -> int
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return Run();
|
return Run();
|
||||||
}
|
} catch (std::exception& e) {
|
||||||
catch (std::exception& e)
|
LOG(error) << "Unhandled exception reached the top of main: " << e.what()
|
||||||
{
|
<< ", application will now exit";
|
||||||
LOG(error) << "Unhandled exception reached the top of main: " << e.what() << ", application will now exit";
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
} catch (...) {
|
||||||
catch (...)
|
LOG(error) << "Non-exception instance being thrown. Please make sure you use "
|
||||||
{
|
"std::runtime_exception() instead. Application will now exit.";
|
||||||
LOG(error) << "Non-exception instance being thrown. Please make sure you use std::runtime_exception() instead. Application will now exit.";
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2017-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
@@ -20,10 +20,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace fair
|
namespace fair {
|
||||||
{
|
namespace mq {
|
||||||
namespace mq
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class DeviceRunner DeviceRunner.h <fairmq/DeviceRunner.h>
|
* @class DeviceRunner DeviceRunner.h <fairmq/DeviceRunner.h>
|
||||||
@@ -31,7 +29,8 @@ namespace mq
|
|||||||
*
|
*
|
||||||
* Runs a single FairMQ device with config and plugin support.
|
* Runs a single FairMQ device with config and plugin support.
|
||||||
*
|
*
|
||||||
* For customization user hooks are executed at various steps during device launch/shutdown in the following sequence:
|
* For customization user hooks are executed at various steps during device launch/shutdown in the
|
||||||
|
* following sequence:
|
||||||
*
|
*
|
||||||
* LoadPlugins
|
* LoadPlugins
|
||||||
* |
|
* |
|
||||||
@@ -44,34 +43,41 @@ namespace mq
|
|||||||
* v
|
* v
|
||||||
* InstatiateDevice
|
* InstatiateDevice
|
||||||
*
|
*
|
||||||
* Each hook has access to all members of the DeviceRunner and really only differs by the point in time it is called.
|
* Each hook has access to all members of the DeviceRunner and really only differs by the point in
|
||||||
|
* time it is called.
|
||||||
*
|
*
|
||||||
* For an example usage of this class see the fairmq/runFairMQDevice.h header.
|
* For an example usage of this class see the fairmq/runFairMQDevice.h header.
|
||||||
*/
|
*/
|
||||||
class DeviceRunner
|
class DeviceRunner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceRunner(int argc, char* const argv[]);
|
DeviceRunner(int argc, char* const argv[], bool printLogo = true);
|
||||||
|
|
||||||
auto Run() -> int;
|
auto Run() -> int;
|
||||||
auto RunWithExceptionHandlers() -> int;
|
auto RunWithExceptionHandlers() -> int;
|
||||||
|
|
||||||
template<typename H>
|
template<typename H>
|
||||||
auto AddHook(std::function<void(DeviceRunner&)> hook) -> void { fEvents.Subscribe<H>("runner", hook); }
|
auto AddHook(std::function<void(DeviceRunner&)> hook) -> void
|
||||||
|
{
|
||||||
|
fEvents.Subscribe<H>("runner", hook);
|
||||||
|
}
|
||||||
template<typename H>
|
template<typename H>
|
||||||
auto RemoveHook() -> void { fEvents.Unsubscribe<H>("runner"); }
|
auto RemoveHook() -> void
|
||||||
|
{
|
||||||
|
fEvents.Unsubscribe<H>("runner");
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> fRawCmdLineArgs;
|
std::vector<std::string> fRawCmdLineArgs;
|
||||||
FairMQProgOptions fConfig;
|
FairMQProgOptions fConfig;
|
||||||
std::unique_ptr<FairMQDevice> fDevice;
|
std::unique_ptr<FairMQDevice> fDevice;
|
||||||
PluginManager fPluginManager;
|
PluginManager fPluginManager;
|
||||||
|
const bool fPrintLogo;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EventManager fEvents;
|
EventManager fEvents;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace hooks
|
namespace hooks {
|
||||||
{
|
|
||||||
struct LoadPlugins : Event<DeviceRunner&> {};
|
struct LoadPlugins : Event<DeviceRunner&> {};
|
||||||
struct SetCustomCmdLineOptions : Event<DeviceRunner&> {};
|
struct SetCustomCmdLineOptions : Event<DeviceRunner&> {};
|
||||||
struct ModifyRawCmdLineArgs : Event<DeviceRunner&> {};
|
struct ModifyRawCmdLineArgs : Event<DeviceRunner&> {};
|
||||||
|
@@ -72,6 +72,9 @@ FairMQDevice::FairMQDevice(FairMQProgOptions* config, const fair::mq::tools::Ver
|
|||||||
, fVersion(version)
|
, fVersion(version)
|
||||||
, fRate(0.)
|
, fRate(0.)
|
||||||
, fRawCmdLineArgs()
|
, fRawCmdLineArgs()
|
||||||
|
, fInterrupted(false)
|
||||||
|
, fInterruptedCV()
|
||||||
|
, fInterruptedMtx()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,6 +494,10 @@ void FairMQDevice::RunWrapper()
|
|||||||
thread rateLogger(&FairMQDevice::LogSocketRates, this);
|
thread rateLogger(&FairMQDevice::LogSocketRates, this);
|
||||||
|
|
||||||
// notify transports to resume transfers
|
// notify transports to resume transfers
|
||||||
|
{
|
||||||
|
lock_guard<mutex> guard(fInterruptedMtx);
|
||||||
|
fInterrupted = false;
|
||||||
|
}
|
||||||
for (auto& t : fTransports)
|
for (auto& t : fTransports)
|
||||||
{
|
{
|
||||||
t.second->Resume();
|
t.second->Resume();
|
||||||
@@ -909,6 +916,7 @@ void FairMQDevice::LogSocketRates()
|
|||||||
|
|
||||||
t0 = t1;
|
t0 = t1;
|
||||||
this_thread::sleep_for(chrono::milliseconds(1000));
|
this_thread::sleep_for(chrono::milliseconds(1000));
|
||||||
|
// WaitFor(chrono::milliseconds(1000)); TODO: enable this when nanomsg linger is fixed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -919,6 +927,11 @@ void FairMQDevice::Unblock()
|
|||||||
{
|
{
|
||||||
t.second->Interrupt();
|
t.second->Interrupt();
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
lock_guard<mutex> guard(fInterruptedMtx);
|
||||||
|
fInterrupted = true;
|
||||||
|
}
|
||||||
|
fInterruptedCV.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FairMQDevice::ResetTaskWrapper()
|
void FairMQDevice::ResetTaskWrapper()
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <memory> // unique_ptr
|
#include <memory> // unique_ptr
|
||||||
#include <algorithm> // std::sort()
|
#include <algorithm> // std::sort()
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -433,6 +434,16 @@ class FairMQDevice : public FairMQStateMachine
|
|||||||
|
|
||||||
void RunStateMachine() { ProcessWork(); };
|
void RunStateMachine() { ProcessWork(); };
|
||||||
|
|
||||||
|
/// Wait for the supplied amount of time or for interruption.
|
||||||
|
/// If interrupted, returns false, otherwise true.
|
||||||
|
/// @param duration wait duration
|
||||||
|
template<class Rep, class Period>
|
||||||
|
bool WaitFor(std::chrono::duration<Rep, Period> const& duration)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(fInterruptedMtx);
|
||||||
|
return !fInterruptedCV.wait_for(lock, duration, [&] { return fInterrupted.load(); }); // return true if no interruption happened
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<FairMQTransportFactory> fTransportFactory; ///< Default transport factory
|
std::shared_ptr<FairMQTransportFactory> fTransportFactory; ///< Default transport factory
|
||||||
std::unordered_map<fair::mq::Transport, std::shared_ptr<FairMQTransportFactory>> fTransports; ///< Container for transports
|
std::unordered_map<fair::mq::Transport, std::shared_ptr<FairMQTransportFactory>> fTransports; ///< Container for transports
|
||||||
@@ -551,6 +562,10 @@ class FairMQDevice : public FairMQStateMachine
|
|||||||
const fair::mq::tools::Version fVersion;
|
const fair::mq::tools::Version fVersion;
|
||||||
float fRate; ///< Rate limiting for ConditionalRun
|
float fRate; ///< Rate limiting for ConditionalRun
|
||||||
std::vector<std::string> fRawCmdLineArgs;
|
std::vector<std::string> fRawCmdLineArgs;
|
||||||
|
|
||||||
|
std::atomic<bool> fInterrupted;
|
||||||
|
std::condition_variable fInterruptedCV;
|
||||||
|
std::mutex fInterruptedMtx;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQDEVICE_H_ */
|
#endif /* FAIRMQDEVICE_H_ */
|
||||||
|
@@ -9,11 +9,19 @@
|
|||||||
#ifndef FAIR_MQ_VERSION_H
|
#ifndef FAIR_MQ_VERSION_H
|
||||||
|
|
||||||
#define FAIRMQ_VERSION "@PROJECT_VERSION@"
|
#define FAIRMQ_VERSION "@PROJECT_VERSION@"
|
||||||
#define FAIRMQ_VERSION_DEC (@PROJECT_VERSION_MAJOR@ * 10000) + (@PROJECT_VERSION_MINOR@ * 100) + @PROJECT_VERSION_PATCH@
|
#define FAIRMQ_VERSION_DEC (@PROJECT_VERSION_MAJOR@ * 100000) \
|
||||||
|
+ (@PROJECT_VERSION_MINOR@ * 1000) \
|
||||||
|
+ (@PROJECT_VERSION_PATCH@ * 10) \
|
||||||
|
+ @PROJECT_VERSION_HOTFIX@
|
||||||
#define FAIRMQ_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
|
#define FAIRMQ_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
|
||||||
#define FAIRMQ_VERSION_MINOR @PROJECT_VERSION_MINOR@
|
#define FAIRMQ_VERSION_MINOR @PROJECT_VERSION_MINOR@
|
||||||
#define FAIRMQ_VERSION_PATCH @PROJECT_VERSION_PATCH@
|
#define FAIRMQ_VERSION_PATCH @PROJECT_VERSION_PATCH@
|
||||||
|
#define FAIRMQ_VERSION_HOTFIX @PROJECT_VERSION_HOTFIX@
|
||||||
#define FAIRMQ_GIT_VERSION "@PROJECT_GIT_VERSION@"
|
#define FAIRMQ_GIT_VERSION "@PROJECT_GIT_VERSION@"
|
||||||
#define FAIRMQ_GIT_DATE "@PROJECT_GIT_DATE@"
|
#define FAIRMQ_GIT_DATE "@PROJECT_GIT_DATE@"
|
||||||
|
#define FAIRMQ_REPO_URL "https://github.com/FairRootGroup/FairMQ"
|
||||||
|
#define FAIRMQ_LICENSE "LGPL-3.0"
|
||||||
|
#define FAIRMQ_COPYRIGHT "2012-2018 GSI"
|
||||||
|
#define FAIRMQ_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
|
||||||
|
|
||||||
#endif // FAIR_MQ_VERSION_H
|
#endif // FAIR_MQ_VERSION_H
|
||||||
|
@@ -12,12 +12,13 @@
|
|||||||
#include <poll.h> // for the interactive mode
|
#include <poll.h> // for the interactive mode
|
||||||
#include <csignal> // catching system signals
|
#include <csignal> // catching system signals
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
volatile sig_atomic_t gSignalStatus = 0;
|
std::atomic<sig_atomic_t> gSignalStatus(0);
|
||||||
|
|
||||||
extern "C" auto signal_handler(int signal) -> void
|
extern "C" auto signal_handler(int signal) -> void
|
||||||
{
|
{
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#define FAIR_MQ_PLUGINS_CONTROL
|
#define FAIR_MQ_PLUGINS_CONTROL
|
||||||
|
|
||||||
#include <fairmq/Plugin.h>
|
#include <fairmq/Plugin.h>
|
||||||
|
#include <fairmq/Version.h>
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
@@ -57,13 +58,16 @@ class Control : public Plugin
|
|||||||
auto ControlPluginProgramOptions() -> Plugin::ProgOptions;
|
auto ControlPluginProgramOptions() -> Plugin::ProgOptions;
|
||||||
|
|
||||||
REGISTER_FAIRMQ_PLUGIN(
|
REGISTER_FAIRMQ_PLUGIN(
|
||||||
Control, // Class name
|
Control, // Class name
|
||||||
control, // Plugin name (string, lower case chars only)
|
control, // Plugin name (string, lower case chars only)
|
||||||
(Plugin::Version{1,0,1}), // Version
|
(Plugin::Version{FAIRMQ_VERSION_MAJOR,
|
||||||
"FairRootGroup <fairroot@gsi.de>", // Maintainer
|
FAIRMQ_VERSION_MINOR,
|
||||||
"https://github.com/FairRootGroup/FairRoot", // Homepage
|
FAIRMQ_VERSION_PATCH}), // Version
|
||||||
ControlPluginProgramOptions // Free function which declares custom program options for the plugin
|
"FairRootGroup <fairroot@gsi.de>", // Maintainer
|
||||||
// signature: () -> boost::optional<boost::program_options::options_description>
|
"https://github.com/FairRootGroup/FairRoot", // Homepage
|
||||||
|
ControlPluginProgramOptions // Free function which declares custom program options for the
|
||||||
|
// plugin signature: () ->
|
||||||
|
// boost::optional<boost::program_options::options_description>
|
||||||
)
|
)
|
||||||
|
|
||||||
} /* namespace plugins */
|
} /* namespace plugins */
|
||||||
|
@@ -26,6 +26,7 @@ add_testhelper(runTestDevice
|
|||||||
helper/devices/TestReq.cxx
|
helper/devices/TestReq.cxx
|
||||||
helper/devices/TestSub.cxx
|
helper/devices/TestSub.cxx
|
||||||
helper/devices/TestTransferTimeout.cxx
|
helper/devices/TestTransferTimeout.cxx
|
||||||
|
helper/devices/TestWaitFor.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
)
|
)
|
||||||
@@ -38,23 +39,22 @@ set(MQ_CONFIG "${CMAKE_BINARY_DIR}/test/testsuite_FairMQ.IOPatterns_config.json"
|
|||||||
set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice")
|
set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice")
|
||||||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq)
|
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/config.json.in ${MQ_CONFIG})
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/config.json.in ${MQ_CONFIG})
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocols/runner.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/protocols/runner.cxx)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/runner.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/runner.cxx)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestEnvironment.h.in ${CMAKE_CURRENT_BINARY_DIR}/TestEnvironment.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestEnvironment.h.in ${CMAKE_CURRENT_BINARY_DIR}/TestEnvironment.h)
|
||||||
|
|
||||||
add_testsuite(FairMQ.Protocols
|
add_testsuite(FairMQ.Protocols
|
||||||
SOURCES
|
SOURCES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/protocols/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
protocols/_pair.cxx
|
protocols/_pair.cxx
|
||||||
protocols/_poller.cxx
|
|
||||||
protocols/_pub_sub.cxx
|
protocols/_pub_sub.cxx
|
||||||
protocols/_push_pull.cxx
|
protocols/_push_pull.cxx
|
||||||
protocols/_req_rep.cxx
|
protocols/_req_rep.cxx
|
||||||
protocols/_transfer_timeout.cxx
|
|
||||||
protocols/_push_pull_multipart.cxx
|
protocols/_push_pull_multipart.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
DEPENDS testhelper_runTestDevice
|
DEPENDS testhelper_runTestDevice
|
||||||
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/protocols
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/protocols
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 30
|
TIMEOUT 30
|
||||||
RUN_SERIAL ON
|
RUN_SERIAL ON
|
||||||
@@ -63,22 +63,24 @@ add_testsuite(FairMQ.Protocols
|
|||||||
|
|
||||||
add_testsuite(FairMQ.Parts
|
add_testsuite(FairMQ.Parts
|
||||||
SOURCES
|
SOURCES
|
||||||
parts/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
parts/_iterator_interface.cxx
|
parts/_iterator_interface.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/parts
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/parts
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 5
|
TIMEOUT 5
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.MessageResize
|
add_testsuite(FairMQ.MessageResize
|
||||||
SOURCES
|
SOURCES
|
||||||
message_resize/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
message_resize/_message_resize.cxx
|
message_resize/_message_resize.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/message_resize
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/message_resize
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 5
|
TIMEOUT 5
|
||||||
${definitions}
|
${definitions}
|
||||||
@@ -86,15 +88,18 @@ add_testsuite(FairMQ.MessageResize
|
|||||||
|
|
||||||
add_testsuite(FairMQ.Device
|
add_testsuite(FairMQ.Device
|
||||||
SOURCES
|
SOURCES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
device/TestSender.h
|
device/TestSender.h
|
||||||
device/TestReceiver.h
|
device/TestReceiver.h
|
||||||
device/runner.cxx
|
|
||||||
device/_multiple_devices.cxx
|
device/_multiple_devices.cxx
|
||||||
device/_device_version.cxx
|
device/_device_version.cxx
|
||||||
device/_device_config.cxx
|
device/_device_config.cxx
|
||||||
|
device/_waitfor.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/device
|
DEPENDS testhelper_runTestDevice
|
||||||
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/device
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 5
|
TIMEOUT 5
|
||||||
RUN_SERIAL ON
|
RUN_SERIAL ON
|
||||||
@@ -134,54 +139,81 @@ add_testlib(FairMQPlugin_test_dummy2
|
|||||||
|
|
||||||
add_testsuite(FairMQ.Plugins
|
add_testsuite(FairMQ.Plugins
|
||||||
SOURCES
|
SOURCES
|
||||||
plugins/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
plugins/_plugin.cxx
|
plugins/_plugin.cxx
|
||||||
plugins/_plugin_manager.cxx
|
plugins/_plugin_manager.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
DEPENDS FairMQPlugin_test_dummy FairMQPlugin_test_dummy2
|
DEPENDS FairMQPlugin_test_dummy FairMQPlugin_test_dummy2
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.PluginsPrelinked
|
add_testsuite(FairMQ.PluginsPrelinked
|
||||||
SOURCES
|
SOURCES
|
||||||
plugins/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
plugins/_plugin_manager_prelink.cxx
|
plugins/_plugin_manager_prelink.cxx
|
||||||
|
|
||||||
LINKS FairMQ FairMQPlugin_test_dummy FairMQPlugin_test_dummy2
|
LINKS FairMQ FairMQPlugin_test_dummy FairMQPlugin_test_dummy2
|
||||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.PluginServices
|
add_testsuite(FairMQ.PluginServices
|
||||||
SOURCES
|
SOURCES
|
||||||
plugin_services/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
plugin_services/_config.cxx
|
plugin_services/_config.cxx
|
||||||
plugin_services/_control.cxx
|
plugin_services/_control.cxx
|
||||||
plugin_services/Fixture.h
|
plugin_services/Fixture.h
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.EventManager
|
add_testsuite(FairMQ.EventManager
|
||||||
SOURCES
|
SOURCES
|
||||||
event_manager/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
event_manager/_event_manager.cxx
|
event_manager/_event_manager.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.StateMachine
|
add_testsuite(FairMQ.StateMachine
|
||||||
SOURCES
|
SOURCES
|
||||||
state_machine/runner.cxx
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
state_machine/_state_machine.cxx
|
state_machine/_state_machine.cxx
|
||||||
|
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
TIMEOUT 10
|
||||||
|
)
|
||||||
|
|
||||||
|
add_testsuite(FairMQ.Transport
|
||||||
|
SOURCES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
|
transport/_transfer_timeout.cxx
|
||||||
|
|
||||||
|
LINKS FairMQ
|
||||||
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
TIMEOUT 10
|
||||||
|
)
|
||||||
|
|
||||||
|
add_testsuite(FairMQ.Poller
|
||||||
|
SOURCES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/runner.cxx
|
||||||
|
poller/_poller.cxx
|
||||||
|
|
||||||
|
LINKS FairMQ
|
||||||
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
74
test/device/_waitfor.cxx
Normal file
74
test/device/_waitfor.cxx
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/********************************************************************************
|
||||||
|
* Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
|
* *
|
||||||
|
* This software is distributed under the terms of the *
|
||||||
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
|
* copied verbatim in the file "LICENSE" *
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
#include "runner.h"
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <boost/process.hpp>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
|
#include <chrono>
|
||||||
|
#include <iostream>
|
||||||
|
#include <future> // std::async, std::future
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace fair::mq::test;
|
||||||
|
|
||||||
|
void RunWaitFor()
|
||||||
|
{
|
||||||
|
std::mutex mtx;
|
||||||
|
std::condition_variable cv;
|
||||||
|
|
||||||
|
int pid = 0;
|
||||||
|
int exit_code = 0;
|
||||||
|
|
||||||
|
thread deviceThread([&]() {
|
||||||
|
stringstream cmd;
|
||||||
|
cmd << runTestDevice << " --id waitfor_" << " --control static " << " --severity nolog";
|
||||||
|
|
||||||
|
boost::process::ipstream stdout;
|
||||||
|
boost::process::child c(cmd.str(), boost::process::std_out > stdout);
|
||||||
|
string line;
|
||||||
|
getline(stdout, line);
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mtx);
|
||||||
|
pid = c.id();
|
||||||
|
}
|
||||||
|
cv.notify_one();
|
||||||
|
|
||||||
|
c.wait();
|
||||||
|
|
||||||
|
exit_code = c.exit_code();
|
||||||
|
});
|
||||||
|
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mtx);
|
||||||
|
cv.wait(lock, [&pid]{ return pid != 0; });
|
||||||
|
}
|
||||||
|
|
||||||
|
kill(pid, SIGINT);
|
||||||
|
|
||||||
|
deviceThread.join();
|
||||||
|
|
||||||
|
exit(exit_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(Device, WaitFor)
|
||||||
|
{
|
||||||
|
EXPECT_EXIT(RunWaitFor(), ::testing::ExitedWithCode(0), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
@@ -1,19 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
@@ -1,20 +1,33 @@
|
|||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
* copied verbatim in the file "LICENSE" *
|
* copied verbatim in the file "LICENSE" *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
#include <FairMQDevice.h>
|
||||||
|
#include <FairMQLogger.h>
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <iostream>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
namespace fair
|
||||||
{
|
{
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
namespace mq
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
{
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
namespace test
|
||||||
return RUN_ALL_TESTS();
|
{
|
||||||
}
|
|
||||||
|
class TestWaitFor : public FairMQDevice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Run()
|
||||||
|
{
|
||||||
|
std::cout << "hello" << std::endl;
|
||||||
|
WaitFor(std::chrono::seconds(60));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace test
|
||||||
|
} // namespace mq
|
||||||
|
} // namespace fair
|
@@ -17,9 +17,12 @@
|
|||||||
#include "devices/TestReq.cxx"
|
#include "devices/TestReq.cxx"
|
||||||
#include "devices/TestSub.cxx"
|
#include "devices/TestSub.cxx"
|
||||||
#include "devices/TestTransferTimeout.cxx"
|
#include "devices/TestTransferTimeout.cxx"
|
||||||
|
#include "devices/TestWaitFor.cxx"
|
||||||
|
|
||||||
|
#include <runFairMQDevice.h>
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <runFairMQDevice.h>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace bpo = boost::program_options;
|
namespace bpo = boost::program_options;
|
||||||
@@ -80,6 +83,10 @@ auto getDevice(const FairMQProgOptions& config) -> FairMQDevicePtr
|
|||||||
{
|
{
|
||||||
return new PairRight;
|
return new PairRight;
|
||||||
}
|
}
|
||||||
|
else if (0 == id.find("waitfor_"))
|
||||||
|
{
|
||||||
|
return new TestWaitFor;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cerr << "Don't know id '" << id << "'" << endl;
|
cerr << "Don't know id '" << id << "'" << endl;
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
@@ -1,16 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
@@ -6,13 +6,12 @@
|
|||||||
* copied verbatim in the file "LICENSE" *
|
* copied verbatim in the file "LICENSE" *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include "runner.h"
|
#include <runner.h>
|
||||||
#include <TestEnvironment.h>
|
#include <TestEnvironment.h>
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace fair
|
namespace fair
|
||||||
{
|
{
|
||||||
@@ -30,7 +29,7 @@ string mqConfig = "@MQ_CONFIG@";
|
|||||||
} /* namespace mq */
|
} /* namespace mq */
|
||||||
} /* namespace fair */
|
} /* namespace fair */
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
@@ -1,19 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
||||||
* *
|
|
||||||
* This software is distributed under the terms of the *
|
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
||||||
* copied verbatim in the file "LICENSE" *
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#include <TestEnvironment.h>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
auto main(int argc, char** argv) -> int
|
|
||||||
{
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
||||||
setenv("FAIRMQ_PATH", FAIRMQ_TEST_ENVIRONMENT, 0);
|
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
}
|
|
Reference in New Issue
Block a user