Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Optimized_Connection / run_test.pl
blobc18b6af37879fdbb1b071750a4cf95153d52f350
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';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $client = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
21 my $iorbase = "oc.ior";
22 my $client_iorfile = $client->LocalFile ($iorbase);
23 if ($client->PutFile ($iorbase) == -1) {
24 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
25 exit 1;
28 $client_conf_base = "oc_svc$PerlACE::svcconf_ext";
29 my $client_conf = $client->LocalFile ($client_conf_base);
30 if ($client->PutFile ($client_conf_base) == -1) {
31 print STDERR "ERROR: cannot set file <$client_conf>\n";
32 exit 1;
35 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile ".
36 "-orbsvcconf $client_conf ".
37 "-ORBDebugLevel $debug_level");
39 my $client_status = $CL->Spawn();
41 if ($client_status != 0) {
42 print STDERR "ERROR: client returned $client_status\n";
43 exit 1;
46 if ($client->WaitForFileTimed ($iorbase,
47 $client->ProcessStartWaitInterval()) == -1) {
48 print STDERR "ERROR: cannot find file <$client_iorfile>\n";
49 exit 1;
52 $client_status = $CL->WaitKill ($client->ProcessStartWaitInterval());
54 if ($client_status != 0) {
55 print STDERR "ERROR: client returned $client_status\n";
56 $status = 1;
59 exit $status;