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

@@ -0,0 +1,35 @@
#!/bin/bash
ex4config="@CMAKE_BINARY_DIR@/bin/config/ex4-copypush.json"
# setup a trap to kill everything if the test fails/timeouts
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK1_PID; kill -TERM $SINK2_PID; wait $SAMPLER_PID; wait $SINK1_PID; wait $SINK2_PID;' TERM
SAMPLER="ex4-sampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --control static --log-color false"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --mq-config $ex4config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/4-copypush/$SAMPLER &
SAMPLER_PID=$!
SINK1="ex4-sink"
SINK1+=" --id sink1"
SINK1+=" --control static --log-color false"
SINK1+=" --max-iterations 1"
SINK1+=" --mq-config $ex4config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/4-copypush/$SINK1 &
SINK1_PID=$!
SINK2="ex4-sink"
SINK2+=" --id sink2"
SINK2+=" --control static --log-color false"
SINK2+=" --max-iterations 1"
SINK2+=" --mq-config $ex4config"
@CMAKE_BINARY_DIR@/bin/examples/MQ/4-copypush/$SINK2 &
SINK2_PID=$!
# wait for everything to finish
wait $SAMPLER_PID
wait $SINK1_PID
wait $SINK2_PID