-
Notifications
You must be signed in to change notification settings - Fork 14
/
run_test.sh.in
executable file
·125 lines (103 loc) · 3.28 KB
/
run_test.sh.in
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#! /usr/bin/env bash
# Defaults
install_dir="@CMAKE_INSTALL_PREFIX@"
num_iterations="1"
# Parse command line options
while getopts d:n: flag
do
case "${flag}" in
d) install_dir=${OPTARG};;
n) num_iterations=${OPTARG};;
esac
done
if ! [[ "${num_iterations}" =~ ^[0-9]+$ ]]
then
echo "-n option must be a positive integer"
exit 1
fi
echo "Start test with the following arguments:"
echo " install dir: '${install_dir}'"
echo " number of iterations: ${num_iterations}"
clean_up()
{
popd
exit 1
}
trap clean_up SIGHUP SIGINT SIGTERM
exec_test()
{
if [ -e "./$1" ]; then
echo ">>> Processing $1"
"./$1" $2 || clean_up
echo
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Test failed: $1"
exit $retVal
fi
else
echo "WARNING: can't find $1"
exit 1
fi
}
source "${install_dir}/DDS_env.sh"
pushd $(pwd)
cd "${install_dir}/tests"
echo "Working directory: $(pwd)"
echo
exec_all()
{
echo "----------------------"
echo "dds_misc_lib UNIT-TESTs"
echo "----------------------"
exec_test "dds_misc_MiscUtils-tests"
exec_test "dds_misc_MiscCli-tests"
# we use --catch_system_errors=no here to prevent BOOST catching SIGCHLD
#exec_test "dds_misc_Process-tests" "--catch_system_errors=no"
exec_test "dds_misc_ProcessExecutable-tests"
exec_test "dds_misc_SysHelper-tests"
#exec_test "dds_misc_FindCfgFile-tests"
exec_test "dds_misc_Logger-tests"
exec_test "dds_misc_Ncf-tests"
echo "----------------------"
echo "dds-topology UNIT-TESTs"
echo "----------------------"
exec_test "dds_topology_lib-tests" "--catch_system_errors=no --report_level=detailed --log_level=message"
echo "----------------------"
echo "dds-topology performance UNIT-TESTs"
echo "----------------------"
exec_test "dds_topology_lib-performance-tests" "--catch_system_errors=no --report_level=detailed --log_level=message"
echo "----------------------"
echo "Protocol UNIT-TESTs"
echo "----------------------"
exec_test "dds_protocol_lib-ProtocolMessage-tests" "--report_level=detailed --log_level=message"
#exec_test "dds-protocol-lib-client-tests"
#exec_test "dds-protocol-lib-server-tests"
echo "----------------------"
echo "Commander UNIT-TESTs"
echo "----------------------"
exec_test "dds-scheduler-tests" "--catch_system_errors=no --report_level=detailed --log_level=message"
echo "----------------------"
echo "Intercom lib UNIT-TESTs"
echo "----------------------"
exec_test "dds_intercom_lib-tests" "--catch_system_errors=no --report_level=detailed --log_level=message"
echo "----------------------"
echo "dds-user-defaults UNIT-TESTs"
echo "----------------------"
exec_test "dds-user-defaults-tests" "--report_level=detailed --log_level=message"
echo "----------------------"
echo "dds_tools_lib-protocol-tests UNIT-TESTs"
echo "----------------------"
exec_test "dds_tools_lib-protocol-tests" "--report_level=detailed --log_level=message"
echo "----------------------"
echo "dds_tools_lib-session-tests UNIT-TESTs"
echo "----------------------"
exec_test "dds_tools_lib-session-tests" "--report_level=detailed --log_level=message"
}
for i in `seq 1 ${num_iterations}`;
do
echo "Start iteration $i"
exec_all
done
popd
exit 0