1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
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";
34 if ($server->PutFile ($svc_conf.'.xml') == -1) {
35 print STDERR
"ERROR: cannot set file <".$server->LocalFile ($svc_conf.'.xml').">\n";
38 if ($client->PutFile ($svc_conf) == -1) {
39 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf).">\n";
42 if ($client->PutFile ($svc_conf.'.xml') == -1) {
43 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf.'.xml').">\n";
52 print STDERR
"Value is " . $^O
;
54 if ($^O
eq "MSWin32") {
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";
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.
80 print STDERR
"ERROR: cannot find file <$server_iorfile2>\n";
86 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
88 if ($client_status != 0) {
89 print STDERR
"ERROR: client returned $client_status\n";
93 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
95 if ($server_status != 0) {
96 print STDERR
"ERROR: server returned $server_status\n";
100 $server->DeleteFile($iorbase1);
101 $client->DeleteFile($iorbase1);
103 $server->DeleteFile($iorbase2);
104 $client->DeleteFile($iorbase2);