=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / OctetSeq / run_test.pl
blobe24b86a3739e10e82748397f7a3cd6548df11ddf
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 $client_iterations = '5000';
15 $octet_iterations = '32';
16 $low = '8192';
17 $high = '8192';
18 $step = '1';
20 foreach $i (@ARGV) {
21 if ($i eq '-debug') {
22 $debug_level = '10';
26 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
27 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
28 my $t3 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
30 $status = 0;
32 my $iorbase = "test.ior";
33 my $server_iorfile = $server->LocalFile ($iorbase);
34 my $client_iorfile = $t3->LocalFile ($iorbase);
35 $server->DeleteFile($iorbase);
36 $client->DeleteFile($iorbase);
38 $SV = $server->CreateProcess ("server",
39 "-ORBdebuglevel $debug_level " .
40 "-o $server_iorfile");
42 $T = $client->CreateProcess ("OctetSeq",
43 "-ORBdebuglevel $debug_level " .
44 "-n $octet_iterations -l $low -h $high -s $step -q");
46 $CL = $t3->CreateProcess ("client", "-i $client_iterations -k file://$client_iorfile");
48 print STDERR "\n\n==== Octet sequence passing test\n";
50 $server_status = $SV->Spawn ();
52 if ($server_status != 0) {
53 print STDERR "ERROR: server returned $server_status\n";
54 exit 1;
57 if ($server->WaitForFileTimed ($iorbase,
58 $server->ProcessStartWaitInterval()) == -1) {
59 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
60 $SV->Kill (); $SV->TimedWait (1);
61 exit 1;
64 if ($server->GetFile ($iorbase) == -1) {
65 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
67 exit 1;
69 if ($client->PutFile ($iorbase) == -1) {
70 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
72 exit 1;
75 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 100);
77 if ($client_status != 0) {
78 print STDERR "ERROR: client returned $client_status\n";
79 $status = 1;
82 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 10);
84 if ($server_status != 0) {
85 print STDERR "ERROR: server returned $server\n";
86 $status = 1;
89 print STDERR "\n\n==== Octet sequence performance test\n";
91 $test = $T->SpawnWaitKill ($t3->ProcessStartWaitInterval() + 45);
93 if ($test != 0) {
94 print STDERR "ERROR: test returned $test\n";
95 $status = 1;
98 $server->DeleteFile($iorbase);
99 $client->DeleteFile($iorbase);
101 exit $status;