Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / POA / Default_Servant2 / run_test.pl
blob4af57489b75f62daea3627897f21de962313919a
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;
12 $iorbase = "server.ior";
13 $testbase = "test";
15 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
16 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
18 $server_iorfile = $server->LocalFile ($iorbase);
19 $client_iorfile = $client->LocalFile ($iorbase);
20 $server->LocalFile ($testbase);
21 $server->DeleteFile($iorbase);
22 $server->DeleteFile($testbase);
23 $client->DeleteFile($iorbase);
25 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
26 $CL = $client->CreateProcess ("client", "-k $client_iorfile");
28 $server_status = $SV->Spawn ();
30 if ($server_status != 0) {
31 print STDERR "ERROR: server returned $server_status\n";
32 exit 1;
35 if ($server->WaitForFileTimed ($iorbase,
36 $server->ProcessStartWaitInterval()) == -1) {
37 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
38 $SV->Kill (); $SV->TimedWait (1);
39 exit 1;
42 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
43 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
45 $server->DeleteFile($iorbase);
46 $client->DeleteFile($iorbase);
47 $server->DeleteFile($testbase); # created by the program
49 if ($client_status != 0) {
50 print STDERR "ERROR: client returned $client_status\n";
51 $status = 1;
54 if ($server_status != 0) {
55 print STDERR "ERROR: server returned $server_status\n";
56 $status = 1;
59 exit $status;