Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / OBV / TC_Alignment / run_test.pl
blobdc7fd37293a5d516bc65fdf9b2f3e29256ea17f2
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 # This is a Perl script that runs all Naming Service tests. It starts
8 # all the servers and clients as necessary.
10 use lib "$ENV{ACE_ROOT}/bin";
11 use PerlACE::TestTarget;
13 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
14 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
16 my $iorbase = "test.ior";
17 my $server_iorfile = $server->LocalFile ($iorbase);
18 my $client_iorfile = $client->LocalFile ($iorbase);
19 $server->DeleteFile($iorbase);
20 $client->DeleteFile($iorbase);
22 $debug = "";
24 for ($i = 0; $i <= $#ARGV; $i++) {
25 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
26 print "Run_Test Perl script for TAO Param Test\n\n";
27 print "run_test [-d>]\n";
28 print "-d -- runs test in debug mode\n";
29 exit 0;
31 elsif ($ARGV[$i] eq "-d") {
32 $debug = " -d";
36 $SV = $server->CreateProcess ("server", " -ORBDottedDecimalAddresses 1 -o $server_iorfile");
37 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile -x $debug");
39 $SV->Spawn ();
41 if ($server->WaitForFileTimed ($iorbase,
42 $server->ProcessStartWaitInterval()) == -1) {
43 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
44 $SV->Kill (); $SV->TimedWait (1);
45 exit 1;
48 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
50 if ($client_status != 0) {
51 print STDERR "ERROR: client returned $client_status\n";
52 $status = 1;
55 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
57 if ($server_status != 0) {
58 print STDERR "ERROR: server returned $server_status\n";
59 $status = 1;
62 $server->DeleteFile($iorbase);
63 $client->DeleteFile($iorbase);
65 exit $status;