Commit e35317b7 authored by Stefan Reif's avatar Stefan Reif

Fix memtest script

parent 46afcaf5
Pipeline #901 failed with stages
in 2 minutes and 15 seconds
#!/bin/sh
which valgrind
export prrtResult=0
valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/receiver 5000 127 receiver.csv & export prrtReceiverProcessID=$!
valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/sender 127.0.0.1 5000 127 sender.csv || prrtResult=$?
(kill -INT $prrtReceiverProcessID && (wait $prrtReceiverProcessID || prrtResults=$?)) || true
exit $prrtResult
check() {
#echo "CHECK $1 $2"
if [ "$1" -ne 0 ]; then
echo >&2 "$2"
exit $1
fi
}
to="timeout 60"
valgrind="valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1"
$to $valgrind ./bin/receiver 5000 127 receiver.csv &
$to $valgrind ./bin/sender 127.0.0.1 5000 127 sender.csv
check "$?" "sender failed"
wait
check "$?" "receiver failed"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment