/
run_test.pl
executable file
·168 lines (151 loc) · 4.16 KB
/
run_test.pl
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# -*- perl -*-
my @original_ARGV = @ARGV;
use Env (DDS_ROOT);
use lib "$DDS_ROOT/bin";
use Env (ACE_ROOT);
use lib "$ACE_ROOT/bin";
use Env (TEST_RUN_PARAMS);
use PerlDDS::Run_Test;
use strict;
PerlDDS::add_lib_path('./lib');
my $status = 0;
my $test = new PerlDDS::TestFramework();
$test->{dcps_debug_level} = 0;
$test->{dcps_transport_debug_level} = 0;
$test->{add_transport_config} = 0;
$test->{add_orb_log_file} = 0;
$test->{add_pending_timeout} = 0;
my $tc_opts = "--wait-for-nodes 7 example";
my $nc_opts = "one-shot --name test_nc_" . $$;
my $is_rtps_disc = 0;
if ($TEST_RUN_PARAMS ne "") {
$tc_opts .= " $TEST_RUN_PARAMS";
}
if ($test->flag('--show-worker-logs')) {
# This should be set for CI & autobuild runs to catch any error messages in worker DDS logs
$tc_opts .= " --show-worker-logs";
}
if ($test->flag('--no-suffix')) {
# Handy for 'joining' the scenario with an external worker (e.g. gdb, mutrace etc)
$tc_opts .= " --override-bench-partition-suffix none";
}
if ($test->flag('--json')) {
# This will result in an additional results file being written in json format
$tc_opts .= " --json";
}
my $flag_found = 1;
if ($test->flag('ci-disco')) {
$tc_opts .= " ci-disco";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-disco-long')) {
$tc_opts .= " ci-disco-long";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-disco-repo')) {
$tc_opts .= " ci-disco-repo";
$is_rtps_disc = 1; # counter-intuitive, but we want bench to launch the repo, not the run script
}
elsif ($test->flag('ci-disco-relay')) {
$tc_opts .= " ci-disco-relay";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-disco-relay-only')) {
$tc_opts .= " ci-disco-relay-only";
$is_rtps_disc = 1;
}
elsif ($test->flag('script')) {
$tc_opts .= " script";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-fan')) {
$tc_opts .= " ci-fan";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-fan-ws')) {
$tc_opts .= " ci-fan-ws";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-fan-frag')) {
$tc_opts .= " ci-fan-frag";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-fan-frag-ws')) {
$tc_opts .= " ci-fan-frag-ws";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-echo')) {
$tc_opts .= " ci-echo";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-echo-frag')) {
$tc_opts .= " ci-echo-frag";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-force-worker-segfault')) {
$tc_opts .= " ci-force-worker-segfault";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-force-worker-assert')) {
$tc_opts .= " ci-force-worker-assert";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-force-worker-deadlock')) {
$tc_opts .= " ci-force-worker-deadlock";
$is_rtps_disc = 1;
}
elsif ($test->flag('ci-mixed')) {
$tc_opts .= " ci-mixed";
$is_rtps_disc = 1;
}
elsif ($test->flag('sm10')) {
$tc_opts .= " showtime-mixed-10";
$is_rtps_disc = 1;
}
elsif ($test->flag('sm20')) {
$tc_opts .= " showtime-mixed-20";
$is_rtps_disc = 1;
}
elsif ($test->flag('sm30')) {
$tc_opts .= " showtime-mixed-30";
$is_rtps_disc = 1;
}
elsif ($test->flag('simple-tags')) {
$tc_opts .= " simple-tags --tag continuous --tag control --tag processed --tag unknown";
$is_rtps_disc = 1;
$test->process("node_controller2", "node_controller/node_controller", $nc_opts . '_2');
}
elsif ($test->flag('script')) {
$tc_opts .= " script";
$is_rtps_disc = 1;
}
elsif ($test->flag('valgrind')) {
$tc_opts .= " valgrind";
$is_rtps_disc = 1;
}
elsif ($test->flag('udp-latency')) {
$tc_opts .= " udp-latency";
$is_rtps_disc = 1;
}
elsif ($test->flag('tcp-latency')) {
$tc_opts .= " tcp-latency";
$is_rtps_disc = 1;
}
else {
$flag_found = 0;
$tc_opts .= " ci-mixed";
$is_rtps_disc = 1;
}
$test->report_unused_flags(!$flag_found);
$test->setup_discovery("-ORBDebugLevel 1 -ORBLogFile DCPSInfoRepo.log") unless $is_rtps_disc;
$test->process("node_controller", "node_controller/node_controller", $nc_opts);
$test->process("test_controller", "test_controller/test_controller", $tc_opts);
if ($test->flag('simple-tags')) {
$test->start_process("node_controller2");
}
$test->start_process("node_controller");
$test->start_process("test_controller");
exit $test->finish(180);