Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Single_Read / run_test.pl
blob28e3570216b99bb759901fea5deae4509053203d
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 $status = 0;
11 $debug_level = '0';
12 $data_bytes = '10';
13 $iterations = '10';
15 foreach $i (@ARGV) {
16 if ($i eq '-debug') {
17 $debug_level = '10';
21 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
22 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
24 my $iorbase = "server.ior";
25 my $done_file = "client_done.ior";
26 my $server_iorfile = $server->LocalFile ($iorbase);
27 my $client_iorfile = $client->LocalFile ($iorbase);
29 my $client_done_file = $client->LocalFile ($done_file);
31 $server->DeleteFile($iorbase);
32 $client->DeleteFile($iorbase);
34 $client->DeleteFile($done_file);
36 $SV = $server->CreateProcess ("server",
37 "-ORBdebuglevel $debug_level " .
38 "-o $server_iorfile " .
39 "-s $client_done_file");
41 $CL = $client->CreateProcess ("client",
42 "-k file://$client_iorfile " .
43 "-d $data_bytes -i $iterations -x");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR "ERROR: server returned $server_status\n";
49 exit 1;
52 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 exit 1;
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
62 exit 1;
64 if ($client->PutFile ($iorbase) == -1) {
65 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
67 exit 1;
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 185);
72 if ($client_status != 0) {
73 $time = localtime;
74 print STDERR "ERROR: client returned $client_status at $time\n";
75 $status = 1;
78 open (FILE , ">$client_done_file");
79 print FILE "Client Done !\n";
80 close (FILE);
83 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 390);
85 if ($server_status != 0) {
86 $time = localtime;
87 print STDERR "ERROR: server returned $server_status at $time\n";
88 $status = 1;
91 $server->DeleteFile($iorbase);
92 $client->DeleteFile($iorbase);
93 $client->DeleteFile($done_file);
95 exit $status;