-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun_tests.sh
executable file
·58 lines (46 loc) · 1.01 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# Run tests.
#
TESTS="print_name_and_age many_arguments callback print_struct dynamic_data string_data stress thread_stress no_argument"
TIMEOUT=30 # seconds
export DSTC_MCAST_IFACE_ADDR=127.0.0.1
# Make sure we are started with an absolute path
if [ "${0:0:1}" != '/' ]; then
exec ${PWD}/${0}
fi
pushd "${0%/*}/examples"
for TEST in $TESTS
do
echo "-------------------------"
echo "Running test $TEST"
echo "-------------------------"
if [ -d "./$TEST" ]; then
cd $TEST
fi
timeout 15s ./${TEST}_server &
timeout 15s ./${TEST}_client &
wait %1
RES=$?
if [ ! $RES ]
then
echo "\nTest client ${TEST} FAILED with exit code $RES.\n"
exit $RES
fi
wait %2
RES=$?
if [ ! $RES ]
then
echo "\nTest server ${TEST} FAILED with exit code $RES.\n"
exit $RES
fi
if [ "$(basename $PWD)" == ${TEST} ]; then
cd ..
fi
echo "------"
echo "Test $TEST passed"
echo
echo
done
popd
exit 0