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
;
12 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 $SV = $server->CreateProcess ("main");
14 $test = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval());
16 print STDERR
"ERROR: test returned $test\n";
20 #Redirect the screen output to the null device.
21 open (OLDOUT
, ">&STDOUT");
22 open (STDOUT
, ">" . File
::Spec
->devnull());
23 open (OLDERR
, ">&STDERR");
24 open (STDERR
, ">&STDOUT");
26 my $tao_idl = "$ENV{ACE_ROOT}/bin/tao_idl";
27 if (exists $ENV{HOST_ROOT
}) {
28 $tao_idl = "$ENV{HOST_ROOT}/bin/tao_idl";
31 my $server2 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
32 my $input_file2 = $server2->LocalFile ("invalid_scoping1.idl");
35 $SV = $server2->CreateProcess ("$tao_idl", "$input_file2");
36 $test2 = $SV->SpawnWaitKill ($server2->ProcessStartWaitInterval());
38 my $server3 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
39 my $input_file3 = $server3->LocalFile ("invalid_scoping2.idl");
42 $SV = $server3->CreateProcess ("$tao_idl", "$input_file3");
43 $test3 = $SV->SpawnWaitKill ($server3->ProcessStartWaitInterval());
45 my $server4 = PerlACE
::TestTarget
::create_target
(4) || die "Create target 4 failed\n";
46 my $input_file4 = $server4->LocalFile ("keyword_case_diff.idl");
49 $SV = $server4->CreateProcess ("$tao_idl", "$input_file4");
50 $test4 = $SV->SpawnWaitKill ($server4->ProcessStartWaitInterval());
52 my $server5 = PerlACE
::TestTarget
::create_target
(5) || die "Create target 5 failed\n";
53 my $input_file5 = $server5->LocalFile ("keyword_case_diff.idl");
54 my $result_filename5 = "keyword_case_diff.log";
55 my $result_file5 = $server5->LocalFile ($result_filename5);
57 open (STDERR
, ">$result_file5") or die "can't redirect stderr: $!";
60 $SV = $server5->CreateProcess ("$tao_idl", " -Cw $input_file5");
61 $test5 = $SV->SpawnWaitKill ($server5->ProcessStartWaitInterval());
63 open (STDERR
, ">&STDOUT");
65 my $server6 = PerlACE
::TestTarget
::create_target
(6) || die "Create target 6 failed\n";
66 my $input_file6 = $server6->LocalFile ("exception_misuse1.idl");
69 $SV = $server6->CreateProcess ("$tao_idl", "$input_file6");
70 $test6 = $SV->SpawnWaitKill ($server6->ProcessStartWaitInterval());
72 my $server7 = PerlACE
::TestTarget
::create_target
(7) || die "Create target 7 failed\n";
73 my $input_file7 = $server7->LocalFile ("exception_misuse2.idl");
76 $SV = $server7->CreateProcess ("$tao_idl", "$input_file7");
77 $test7 = $SV->SpawnWaitKill ($server7->ProcessStartWaitInterval());
80 my $result_file = $_[0];
82 if (! -r
$result_file) {
83 print STDERR
"ERROR: cannot find $result_file\n";
88 open (FILE
, $result_file) or return -1;
90 $match = /Warning - spelling differs from IDL keyword only in case:/;
95 return $match ?
0 : -1;
98 $match5 = analyze_results
($result_file5);
99 $server5->DeleteFile($result_filename5);
101 #Redirect the null device output back to the screen
102 open (STDOUT
, ">&OLDOUT");
103 open (STDERR
, ">&OLDERR");
105 print STDERR
"ERROR: tao_idl returned $test2 for $input_file2, should have failed!\n";
109 print STDERR
"ERROR: tao_idl returned $test3 for $input_file3, should have failed!\n";
113 print STDERR
"ERROR: tao_idl returned $test4 for $input_file4, should have failed!\n";
117 print STDERR
"ERROR: tao_idl -Cw returned $test5 for $input_file5, should have succeeded!\n";
121 print STDERR
"ERROR: tao_idl -Cw should have printed warning for $input_file5\n";
125 print STDERR
"ERROR: tao_idl returned $test6 for $input_file6, should have failed!\n";
129 print STDERR
"ERROR: tao_idl returned $test7 for $input_file7, should have failed!\n";