Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / TransportCurrent / Framework / run_test.pl
blob3c87cca959706ef7369a2e3365bbd721f41e72e9
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 Config;
9 use PerlACE::TestTarget;
11 my $status = 0;
12 my $confmod = "";
14 my $mode = shift (@ARGV);
15 if ($mode =~ /-dynamic/) {
17 elsif ($mode =~ /-static/) {
18 $confmod = "-static";
20 else {
21 print STDERR "Unknown $mode. Specify -static or -dynamic\n";
22 exit 1;
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";
44 exit 1;
46 if ($client->PutFile ($confclientbase) == -1) {
47 print STDERR "ERROR: cannot set file <$confclient>\n";
48 exit 1;
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");
54 $SV->Spawn ();
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);
60 exit 1;
63 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
65 if ($client_status != 0) {
66 print STDERR "$0: ERROR: client returned $client_status\n";
67 $status = 1;
70 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
72 if ($server_status != 0) {
73 print STDERR "$0: ERROR: server returned $server_status\n";
74 $status = 1;
77 $server->DeleteFile($iorbase);
78 $client->DeleteFile($iorbase);
80 exit $status;