Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / examples / Advanced / ch_8_and_10 / run_test.pl
blob85a928299cea8a65b9a082172c4479db1e5fda31
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";
9 require ACEutils;
10 require Process;
12 $status = 0;
13 $iorfile = "chapter_test.ior";
14 unlink $iorfile;
18 # Hacked call
19 $server = Process::Create ("exec ".$EXEPREFIX."server".$EXE_EXT.">$iorfile",
20 "");
21 # Proper call
22 #$server = Process::Create ($EXEPREFIX."server".$EXE_EXT, ">$iorfile");
24 if (ACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
25 print STDERR "ERROR: timedout waiting for file <$iorfile>\n";
26 $server->Kill (); $server->TimedWait (1);
27 exit 1;
30 open(ior_handle, "$iorfile");
31 $ior_content = <ior_handle>;
33 $client = Process::Create($EXEPREFIX."client$EXE_EXT", "$ior_content");
35 if ($client->TimedWait (60) == -1) {
36 print STDERR "ERROR: client timedout\n";
37 $status = 1;
38 $client->Kill (); $client->TimedWait (1);
44 $server->Terminate ();
45 if ($server->TimedWait (5) == -1) {
46 print STDERR "ERROR: cannot terminate the server\n";
47 $server->Kill (); $server->TimedWait (1);
48 $status = 1;
51 unlink $iorfile;
53 exit $status;