~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/examples/POA/On_Demand_Loading/run_test.pl

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
 
3
 
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
4
 
    & eval 'exec perl -S $0 $argv:q'
5
 
    if 0;
6
 
 
7
 
# run_test.pl,v 1.14 2002/08/22 18:08:04 irfan Exp
8
 
# -*- perl -*-
9
 
 
10
 
use lib '../../../../bin';
11
 
use PerlACE::Run_Test;
12
 
 
13
 
$iorfile = "ior";
14
 
 
15
 
$oneway = "";
16
 
$iterations = 100;
17
 
 
18
 
$extra_args = "";
19
 
 
20
 
$status = 0;
21
 
 
22
 
# Parse the arguments
23
 
for ($i = 0; $i <= $#ARGV; $i++) {
24
 
    if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
25
 
        print "run_test [-h] [-i iterations] [-o] [-f ior file]\n";
26
 
        print "\n";
27
 
        print "-h                  -- prints this information\n";
28
 
        print "-f                  -- ior file\n";
29
 
        print "-i iterations       -- specifies iterations\n";
30
 
        print "-o                  -- call issued are oneways\n";
31
 
        exit;
32
 
    }
33
 
    elsif ($ARGV[$i] eq "-o") {
34
 
      $oneway = "-o";
35
 
    }
36
 
    elsif ($ARGV[$i] eq "-i") {
37
 
      $iterations = $ARGV[$i + 1];
38
 
      $i++;
39
 
    }
40
 
    elsif ($ARGV[$i] eq "-f") {
41
 
      $iorfile = $ARGV[$i + 1];
42
 
      $i++;
43
 
    }
44
 
    else {
45
 
        $extra_args .= " " . $ARGV[$i];
46
 
    }
47
 
}
48
 
 
49
 
$iorfile1 = $iorfile."_1";
50
 
$iorfile2 = $iorfile."_2";
51
 
 
52
 
unlink $iorfile1, $iorfile2;
53
 
 
54
 
$SV  = new PerlACE::Process ("server", "-f $iorfile $extra_args");
55
 
$CL1 = new PerlACE::Process ("../Generic_Servant/client", 
56
 
                             "$extra_args $oneway -i $iterations -k file://$iorfile1");
57
 
$CL2 = new PerlACE::Process ("../Generic_Servant/client",
58
 
                             "$extra_args $oneway -i $iterations -k file://$iorfile2 -x"); 
59
 
 
60
 
$SV->Spawn ();
61
 
 
62
 
if (PerlACE::waitforfile_timed ($iorfile1, 15) == -1) {
63
 
    print STDERR "ERROR: cannot find file <$iorfile1>\n";
64
 
    $SV->Kill ();
65
 
    exit 1;
66
 
}
67
 
 
68
 
if (PerlACE::waitforfile_timed ($iorfile2, 15) == -1) {
69
 
    print STDERR "ERROR: cannot find file <$iorfile2>\n";
70
 
    $SV->Kill ();
71
 
    exit 1;
72
 
}
73
 
 
74
 
$client = $CL1->SpawnWaitKill (60);
75
 
 
76
 
if ($client != 0) {
77
 
    print STDERR "ERROR: client 1 returned $client\n";
78
 
    $status = 1;
79
 
}
80
 
 
81
 
$client = $CL2->SpawnWaitKill (60);
82
 
 
83
 
if ($client != 0) {
84
 
    print STDERR "ERROR: client 2 returned $client\n";
85
 
    $status = 1;
86
 
}
87
 
 
88
 
$server = $SV->WaitKill (5);
89
 
 
90
 
if ($server != 0) {
91
 
    print STDERR "ERROR: server returned $server\n";
92
 
    $SV->Kill (); 
93
 
    $status = 1;
94
 
}
95
 
 
96
 
unlink $iorfile1, $iorfile2;
97
 
 
98
 
exit $status;