summaryrefslogtreecommitdiff
path: root/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl
blob: e8778af9d790ffe6c37daa9fb87520b8b31ba83e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

use lib "$ENV{'ACE_ROOT'}/bin";
use PerlACE::Run_Test;

$status = 0;
$iorfile = PerlACE::LocalFile ("test.ior");

for ($iter = 0; $iter <= $#ARGV; $iter++) {
    if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") {
      print "Run_Test Perl script for NodeApplicationTest \n\n";
      print "run_test \n";
      print "\n";
      print "-h                  -- prints this information\n";
      exit 0;
  }
}


unlink $iorfile;
$CIAO_ROOT=$ENV{'CIAO_ROOT'};

$SV = new PerlACE::Process ("$CIAO_ROOT/bin/NodeApplication",
                            "-n -o $iorfile");

$CL = new PerlACE::Process ("client",
                            "-k file://$iorfile -n 4");

$SV->Spawn ();

if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
    print STDERR "ERROR: cannot find file <$iorfile>\n";
    $SV->Kill ();
    exit 1;
}

$CL->SpawnWaitKill (10);
$status = $SV->Kill (); $SV->TimedWait (1);

unlink $iorfile;

exit $status;