Tests for MQ examples

This commit is contained in:
Alexey Rybalchenko
2017-08-23 11:12:29 +02:00
committed by Mohammad Al-Turany
parent 984eed1a89
commit 319bdc91a1
57 changed files with 658 additions and 118 deletions

View File

@@ -6,12 +6,11 @@
# copied verbatim in the file "LICENSE" #
################################################################################
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/ex1-sampler-sink.json
${CMAKE_BINARY_DIR}/bin/config/ex1-sampler-sink.json)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/startMQEx1.sh.in
${CMAKE_BINARY_DIR}/bin/examples/MQ/1-sampler-sink/startMQEx1.sh)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/ex1-sampler-sink.json ${CMAKE_BINARY_DIR}/bin/config/ex1-sampler-sink.json)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/startMQEx1.sh.in ${CMAKE_BINARY_DIR}/bin/examples/MQ/1-sampler-sink/startMQEx1.sh)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/testMQEx1.sh.in ${CMAKE_BINARY_DIR}/bin/examples/MQ/1-sampler-sink/testMQEx1.sh)
Set(INCLUDE_DIRECTORIES
set(INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/fairmq
${CMAKE_SOURCE_DIR}/fairmq/devices
${CMAKE_SOURCE_DIR}/fairmq/tools
@@ -20,40 +19,40 @@ Set(INCLUDE_DIRECTORIES
${CMAKE_CURRENT_BINARY_DIR}
)
Set(SYSTEM_INCLUDE_DIRECTORIES
set(SYSTEM_INCLUDE_DIRECTORIES
${Boost_INCLUDE_DIR}
${ZeroMQ_INCLUDE_DIR}
)
Include_Directories(${INCLUDE_DIRECTORIES})
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
include_directories(${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
Set(LINK_DIRECTORIES
set(LINK_DIRECTORIES
${Boost_LIBRARY_DIRS}
)
Link_Directories(${LINK_DIRECTORIES})
link_directories(${LINK_DIRECTORIES})
Set(SRCS
set(SRCS
"FairMQExample1Sampler.cxx"
"FairMQExample1Sink.cxx"
)
Set(DEPENDENCIES
set(DEPENDENCIES
${DEPENDENCIES}
FairMQ
)
Set(LIBRARY_NAME FairMQExample1)
set(LIBRARY_NAME FairMQExample1)
GENERATE_LIBRARY()
Set(Exe_Names
set(Exe_Names
ex1-sampler
ex1-sink
)
Set(Exe_Source
set(Exe_Source
runExample1Sampler.cxx
runExample1Sink.cxx
)
@@ -64,16 +63,21 @@ math(EXPR _length ${_length}-1)
set(BIN_DESTINATION share/fairbase/examples/MQ/1-sampler-sink/bin)
set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/examples/MQ/1-sampler-sink")
ForEach(_file RANGE 0 ${_length})
foreach(_file RANGE 0 ${_length})
list(GET Exe_Names ${_file} _name)
list(GET Exe_Source ${_file} _src)
set(EXE_NAME ${_name})
set(SRCS ${_src})
set(DEPENDENCIES FairMQExample1)
GENERATE_EXECUTABLE()
EndForEach(_file RANGE 0 ${_length})
endforeach(_file RANGE 0 ${_length})
Install(
add_test(NAME MQ.ex1-sampler-sink COMMAND ${CMAKE_BINARY_DIR}/bin/examples/MQ/1-sampler-sink/testMQEx1.sh)
set_tests_properties(MQ.ex1-sampler-sink PROPERTIES TIMEOUT "30")
set_tests_properties(MQ.ex1-sampler-sink PROPERTIES RUN_SERIAL true)
set_tests_properties(MQ.ex1-sampler-sink PROPERTIES PASS_REGULAR_EXPRESSION " Received: \"Hello\"")
install(
FILES ex1-sampler-sink.json
DESTINATION share/fairbase/examples/MQ/1-sampler-sink/config/
)