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";
8 use PerlACE
::TestTarget
;
19 my $ifr_service = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $tao_ifr = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 # The location of the implementation repository binaries
23 my $ifr_bin_path = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service";
25 # The location of the tao_ifr IFR utility
26 my $tao_ifr_bin_path = "$ENV{ACE_ROOT}/bin";
29 my $ior_file = "ifr.ior";
32 my $idl_file = "test.idl";
35 my @result_files = ();
36 for ($i = 0; $i < 2; $i++) {
37 $result_files[$i] = "test_result_$i.log";
41 $tao_ifr_idlfile = $tao_ifr->LocalFile($idl_file);
42 $tao_ifr_iorfile = $tao_ifr->LocalFile($ior_file);
44 $ifr_service_iorfile = $ifr_service->LocalFile($ior_file);
46 $tao_ifr->DeleteFile($ior_file);
47 $ifr_service->DeleteFile($ior_file);
49 $ifr_service_result_file = $ifr_service->LocalFile ($result_files[0]);
50 $tao_ifr_result_file = $ifr_service->LocalFile ($result_files[1]);
51 $ifr_service->DeleteFile ($result_files[0]);
52 $tao_ifr->DeleteFile ($result_files[1]);
54 $IFRSERVICE = $ifr_service->CreateProcess("$ifr_bin_path/tao_ifr_service", "-ORBdebuglevel $debug_level ".
55 "-ORBLogFile $ifr_service_result_file ".
56 "-o $ifr_service_iorfile");
57 $TAOIFR = $tao_ifr->CreateProcess("$tao_ifr_bin_path/tao_ifr", "-ORBLogFile $tao_ifr_result_file ".
58 "-ORBInitRef InterfaceRepository=file://$tao_ifr_iorfile ".
59 "-Cw $tao_ifr_idlfile");
62 my $result_file = $_[0];
64 if (! -r
$result_file) {
65 print STDERR
"ERROR: cannot find $result_file\n";
70 open (FILE
, $result_file) or return -1;
72 $match = /Warning - identifier spellings differ only in case:/;
77 return $match ?
0 : -1;
81 # Start the IFR Service to generate an IOR file for the tao_ifr to use...
82 $ifr_status = $IFRSERVICE->Spawn ();
84 if ($ifr_status != 0) {
85 print STDERR
"ERROR: ifr_service Spawn returned $ifr_status\n";
89 if ($ifr_service->WaitForFileTimed ($ior_file,
90 $ifr_service->ProcessStartWaitInterval()) == -1) {
91 print STDERR
"ERROR: cannot find file <$ifr_service_iorfile>\n";
92 $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
96 if ($ifr_service->GetFile ($ior_file) == -1) {
97 print STDERR
"ERROR: cannot retrieve file <$ifr_service_iorfile>\n";
98 $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
102 if ($tao_ifr->PutFile ($ior_file) == -1) {
103 print STDERR
"ERROR: cannot set file <$tao_ifr_iorfile>\n";
104 $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
108 $tao_status = $TAOIFR->SpawnWaitKill ($tao_ifr->ProcessStartWaitInterval() + 15);
109 if ($tao_status != 0) {
110 print STDERR
"ERROR: tao_ifr returned $tao_status\n";
115 # $match = analyse_results ($ifr_service_result_file); $ # this string is not currently needed
116 $match += analyse_results
($tao_ifr_result_file);
119 $ifr_status = $IFRSERVICE->TerminateWaitKill ($ifr_service->ProcessStopWaitInterval());
120 if ($ifr_status != 0) {
121 print STDERR
"ERROR: ifr_service TerminateWaitKill returned $ifr_status\n";
128 # Run regression for bug #1436
129 $status = test_body
();
132 print STDERR
"ERROR: Regression test for Bug #1436 failed\n";
135 print "Regression test for Bug #1436 passed.\n";
138 $tao_ifr->DeleteFile($ior_file);
139 $ifr_service->DeleteFile($ior_file);
140 $ifr_service->DeleteFile ($result_files[0]);
141 $tao_ifr->DeleteFile ($result_files[1]);