=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / RTCORBA / Server_Declared / run_test.pl
blob1bb249beafc874974a751dc42bc1437e1a447201
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 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
11 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
13 my $iorbase1 = "test1.ior";
14 my $iorbase2 = "test2.ior";
15 my $client_iorfile1 = $client->LocalFile ("$iorbase1");
16 my $server_iorfile1 = $server->LocalFile ("$iorbase1");
18 my $client_iorfile2 = $client->LocalFile ("$iorbase2");
19 my $server_iorfile2 = $server->LocalFile ("$iorbase2");
21 $server->DeleteFile($iorbase1);
22 $client->DeleteFile($iorbase1);
24 $server->DeleteFile($iorbase2);
25 $client->DeleteFile($iorbase2);
27 my $svc_conf = 'svc.conf';
29 # copy the configuation files
30 if ($server->PutFile ($svc_conf) == -1) {
31 print STDERR "ERROR: cannot set file <".$server->LocalFile ($svc_conf).">\n";
32 exit 1;
34 if ($server->PutFile ($svc_conf.'.xml') == -1) {
35 print STDERR "ERROR: cannot set file <".$server->LocalFile ($svc_conf.'.xml').">\n";
36 exit 1;
38 if ($client->PutFile ($svc_conf) == -1) {
39 print STDERR "ERROR: cannot set file <".$client->LocalFile ($svc_conf).">\n";
40 exit 1;
42 if ($client->PutFile ($svc_conf.'.xml') == -1) {
43 print STDERR "ERROR: cannot set file <".$client->LocalFile ($svc_conf.'.xml').">\n";
44 exit 1;
47 $status = 0;
49 $server_args =
50 "-a 45 -b 55";
52 print STDERR "Value is " . $^O;
54 if ($^O eq "MSWin32") {
55 $server_args =
56 "-a 1 -b 2";
59 $SV = $server->CreateProcess ("server", "-p $server_iorfile1 -o $server_iorfile2 $server_args");
60 $CL = $client->CreateProcess ("client", "-p file://$client_iorfile1 -o file://$client_iorfile2");
62 print STDERR "\n********** RTCORBA SERVER_DECLARED Priority Unit Test\n\n";
64 $server_status = $SV->Spawn ();
66 if ($server_status != 0) {
67 print STDERR "ERROR: server returned $server_status\n";
68 exit 1;
71 if ($server->WaitForFileTimed ($iorbase2,
72 $server->ProcessStartWaitInterval ()) == -1) {
73 $server_status = $SV->TimedWait (1);
74 if ($server_status == 2) {
75 # Mark as no longer running to avoid errors on exit.
76 $SV->{RUNNING} = 0;
77 exit $status;
79 else {
80 print STDERR "ERROR: cannot find file <$server_iorfile2>\n";
81 $SV->Kill ();
82 exit 1;
86 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
88 if ($client_status != 0) {
89 print STDERR "ERROR: client returned $client_status\n";
90 $status = 1;
93 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
95 if ($server_status != 0) {
96 print STDERR "ERROR: server returned $server_status\n";
97 $status = 1;
100 $server->DeleteFile($iorbase1);
101 $client->DeleteFile($iorbase1);
103 $server->DeleteFile($iorbase2);
104 $client->DeleteFile($iorbase2);
106 exit $status;