Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / Bug_3154_Regression / run_test.pl
blobbf9d497c2b1612d2c7d5acbf4ebc56497272d308
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 my $tao_idl = "$ENV{ACE_ROOT}/bin/tao_idl";
11 if (exists $ENV{HOST_ROOT}) {
12 $tao_idl = "$ENV{HOST_ROOT}/bin/tao_idl";
15 $idl_process = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
17 # IDL file names
18 $idlbase = "test.idl";
19 $idl_process->LocalFile ($idlbase);
21 # The IDL compiler
22 $TAO_IDL = $idl_process->CreateProcess ("$tao_idl");
23 if (exists $ENV{HOST_ROOT}) {
24 $TAO_IDL->IgnoreHostRoot(1);
26 $ENV{'INCLUDE'} = ":$ENV{TAO_ROOT}/orbsvcs/:$ENV{TAO_ROOT}/:";
28 $TAO_IDL->Arguments ("-Se -hs _skel.h -hc _stub.h -I$ENV{TAO_ROOT} -I$ENV{TAO_ROOT}/orbsvcs/ test.idl");
29 $TAO_IDL->SpawnWaitKill ($idl_process->ProcessStartWaitInterval ());
31 $found = 0;
33 $stub_h = $idl_process->LocalFile("test_stub.h");
34 open (STUB_HANDLE, "<$stub_h");
35 while ($line = <STUB_HANDLE>) {
36 # Process the line.
37 chomp $line;
39 if ($line =~ /^\#include \"orbsvcs\/FT_CORBA_ORBC\.h\"$/) {
40 print "INFO: orbsvcs/FT_CORBA_ORBC.h\n";
41 $found++;
43 if ($line =~ /^\#include \"orbsvcs\/CosNotification_stub\.h\"$/) {
44 print "INFO: orbsvcs/CosNotification_stub.h\n";
45 $found++;
47 if ($line =~ /\#include \"orbsvcs\/PortableGroupC\.h\"$/) {
48 print "INFO: orbsvcs/PortableGroupC.h\n";
49 $found++;
52 close(STUB_HANDLE);
54 $skel_h = $idl_process->LocalFile("test_skel.h");
55 open (SKEL_HANDLE, "<$skel_h");
56 while ($line = <SKEL_HANDLE>) {
57 # Process the line.
58 chomp $line;
60 if ($line =~ /^\#include \"test_stub\.h\"$/) {
61 print "INFO: test_stub.h\n";
62 $found++;
64 if ($line =~ /^\#include \"orbsvcs\/FT_CORBA_ORBS\.h\"$/) {
65 print "INFO: orbsvcs/FT_CORBA_ORBC.h\n";
66 $found++;
68 if ($line =~ /^\#include \"orbsvcs\/CosNotification_skel\.h\"$/) {
69 print "INFO: orbsvcs/CosNotification_skel.h\n";
70 $found++;
72 if ($line =~ /\#include \"orbsvcs\/PortableGroupS\.h\"$/) {
73 print "INFO: orbsvcs/PortableGroupS.h\n";
74 $found++;
77 close(SKEL_HANDLE);
79 $idl_process->DeleteFile ("<*.cpp *.inl *.h>");
81 if ($found == 7) {
82 print "INFO: Test passed!\n";
83 exit 0;
84 } else {
85 print STDERR "ERROR: Custom endings are incorrectly applied.\n";
86 exit 1;