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";
9 use PerlACE
::TestTarget
;
14 my $mode = shift (@ARGV);
15 if ($mode =~ /-dynamic/) {
17 elsif ($mode =~ /-static/) {
21 print STDERR
"Unknown $mode. Specify -static or -dynamic\n";
25 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
26 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
28 $server->AddLibPath ('../lib');
29 $client->AddLibPath ('../lib');
31 my $iorbase = "server.ior";
32 my $server_iorfile = $server->LocalFile ($iorbase);
33 my $client_iorfile = $client->LocalFile ($iorbase);
34 $server->DeleteFile($iorbase);
35 $client->DeleteFile($iorbase);
37 my $confserverbase = "server$confmod" . $PerlACE::svcconf_ext
;
38 my $confclientbase = "client$confmod" . $PerlACE::svcconf_ext
;
39 my $confserver = $server->LocalFile ($confserverbase);
40 my $confclient = $client->LocalFile ($confclientbase);
42 if ($server->PutFile ($confserverbase) == -1) {
43 print STDERR
"ERROR: cannot set file <$confserver>\n";
46 if ($client->PutFile ($confclientbase) == -1) {
47 print STDERR
"ERROR: cannot set file <$confclient>\n";
51 $SV = $server->CreateProcess ("server", "@ARGV -ORBSvcConf $confserver -o $server_iorfile");
52 $CL = $client->CreateProcess ("client", "@ARGV -n 1 -ORBSvcConf $confclient -k file://$client_iorfile");
56 if ($server->WaitForFileTimed ($iorbase,
57 $server->ProcessStartWaitInterval()) == -1) {
58 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
63 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
65 if ($client_status != 0) {
66 print STDERR
"$0: ERROR: client returned $client_status\n";
70 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
72 if ($server_status != 0) {
73 print STDERR
"$0: ERROR: server returned $server_status\n";
77 $server->DeleteFile($iorbase);
78 $client->DeleteFile($iorbase);