summaryrefslogtreecommitdiff
path: root/bin/fuzz.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/fuzz.pl')
-rwxr-xr-xbin/fuzz.pl113
1 files changed, 74 insertions, 39 deletions
diff --git a/bin/fuzz.pl b/bin/fuzz.pl
index b467beb2da9..598c461d122 100755
--- a/bin/fuzz.pl
+++ b/bin/fuzz.pl
@@ -50,6 +50,7 @@ use PerlACE::Run_Test;
@files_noncvs = ();
@files_sln = ();
@files_vcproj = ();
+@files_run_pl = ();
# To keep track of errors and warnings
$errors = 0;
@@ -122,6 +123,9 @@ sub store_file ($)
}
elsif ($name =~ /\.pl$/i) {
push @files_pl, ($name);
+ if ($name =~ /^run.*\.pl$/i) {
+ push @files_run_pl, ($name);
+ }
}
elsif ($name =~ /\.vcproj$/i) {
push @files_vcproj, ($name);
@@ -363,6 +367,19 @@ sub check_for_ACE_SYNCH_MUTEX ()
}
}
+# This test checks for not having export files in CIAO, all have to be ---
+# generated using TAO_IDL
+sub check_for_export_file ()
+{
+ print "Running export file check\n";
+ ITERATION: foreach $file (@files_h) {
+ if (($file =~ /.*CIAO.*export.h/)) {
+ print_error ("$file:$.: found should be generated by TAO_IDL, check -Gx** option");
+ }
+ }
+}
+
+
# This test checks for the use of ACE_Thread_Mutex in TAO/CIAO,
# TAO_SYNCH_MUTEX should used instead to make the code build
# in single-threaded builds.
@@ -1367,25 +1384,18 @@ sub check_for_mismatched_filename ()
sub check_for_bad_run_test ()
{
print "Running run_test.pl test\n";
- # Add the know ACE files
- if (defined $ENV{"TAO_ROOT"}) {
- push @files_lst, $ENV{"TAO_ROOT"} . "/bin/tao_orb_tests.lst";
- push @files_lst, $ENV{"TAO_ROOT"} . "/bin/tao_other_tests.lst";
- }
- if (defined $ENV{"CIAO_ROOT"}) {
- push @files_lst, $ENV{"CIAO_ROOT"} . "/bin/ciao_tests.lst";
- }
- $config_list = new PerlACE::ConfigList;
- foreach $file (@files_lst) {
- $config_list->load ($file);
- }
- $config_list->add_one_config ("FUZZ");
- @valid_files = $config_list->valid_entries ();
- foreach $file (@valid_files) {
+ foreach $file (@files_run_pl) {
if (open (FILE, $file)) {
my $is_run_test = 0;
my $sub = 0;
+ if (($file =~ /.*TAO\/examples\/Advanced.*/)) {
+ next ITERATION;
+ }
+ if (($file =~ /.*TAO\/orbsvcs\/examples\/Security\/Send_File.*/)) {
+ next ITERATION;
+ }
+
print "Looking at file $file\n" if $opt_d;
while (<FILE>) {
@@ -1414,24 +1424,24 @@ sub check_for_bad_run_test ()
print_error ("$file:$.: using Sys::Hostname");
}
- if (m/\$PerlACE::wait_interval_for_process_creation/) {
- print_error ("$file:$.: using \$PerlACE::wait_interval_for_process_creation");
+ if (m/PerlACE::wait_interval_for_process_creation/) {
+ print_error ("$file:$.: using PerlACE::wait_interval_for_process_creation");
}
- if (m/\$PerlACE::waitforfile_timed/) {
- print_error ("$file:$.: using \$PerlACE::waitforfile_timed");
+ if (m/PerlACE::waitforfile_timed/) {
+ print_error ("$file:$.: using PerlACE::waitforfile_timed");
}
- if (m/\$PerlACE::is_vxworks_test/) {
- print_error ("$file:$.: using \$PerlACE::is_vxworks_test");
+ if (m/PerlACE::is_vxworks_test/) {
+ print_error ("$file:$.: using PerlACE::is_vxworks_test");
}
- if (m/\$PerlACE::add_lib_path/) {
- print_error ("$file:$.: using \$PerlACE::add_lib_path");
+ if (m/PerlACE::add_lib_path/) {
+ print_error ("$file:$.: using PerlACE::add_lib_path, use AddLibPath on the target");
}
if (m/PerlACE::Run_Test/) {
- print_error ("$file:$.: using PerlACE::Run_Test, use TestTarget::random_port");
+ print_error ("$file:$.: using PerlACE::Run_Test, use PerlACE::TestTarget");
}
if (m/PerlACE::random_port/) {
@@ -1450,7 +1460,7 @@ sub check_for_bad_run_test ()
print_error ("$file:$.: using ACE_RUN_VX_TGTHOST, use TestTarget::HostName");
}
- if (m/Spawn(Wait(Kill)?)?\s*\(.+\->ProcessStop\)/) {
+ if (m/Spawn(Wait(Kill)?)?\s*\(.+\->ProcessStop.*\)/) {
print_error ("$file:$.: uses Stop together with Spawn");
}
@@ -1542,7 +1552,29 @@ sub check_for_absolute_ace_wrappers()
if (m/\~schmidt\/ACE_wrappers\//) {
chomp;
print_error ("$file:$.: ~schmidt/ACE_wrappers found");
- print_error ($_) if (defined $opt_v);
+ print_error ($_);
+ }
+ }
+ close (FILE);
+ }
+ else {
+ print STDERR "Error: Could not open $file\n";
+ }
+ }
+}
+
+# Check for generated headers in the code documentation
+sub check_for_generated_headers()
+{
+ print "Running generated headers test\n";
+ foreach $file (@files_cpp, @files_inl, @files_h) {
+ if (open (FILE, $file)) {
+ print "Looking at file $file\n" if $opt_d;
+ while (<FILE>) {
+ if (m/Code generated by the The ACE ORB \(TAO\) IDL Compiler/) {
+ chomp;
+ print_error ("$file:$.: header found");
+ print_error ($_);
}
}
close (FILE);
@@ -1581,7 +1613,8 @@ sub check_for_bad_ace_trace()
# Look for TRACE statements
if (m/ACE_OS_TRACE\s*\(\s*\"(.*)\"/
- || m/ACE_TRACE\s*\(\s*\"(.*)\"/) {
+ || m/ACE_TRACE\s*\(\s*\"(.*)\"/
+ || m/CIAO_TRACE\s*\(\s*\"(.*)\"/) {
my $trace = $1;
# reduce the classname
@@ -1597,7 +1630,7 @@ sub check_for_bad_ace_trace()
|| ($trace =~ m/\:\:/ && !($trace =~ m/\Q$class\E/ && $trace =~ m/\Q$function\E/))) {
print_error ("$file:$.: Mismatched TRACE");
print_error ("$file:$.: I see \"$trace\" but I think I'm in \""
- . $class . "::" . $function . "\"") if (defined $opt_v);
+ . $class . "::" . $function . "\"");
}
}
}
@@ -1728,15 +1761,15 @@ sub check_for_include ()
}
if ($disable == 0) {
if (/^\s*#\s*include\s*<[(ace)|(TAO)|(CIAO)]\/.*>/) {
- print_error ("$file:$.: include <ace\/..> used") if ($opt_v);
+ print_error ("$file:$.: include <ace\/..> used");
++$bad_occurance;
}
if (/^\s*#\s*include\s*<tao\/.*>/) {
- print_error ("$file:$.: include <tao\/..> used") if ($opt_v);
+ print_error ("$file:$.: include <tao\/..> used");
++$bad_occurance;
}
if (/^\s*#\s*include\s*<ciao\/.*>/) {
- print_error ("$file:$.: include <ciao\/..> used") if ($opt_v);
+ print_error ("$file:$.: include <ciao\/..> used");
++$bad_occurance;
}
}
@@ -1987,7 +2020,7 @@ sub check_for_ORB_init ()
##############################################################################
-use vars qw/$opt_c $opt_d $opt_h $opt_l $opt_t $opt_m $opt_v/;
+use vars qw/$opt_c $opt_d $opt_h $opt_l $opt_t $opt_m/;
if (!getopts ('cdhl:t:mv') || $opt_h) {
print "fuzz.pl [-cdhm] [-l level] [-t test_name][file1, file2, ...]\n";
@@ -1998,10 +2031,10 @@ if (!getopts ('cdhl:t:mv') || $opt_h) {
print " -l level set detection level (default = 5)\n";
print " -t test_name specify any single test to run. This will disable the run level setting\n";
print " -m only check locally modified files (uses cvs)\n";
- print " -v verbose mode\n";
print "======================================================\n";
print "list of the tests that could be run:\n";
print "\t check_for_noncvs_files
+ check_for_generated_headers
check_for_synch_include
check_for_OS_h_include
check_for_streams_include
@@ -2064,9 +2097,10 @@ if ($opt_t) {
print "--------------------Configuration: Fuzz - Level ",$opt_l,
"--------------------\n";
+check_for_generated_headers () if ($opt_l >= 6);
check_for_bad_run_test () if ($opt_l >= 5);
-check_for_deprecated_macros () if ($opt_l > 1 );
-check_for_refcountservantbase () if ($opt_l > 1 );
+check_for_deprecated_macros () if ($opt_l >= 1);
+check_for_refcountservantbase () if ($opt_l >= 1);
check_for_msc_ver_string () if ($opt_l >= 3);
check_for_empty_files () if ($opt_l >= 1);
check_for_noncvs_files () if ($opt_l >= 1);
@@ -2099,10 +2133,11 @@ check_for_changelog_errors () if ($opt_l >= 4);
check_for_ptr_arith_t () if ($opt_l >= 4);
check_for_include () if ($opt_l >= 5);
check_for_non_bool_operators () if ($opt_l > 2);
-check_for_long_file_names () if ($opt_l > 1 );
-check_for_improper_main_declaration ();
-check_for_TAO_Local_RefCounted_Object ();
-check_for_ORB_init ();
+check_for_long_file_names () if ($opt_l >= 1);
+check_for_improper_main_declaration () if ($opt_l >= 1);
+check_for_TAO_Local_RefCounted_Object () if ($opt_l >= 1);
+check_for_ORB_init () if ($opt_l >= 1);
+check_for_export_file () if ($opt_l >= 6);
print "\nFuzz.pl - $errors error(s), $warnings warning(s)\n";