blob: 27f920b8744581c1fbda86cb58b813a69406c9e6 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
#$Id$
# -*- perl -*-
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
unshift @INC, '../../../../../bin';
require Process;
require ACEutils;
$nsport = 20000 + uniqueid ();
$server_port = 0;
$iorfile = "theior";
$sleeptime = 5;
$exepref = "";
$svnsflags = " -s -o $iorfile";
$clnsflags = " -s -f $iorfile";
$mcast = 0;
$debug = "";
$numflag = "";
# Parse the arguments
for ($i = 0; $i <= $#ARGV; $i++)
{
SWITCH:
{
if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
{
print "run_test [-h] [-n num] [-mcast] [-sleeptime t] [-debug] [-release]\n";
print "\n";
print "-h -- prints this information\n";
print "-n num -- client uses <num> iterations\n";
print "-mcast -- uses the multicast version of the nameservice\n";
print " (default is 5 seconds)\n";
print "-sleeptime t -- run_test should sleep for <t> seconds between running\n";
print " the server and client\n";
print "-debug -- sets the debug flag for both client and server\n";
print "-release -- runs the Release version of the test (for NT use)\n";
exit;
}
if ($ARGV[$i] eq "-mcast")
{
$mcast = 1;
$clnsflags = " -ORBnameserviceport $nsport";
$svnsflags = " -ORBnameserviceport $nsport";
last SWITCH;
}
if ($ARGV[$i] eq "-debug")
{
$debug = " -d";
last SWITCH;
}
if ($ARGV[$i] eq "-release")
{
$exepref = "Release".$DIR_SEPARATOR;
last SWITCH;
}
if ($ARGV[$i] eq "-n")
{
$numflag = " -n ".$ARGV[$i + 1];
$i++;
last SWITCH;
}
if ($ARGV[$i] eq "-sleeptime")
{
$sleeptime = $ARGV[$i + 1];
$i++;
last SWITCH;
}
print "run_test: Unknown Option: ".$ARGV[$i]."\n";
}
}
$SV = Process::Create ($exepref."server".$Process::EXE_EXT,
$debug.
" -ORBport ".$server_port.
" -ORBobjrefstyle url".
$svnsflags);
# Put in a wait between the server and client
if ($mcast == 1)
{
sleep $sleeptime;
}
else
{
waitforfile ($iorfile);
}
unlink
$status = system ($exepref."client".$Process::EXE_EXT.
$debug.
$numflag.
$clnsflags.
" -x");
# @@ TODO change to Wait() once the -x option works.
$SV->Kill (); $SV->Wait ();
unlink $iorfile;
# @@ Capture any errors from the server too.
exit $status;
|