$BEREMIZPATH/C_runtime/beremiz_runtime -v -t tcp -p 61131 -h localhost > >(
echo "Start PLC stdout reader loop"
# Wait for server to print modified value
if [[ "$line" == "C runtime OK #3" ]]; then
echo "End PLC stdout reader loop"
# Start PLC with C runtime test
setsid $BEREMIZPYTHONPATH $BEREMIZPATH/Beremiz_cli.py -k \
--project-home $BEREMIZPATH/tests/projects/c_runtime build transfer run > >(
# Wait for CLI to output expected PLC log message on stdout
if [[ $line =~ .*C\ runtime\ log\ OK\ #3$ ]]; then
echo all subprocess started, start polling results
res=110 # default to ETIMEDOUT
if [[ -a ./PLC_OK && -a ./CLI_OK ]]; then
# Kill PLC and subprocess
echo will kill CLI:$CLI_PID and PLC:$PLC_PID