mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Tests for MQ examples
This commit is contained in:
40
examples/MQ/6-multiple-channels/testMQEx6.sh.in
Executable file
40
examples/MQ/6-multiple-channels/testMQEx6.sh.in
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
ex6config="@CMAKE_BINARY_DIR@/bin/config/ex6-multiple-channels.json"
|
||||
|
||||
# setup a trap to kill everything if the test fails/timeouts
|
||||
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK_PID; kill -TERM $BROADCASTER_PID; wait $SAMPLER_PID; wait $SINK_PID; wait $BROADCASTER_PID;' TERM
|
||||
|
||||
|
||||
SINK="ex6-sink"
|
||||
SINK+=" --id sink1"
|
||||
SINK+=" --max-iterations 1"
|
||||
SINK+=" --control static --log-color false"
|
||||
SINK+=" --mq-config $ex6config"
|
||||
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$SINK &
|
||||
SINK_PID=$!
|
||||
|
||||
sleep 1
|
||||
|
||||
SAMPLER="ex6-sampler"
|
||||
SAMPLER+=" --id sampler1"
|
||||
SAMPLER+=" --max-iterations 1"
|
||||
SAMPLER+=" --control static --log-color false"
|
||||
SAMPLER+=" --mq-config $ex6config"
|
||||
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$SAMPLER &
|
||||
SAMPLER_PID=$!
|
||||
|
||||
BROADCASTER="ex6-broadcaster"
|
||||
BROADCASTER+=" --id broadcaster1"
|
||||
BROADCASTER+=" --control static --log-color false"
|
||||
BROADCASTER+=" --mq-config $ex6config"
|
||||
@CMAKE_BINARY_DIR@/bin/examples/MQ/6-multiple-channels/$BROADCASTER &
|
||||
BROADCASTER_PID=$!
|
||||
|
||||
wait $SAMPLER_PID
|
||||
wait $SINK_PID
|
||||
|
||||
# stop broadcaster
|
||||
kill -SIGINT $BROADCASTER_PID
|
||||
|
||||
# wait for broadcaster to finish
|
||||
wait $BROADCASTER_PID
|
Reference in New Issue
Block a user