1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
9 use PerlACE
::TestTarget
;
11 my $ifr_service = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 my $tao_ifr = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
14 my $iorbase = "ifr.ior";
16 my $ifr_service_iorfile = $ifr_service->LocalFile ($iorbase);
17 $ifr_service->DeleteFile ($iorbase);
18 my $tao_ifr_iorfile = $tao_ifr->LocalFile ($iorbase);
19 $tao_ifr->DeleteFile ($iorbase);
21 # Generate an array containing the path to the IDL files
23 # Need to figure out the platform-independent way to
24 # list all the files matching that pattern.
26 my $dirpath = "$ENV{TAO_ROOT}/tests/IDL_Test";
27 opendir(DIR
, $dirpath);
28 @idl_files = grep(/.*\.idl$/, readdir(DIR
));
30 return map { "$dirpath/$_" } @idl_files;
33 # Input: array of idl file names
34 # Output: array of idl file names that had a failure
36 my $SVC = $ifr_service->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
37 "-o $ifr_service_iorfile");
39 my $CMP = $tao_ifr->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_ifr",
40 "-ORBinitref InterfaceRepository=file://$tao_ifr_iorfile");
44 my $sep = "\n" . '-' x
70 . "\n\n";
46 foreach $idlfile (@_) {
48 print "phase1: checking $idlfile\n";
50 $server_status = $SVC->Spawn ();
52 if ($server_status != 0) {
53 print STDERR
"ERROR: server returned $server_status\n";
54 push(@failures, $idlfile);
58 if ($ifr_service->WaitForFileTimed ($iorbase,
59 $ifr_service->ProcessStartWaitInterval()) == -1) {
60 print STDERR
"ERROR: cannot find file <$ifr_service_iorfile>\n";
61 $SVC->Kill (); $SVC->TimedWait (1);
62 push(@failures, $idlfile);
66 if ($ifr_service->GetFile ($iorbase) == -1) {
67 print STDERR
"ERROR: cannot retrieve file <$tao_ifr_iorfile>\n";
68 $SVC->Kill (); $SVC->TimedWait (1);
69 push(@failures, $idlfile);
73 if ($tao_ifr->PutFile ($iorbase) == -1) {
74 print STDERR
"ERROR: cannot set file <$tao_ifr_iorfile>\n";
75 $SVC->Kill (); $SVC->TimedWait (1);
76 push(@failures, $idlfile);
80 $CMP->Arguments ("-ORBInitRef InterfaceRepository=file://$tao_ifr_iorfile " .
81 "-I$ENV{TAO_ROOT}/tests/IDL_Test " .
83 print STDOUT
$CMP->Arguments () . "\n";
84 $client_status = $CMP->SpawnWaitKill ($tao_ifr->ProcessStartWaitInterval());
86 $server_status = $SVC->Wait (0);
88 if ($server_status != -1) {
89 push(@failures, $idlfile);
90 warn "Service crashed during compilation of $idlfile.\n";
94 print "phase1: $add_r\n";
95 if ($client_status != 0) {
96 push(@failures, $idlfile);
97 warn "Failure during compilation of $idlfile.\n";
101 $CMP->Arguments ("-ORBinitref InterfaceRepository=file://$tao_ifr_iorfile " .
102 "-I$ENV{TAO_ROOT}/tests/IDL_Test " .
105 $client_status = $CMP->SpawnWaitKill ($tao_ifr->ProcessStartWaitInterval());
107 $server_status = $SVC->Wait (0);
109 if ($server_status != -1) {
110 push(@failures, $idlfile);
111 warn "Service crashed during removal of $idlfile.\n";
115 print "phase1: $add_r\n";
116 if ($client_status != 0) {
117 push(@failures, $idlfile);
118 warn "Failure during removal of $idlfile.\n";
123 $SVC->Kill (); $SVC->TimedWait (1);
124 $ifr_service->DeleteFile ($iorbase);
125 $tao_ifr->DeleteFile ($iorbase);
136 @files = ($#ARGV > -1) ?
@ARGV : idl_filenames
;
138 @phase1_failures = phase1
(@files);
140 print "END: the following failed phase1:\n", join("\n", @phase1_failures), "\n";