Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Bug_3755_Ext_Regression / run_test.pl
blobac76ff4bd24d7ca248bf07ed4bf6c1bb1a8a2d3b
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
12 $rt = 0;
13 $rtsched = 0;
14 $endpoint = 0;
15 $diffserv = 0;
16 $bidir = 0;
17 $messaging = 0;
18 $csd = 0;
19 $ziop = 0;
21 foreach $i (@ARGV) {
22 if ($i eq '-debug') {
23 $debug_level = '10';
24 } elsif ($i eq '-rt') {
25 $rt = 1;
26 } elsif ($i eq '-rtsched') {
27 $rtsched = 1;
28 } elsif ($i eq '-endpoint') {
29 $endpoint = 1;
30 } elsif ($i eq '-diffserv') {
31 $diffserv = 1;
32 } elsif ($i eq '-bidir') {
33 $bidir = 1;
34 } elsif ($i eq '-messaging') {
35 $messaging = 1;
36 } elsif ($i eq '-csd') {
37 $csd = 1;
38 } elsif ($i eq '-ziop') {
39 $ziop = 1;
43 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
45 sub run_one_test {
46 my $name = shift;
47 my $svc1 = shift;
48 my $svc2 = shift;
50 print "\nRunning $name test\n";
52 my $server_svc_conf1 = $server->LocalFile ($svc1);
53 my $server_svc_conf2 = $server->LocalFile ($svc2);
54 my $dopt = "-ORBdebuglevel $debug_level";
56 # copy the configuation files
57 if ($server->PutFile ($svc1) == -1) {
58 print STDERR "ERROR: cannot set file <$server_svc_conf1>\n";
59 return 1;
61 if ($server->PutFile ($svc2) == -1) {
62 print STDERR "ERROR: cannot set file <$server_svc_conf2>\n";
63 return 1;
66 $SV = $server->CreateProcess ("server",
67 "-a \"AAA $dopt -ORBSvcConf $server_svc_conf1\" " .
68 "-b \"BBB $dopt -ORBGestalt LOCAL -ORBSvcConf $server_svc_conf2\"");
69 $server_status = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval());
71 if ($server_status != 0) {
72 print STDERR "ERROR: server returned $server_status\n";
73 return 1;
76 print "$name test succeeded\n";
77 return 0;
80 # Common tests.
81 my @svcs = ();
83 # add common runtime loaded library dependencies
84 $server->AddRuntimeLibrary('TAO_PortableServer');
85 $server->AddRuntimeLibrary('TAO_PI');
86 $server->AddRuntimeLibrary('TAO_AnyTypeCode');
87 $server->AddRuntimeLibrary('TAO_CodecFactory');
89 if ($rt) {
90 @svcs = (
91 ["RTCORBA", "rt_svc.conf", "rt_svc.conf"],
93 $server->AddRuntimeLibrary('TAO_RTCORBA');
94 } elsif ($rtsched) {
95 @svcs = (
96 ["RTScheduler", "rt_scheduler_svc.conf", "rt_scheduler_svc.conf"],
98 $server->AddRuntimeLibrary('TAO_RTCORBA');
99 $server->AddRuntimeLibrary('TAO_RTScheduler');
100 $server->AddRuntimeLibrary('TAO_Messaging');
101 $server->AddRuntimeLibrary('TAO_Valuetype');
102 $server->AddRuntimeLibrary('TAO_PI_Server');
103 } elsif ($endpoint) {
104 @svcs = (
105 ["EndpointPolicy", "ep_svc.conf", "ep_svc.conf"],
107 $server->AddRuntimeLibrary('TAO_EndpointPolicy');
108 } elsif ($diffserv) {
109 @svcs = (
110 ["DiffServPolicy", "dp_svc.conf", "dp_svc.conf"]
112 $server->AddRuntimeLibrary('TAO_DiffServPolicy');
113 } elsif ($bidir) {
114 @svcs = (
115 ["BiDir_GIOP", "bidir_svc.conf", "bidir_svc.conf"],
117 $server->AddRuntimeLibrary('TAO_BiDirGIOP');
118 } elsif ($messaging) {
119 @svcs = (
120 ["Messaging", "messaging_svc.conf", "messaging_svc.conf"],
122 $server->AddRuntimeLibrary('TAO_Messaging');
123 $server->AddRuntimeLibrary('TAO_Valuetype');
124 } elsif ($csd) {
125 @svcs = (
126 ["CSD_Framework", "csd_svc.conf", "csd_svc.conf"],
128 $server->AddRuntimeLibrary('TAO_CSD_Framework');
129 $server->AddRuntimeLibrary('TAO_CSD_ThreadPool');
130 } elsif ($ziop) {
131 @svcs = (
132 ["ZIOP", "ziop_svc.conf", "ziop_svc.conf"],
134 $server->AddRuntimeLibrary('TAO_ZIOP');
135 $server->AddRuntimeLibrary('TAO_Compression');
136 } else {
137 @svcs = (
138 ["PI_Server", "pi_server_svc.conf", "pi_server_svc.conf"],
140 $server->AddRuntimeLibrary('TAO_PI_Server');
143 foreach my $svc_pair (@svcs) {
144 $status += run_one_test (@$svc_pair);
147 exit $status;