summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-12-14 18:45:34 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-12-14 18:45:34 +0000
commit9d5225ea472ea6ec46bd77223b34191f7c6f389b (patch)
tree6c04a00db80e7825ef212e8a7484ed5e4547c2ae
parentfd8cc097db5cc6ba5001bce1437ffe2af1d6051e (diff)
downloadATCD-9d5225ea472ea6ec46bd77223b34191f7c6f389b.tar.gz
ChangeLogTag:Thu Dec 14 10:36:45 2000 Darrell Brunsch <brunsch@uci.edu>
-rw-r--r--ChangeLog29
-rw-r--r--ChangeLogs/ChangeLog-02a29
-rw-r--r--ChangeLogs/ChangeLog-03a29
-rw-r--r--bin/ACEutils.pm16
-rwxr-xr-xbin/auto_compile29
-rw-r--r--bin/auto_run_tests.lst96
-rwxr-xr-xbin/auto_run_tests.pl98
-rwxr-xr-xbin/fuzz.pl37
-rwxr-xr-xbin/msvc_auto_compile.pl21
-rw-r--r--tests/run_test.lst77
-rwxr-xr-xtests/run_test.pl250
11 files changed, 467 insertions, 244 deletions
diff --git a/ChangeLog b/ChangeLog
index 9eacce59570..ebe8e3b1e85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+Thu Dec 14 10:36:45 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * bin/auto_run_tests.lst:
+ * tests/run_test.lst:
+
+ Converted to the new PerlACE::ConfigList style of .lst
+ files (can now say stuff like "Test: MSVC !Borland")
+
+ * bin/auto_run_tests.pl:
+ * bin/auto_compile:
+ * tests/run_test.pl:
+
+ Changed to use PerlACE::ConfigList.
+
+ * bin/ACEutils.pm:
+
+ Made sure it would eat the -Config option so it will not
+ be a problem if old run_test.pl's don't get updated
+ immediately.
+
+ * bin/msvc_auto_compile.pl:
+
+ Added -d flag for debugging (just prints out what would be
+ compiled)
+
+ * bin/fuzz.pl:
+
+ Added a rudimentary run_test.pl out-of-date test.
+
Thu Dec 14 10:20:49 2000 Chad Elliott <elliott_c@ociweb.com>
* include/makeinclude/platform_lynxos.GNU
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 9eacce59570..ebe8e3b1e85 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,32 @@
+Thu Dec 14 10:36:45 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * bin/auto_run_tests.lst:
+ * tests/run_test.lst:
+
+ Converted to the new PerlACE::ConfigList style of .lst
+ files (can now say stuff like "Test: MSVC !Borland")
+
+ * bin/auto_run_tests.pl:
+ * bin/auto_compile:
+ * tests/run_test.pl:
+
+ Changed to use PerlACE::ConfigList.
+
+ * bin/ACEutils.pm:
+
+ Made sure it would eat the -Config option so it will not
+ be a problem if old run_test.pl's don't get updated
+ immediately.
+
+ * bin/msvc_auto_compile.pl:
+
+ Added -d flag for debugging (just prints out what would be
+ compiled)
+
+ * bin/fuzz.pl:
+
+ Added a rudimentary run_test.pl out-of-date test.
+
Thu Dec 14 10:20:49 2000 Chad Elliott <elliott_c@ociweb.com>
* include/makeinclude/platform_lynxos.GNU
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 9eacce59570..ebe8e3b1e85 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,32 @@
+Thu Dec 14 10:36:45 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * bin/auto_run_tests.lst:
+ * tests/run_test.lst:
+
+ Converted to the new PerlACE::ConfigList style of .lst
+ files (can now say stuff like "Test: MSVC !Borland")
+
+ * bin/auto_run_tests.pl:
+ * bin/auto_compile:
+ * tests/run_test.pl:
+
+ Changed to use PerlACE::ConfigList.
+
+ * bin/ACEutils.pm:
+
+ Made sure it would eat the -Config option so it will not
+ be a problem if old run_test.pl's don't get updated
+ immediately.
+
+ * bin/msvc_auto_compile.pl:
+
+ Added -d flag for debugging (just prints out what would be
+ compiled)
+
+ * bin/fuzz.pl:
+
+ Added a rudimentary run_test.pl out-of-date test.
+
Thu Dec 14 10:20:49 2000 Chad Elliott <elliott_c@ociweb.com>
* include/makeinclude/platform_lynxos.GNU
diff --git a/bin/ACEutils.pm b/bin/ACEutils.pm
index b8fe92a8455..65aa31e0c71 100644
--- a/bin/ACEutils.pm
+++ b/bin/ACEutils.pm
@@ -22,6 +22,21 @@ sub CheckForExeDir
}
}
+
+### Check and remove, but don't actually use
+sub CheckForConfig
+{
+ for($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq '-Config') {
+ if (!defined $ARGV[$i + 1]) {
+ print STDERR "You must pass a configuration with Config\n";
+ exit(1);
+ }
+ splice(@ARGV, $i, 2);
+ }
+ }
+}
+
sub checkForTarget
{
my($cwd) = shift;
@@ -95,5 +110,6 @@ sub waitforfile_timed
$sleeptime = 5;
CheckForExeDir ();
+CheckForConfig ();
1;
diff --git a/bin/auto_compile b/bin/auto_compile
index ea23ce84b4b..a5947580414 100755
--- a/bin/auto_compile
+++ b/bin/auto_compile
@@ -156,6 +156,12 @@ if ($debug) {
push @INC, $CHECKOUT . '/' . $MODULE . '/bin';
+require PerlACE::ConfigList;
+
+$config_list = new PerlACE::ConfigList;
+
+$config_list->my_config_list (@CONFIGURATION_OPTIONS);
+
if ($#BUILD_LIST == -1) {
@BUILD_LIST=('.', 'TAO');
}
@@ -174,26 +180,9 @@ if ($debug) {
$ADMIN = $ENV{'LOGNAME'};
} else {
- my $line;
- open (LIST, "<".$CHECKOUT . '/' . $MODULE . '/bin/auto_run_tests.lst')
- || mydie "Cannot open auto_run_tests list\n";
-
- LIST_ELEMENT: while (<LIST>) {
- # ignore comments and blank lines
- next if (/^\#/ || /^\s*$/);
-
- chomp;
- my @stuff = split ":";
-
- foreach my $config (@CONFIGURATION_OPTIONS) {
- if (/$config/) {
- next LIST_ELEMENT;
- }
- }
- my $program = shift @stuff;
- $program =~ s/\s*//g; #remove any extra whitepace
- push @RUN_LIST, $program;
- }
+ $config_list->load ($CHECKOUT . '/' . $MODULE . '/bin/auto_run_tests.lst');
+
+ @RUN_LIST = $config_list->valid_entries ();
}
sub mail_logs {
diff --git a/bin/auto_run_tests.lst b/bin/auto_run_tests.lst
index 5224a7d7831..79c67c11fcb 100644
--- a/bin/auto_run_tests.lst
+++ b/bin/auto_run_tests.lst
@@ -5,32 +5,32 @@
# Each line has its own test, and a test can be followed by a
# list of configurations it does _not_ run on.
#
-# Example: TAO\examples\foo\run_test.pl: MINIMUM ST
+# Example: TAO\examples\foo\run_test.pl: !MINIMUM !ST
tests/run_test.pl
-TAO/tests/Param_Test/run_test.pl: MINIMUM
-TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl: MINIMUM ST
-TAO/performance-tests/Cubit/TAO/MT_Cubit/run_test.pl: ST
-TAO/performance-tests/Latency/run_test.pl: MINIMUM ST
+TAO/tests/Param_Test/run_test.pl: !MINIMUM
+TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl: !MINIMUM !ST
+TAO/performance-tests/Cubit/TAO/MT_Cubit/run_test.pl: !ST
+TAO/performance-tests/Latency/run_test.pl: !MINIMUM !ST
TAO/performance-tests/POA/Object_Creation_And_Registration/run_test.pl
-TAO/performance-tests/RTCorba/Oneways/Reliable/run_test.pl: MINIMUM
+TAO/performance-tests/RTCorba/Oneways/Reliable/run_test.pl: !MINIMUM
TAO/tests/OctetSeq/run_test.pl
-TAO/tests/Leader_Followers/run_test.pl: ST
+TAO/tests/Leader_Followers/run_test.pl: !ST
TAO/tests/Multiple_Inheritance/run_test.pl
-TAO/tests/RTCORBA/Client_Propagated/run_test.pl: MINIMUM linux
-TAO/tests/RTCORBA/Server_Declared/run_test.pl: MINIMUM ST linux
-TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: MINIMUM ST linux
-TAO/tests/RTCORBA/Banded_Connections/run_test.pl: MINIMUM ST linux
-TAO/tests/RTCORBA/Server_Protocol/run_test.pl: MINIMUM
-TAO/tests/RTCORBA/Client_Protocol/run_test.pl: MINIMUM
-TAO/tests/RTCORBA/Private_Connection/run_test.pl: MINIMUM
-TAO/tests/RTCORBA/Explicit_Binding/run_test.pl: MINIMUM
-TAO/tests/MT_Client/run_test.pl: ST
-TAO/tests/MT_Server/run_test.pl: ST
-TAO/tests/Faults/run_test.pl: MINIMUM
-TAO/tests/NestedUpcall/Simple/run_test.pl: ST
+TAO/tests/RTCORBA/Client_Propagated/run_test.pl: !MINIMUM !linux
+TAO/tests/RTCORBA/Server_Declared/run_test.pl: !MINIMUM !ST !linux
+TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: !MINIMUM !ST !linux
+TAO/tests/RTCORBA/Banded_Connections/run_test.pl: !MINIMUM !ST !linux
+TAO/tests/RTCORBA/Server_Protocol/run_test.pl: !MINIMUM
+TAO/tests/RTCORBA/Client_Protocol/run_test.pl: !MINIMUM
+TAO/tests/RTCORBA/Private_Connection/run_test.pl: !MINIMUM
+TAO/tests/RTCORBA/Explicit_Binding/run_test.pl: !MINIMUM
+TAO/tests/MT_Client/run_test.pl: !ST
+TAO/tests/MT_Server/run_test.pl: !ST
+TAO/tests/Faults/run_test.pl: !MINIMUM
+TAO/tests/NestedUpcall/Simple/run_test.pl: !ST
TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl
TAO/tests/NestedUpcall/Triangle_Test/run_test.pl
TAO/tests/Nested_Event_Loop/run_test.pl
@@ -40,51 +40,51 @@ TAO/tests/POA/Destruction/run_test.pl
TAO/tests/POA/Non_Servant_Upcalls/run_test.pl
TAO/tests/POA/wait_for_completion/run_test.pl
TAO/tests/IORManipulation/run_test.pl
-TAO/tests/Policies/run_test.pl: MINIMUM ST
-TAO/tests/Timeout/run_test.pl: MINIMUM
-TAO/tests/Timed_Buffered_Oneways/run_test.pl: MINIMUM
+TAO/tests/Policies/run_test.pl: !MINIMUM !ST
+TAO/tests/Timeout/run_test.pl: !MINIMUM
+TAO/tests/Timed_Buffered_Oneways/run_test.pl: !MINIMUM
TAO/tests/IDL_Test/run_test.pl
TAO/tests/ORB_init/run_test.pl
TAO/tests/ORB_destroy/run_test.pl
-TAO/tests/DSI_Gateway/run_test.pl: MINIMUM
-TAO/tests/DynAny_Test/run_test.pl: MINIMUM
-# BROKEN TAO/tests/Connection_Purging/run_test.pl: ST
-TAO/tests/LongUpcalls/run_test.pl: MINIMUM
-TAO/examples/Buffered_Oneways/run_test.pl: MINIMUM
-# REQUIRES AMI 'TAO/examples/Buffered_AMI/run_test.pl: MINIMUM
-TAO/tests/InterOp-Naming/run_test.pl: MINIMUM
+TAO/tests/DSI_Gateway/run_test.pl: !MINIMUM
+TAO/tests/DynAny_Test/run_test.pl: !MINIMUM
+# BROKEN TAO/tests/Connection_Purging/run_test.pl: !ST
+TAO/tests/LongUpcalls/run_test.pl: !MINIMUM
+TAO/examples/Buffered_Oneways/run_test.pl: !MINIMUM
+# REQUIRES AMI 'TAO/examples/Buffered_AMI/run_test.pl: !MINIMUM
+TAO/tests/InterOp-Naming/run_test.pl: !MINIMUM
TAO/tests/Multiple/run_test.pl
# This test is broken - to be fixed by Angelo TAO/tests/Exposed_Policies/run_test.pl
-TAO/examples/POA/Adapter_Activator/run_test.pl: MINIMUM
-TAO/examples/POA/DSI/run_test.pl: MINIMUM
-TAO/examples/POA/Default_Servant/run_test.pl: MINIMUM
-TAO/examples/POA/Explicit_Activation/run_test.pl: MINIMUM
-TAO/examples/POA/FindPOA/run_test.pl: MINIMUM
-TAO/examples/POA/Forwarding/run_test.pl: MINIMUM
-TAO/examples/POA/NewPOA/run_test.pl: MINIMUM
-TAO/examples/POA/On_Demand_Activation/run_test.pl: MINIMUM STATIC
-TAO/examples/POA/On_Demand_Loading/run_test.pl: MINIMUM STATIC
+TAO/examples/POA/Adapter_Activator/run_test.pl: !MINIMUM
+TAO/examples/POA/DSI/run_test.pl: !MINIMUM
+TAO/examples/POA/Default_Servant/run_test.pl: !MINIMUM
+TAO/examples/POA/Explicit_Activation/run_test.pl: !MINIMUM
+TAO/examples/POA/FindPOA/run_test.pl: !MINIMUM
+TAO/examples/POA/Forwarding/run_test.pl: !MINIMUM
+TAO/examples/POA/NewPOA/run_test.pl: !MINIMUM
+TAO/examples/POA/On_Demand_Activation/run_test.pl: !MINIMUM !STATIC
+TAO/examples/POA/On_Demand_Loading/run_test.pl: !MINIMUM !STATIC
TAO/examples/POA/Reference_Counted_Servant/run_test.pl
-TAO/examples/POA/Loader/run_test.pl: MINIMUM STATIC
+TAO/examples/POA/Loader/run_test.pl: !MINIMUM !STATIC
TAO/examples/POA/RootPOA/run_test.pl
-TAO/examples/POA/Adapter_Activator/run_test.pl: MINIMUM
+TAO/examples/POA/Adapter_Activator/run_test.pl: !MINIMUM
TAO/examples/Simple/bank/run_test.pl
TAO/examples/Simple/grid/run_test.pl
-TAO/examples/Simple/time-date/run_test.pl: ST STATIC
+TAO/examples/Simple/time-date/run_test.pl: !ST !STATIC
TAO/examples/Simple/time/run_test.pl
-TAO/examples/Load_Balancing/run_test.pl: MINIMUM
+TAO/examples/Load_Balancing/run_test.pl: !MINIMUM
TAO/orbsvcs/tests/Simple_Naming/run_test.pl
-TAO/orbsvcs/tests/Trading/run_test.pl: MINIMUM
-TAO/orbsvcs/tests/Event/Basic/run_test.pl: ST
-TAO/orbsvcs/tests/Event/Performance/run_test.pl: ST
+TAO/orbsvcs/tests/Trading/run_test.pl: !MINIMUM
+TAO/orbsvcs/tests/Event/Basic/run_test.pl: !ST
+TAO/orbsvcs/tests/Event/Performance/run_test.pl: !ST
TAO/orbsvcs/tests/EC_Basic/run_test.pl
-TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl: ST
-TAO/orbsvcs/tests/EC_Throughput/run_test.pl: ST
-# BREAKS LINUX 'TAO/orbsvcs/tests/EC_Mcast/run_test.pl
+TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl: !ST
+TAO/orbsvcs/tests/EC_Throughput/run_test.pl: !ST
+# BREAKS !linux 'TAO/orbsvcs/tests/EC_Mcast/run_test.pl
# FAILS 'TAO/orbsvcs/tests/EC_Multiple/run_test.pl
TAO/orbsvcs/tests/Event_Latency/run_test.pl
# NO REDIRECTION TAO/examples/Simple/echo/run_test.pl < Echo.idl
diff --git a/bin/auto_run_tests.pl b/bin/auto_run_tests.pl
index bf86053bbf7..3676b0c2231 100755
--- a/bin/auto_run_tests.pl
+++ b/bin/auto_run_tests.pl
@@ -7,10 +7,25 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# This file is for running the run_test.pl scripts listed in
# auto_run_tests.lst.
+if (!($ACE_ROOT = $ENV{ACE_ROOT})) {
+ my $cd = getcwd ();
+ chdir ('..');
+ $ACE_ROOT = getcwd ().$DIR_SEPARATOR;
+ chdir ($cd);
+ warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT";
+}
+
+unshift @INC, "$ACE_ROOT/bin";
+require ACEutils;
+require PerlACE::ConfigList;
+
use English;
use Getopt::Std;
+use Cwd;
+
+################################################################################
-if (!getopts ('ac:s:t') || $opt_h) {
+if (!getopts ('ac:ds:t') || $opt_h) {
print "run_test.pl [-a] [-c config] [-h] [-s sandbox] [-t]\n";
print "\n";
print "Runs the tests listed in auto_run_tests.lst\n";
@@ -26,61 +41,16 @@ if (!getopts ('ac:s:t') || $opt_h) {
exit (1);
}
-use Cwd;
-
-if (!($ACE_ROOT = $ENV{ACE_ROOT})) {
- my $cd = getcwd ();
- chdir ('..');
- $ACE_ROOT = getcwd ().$DIR_SEPARATOR;
- chdir ($cd);
- warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT";
-}
-
-unshift @INC, "$ACE_ROOT/bin";
-require ACEutils;
+$config_list = new PerlACE::ConfigList;
-$config = 'DEFAULT';
+$config_list->load ($ACE_ROOT."/bin/auto_run_tests.lst");
-if ($opt_c) {
- $config = $opt_c;
+if ($#CONFIGS < 0) {
+ print "Warning: No configurations selected, defaulting to none.\n";
+ print " Possible Configs: ", $config_list->list_configs (), "\n";
}
-else {
- print "Defaulting to configuration: $config\n";
-}
-
-
-################################################################################
-
-@tests = ();
-
-# Loads the list and runs it
-sub read_run_test_list ()
-{
- my $line;
- open (LIST, "<$ACE_ROOT/bin/auto_run_tests.lst")
- || die "Cannot open $ACE_ROOT/bin/auto_run_tests.lst";
-
- while (<LIST>) {
- next if (/^#/ || /^\s*$/); # ignore comments and blank lines
-
- chomp;
- my @stuff = split ":";
-
- if (!/$config/) {
- my $program = shift @stuff;
- $program =~ s/\s*//g; #remove any extra whitepace
- push @tests, $program;
- }
- }
-
- close (LIST);
-}
-
-################################################################################
-read_run_test_list ();
-
-foreach $test (@tests) {
+foreach $test ($config_list->valid_entries ()) {
my $directory = ".";
my $program = ".";
@@ -104,20 +74,34 @@ foreach $test (@tests) {
chdir ($ACE_ROOT."/$directory")
|| die "Error: Cannot chdir to $ACE_ROOT/$directory";
- $run_error = 0;
-
if (! -e $program) {
print STDERR "Error: $test does not exist\n";
next;
}
- my $result = 0;
+ ### Genrate the -ExeSubDir and -Config options
+ my $inherited_options = " -ExeSubDir $EXEPREFIX ";
+ foreach my $config (@CONFIGS) {
+ $inherited_options .= " -Config $config ";
+ }
+
+ $cmd = '';
if ($opt_s) {
- $result = system ("$opt_s \"perl $program\"");
+ $cmd = "$opt_s \"perl $program $inherited_options\"";
}
else {
- $result = system ($program);
+ $cmd = $program.$inherited_options;
+ }
+
+
+ my $result = 0;
+
+ if (defined $opt_d) {
+ print "Running: $cmd\n";
+ }
+ else {
+ $result = system ($cmd);
}
if ($result > 0) {
diff --git a/bin/fuzz.pl b/bin/fuzz.pl
index 26a60d3bb2a..62c7fa85c2e 100755
--- a/bin/fuzz.pl
+++ b/bin/fuzz.pl
@@ -220,7 +220,7 @@ sub check_for_inline ()
if (/FUZZ\: enable check_for_inline/) {
$disable = 0;
}
- if ($disable == 0 and /^\s*inline/) {
+ if ($disable == 0 and m/^\s*inline/) {
print_error ("inline found in $file on line $line");
}
}
@@ -439,6 +439,40 @@ sub check_for_mismatched_filename ()
}
}
+# check for
+sub check_for_old_run_test ()
+{
+ print "Running old run_test.pl test\n";
+ foreach $file (@files_pl) {
+ if (open (FILE, $file)) {
+ print "Looking at file $file\n" if $opt_d;
+ while (<FILE>) {
+ if (m/ACEutils/) {
+ print_error ("ACEutils.pm still being used in $file");
+ }
+
+ if (m/unshift \@INC/) {
+ print_error ("Still unshifting \@INC, should \"use lib\""
+ ." instead in $file");
+ }
+
+ if (m/ACE\:\:/ && !m/PerlACE\:\:/) {
+ print_error ("Still using ACE::* in $file");
+ }
+
+ if (m/Process\:\:/ && !m/PerlACE\:\:Process\:\:/) {
+ print_error ("Still using Process::* in $file");
+ }
+
+ }
+ close (FILE);
+ }
+ else {
+ print STDERR "Error: Could not open $file\n";
+ }
+ }
+}
+
##############################################################################
#our ($opt_c, $opt_d, $opt_h, $opt_l, $opt_m);
@@ -483,6 +517,7 @@ check_for_preprocessor_comments () if ($opt_l >= 7);
check_for_tchar () if ($opt_l >= 4);
check_for_pre_and_post () if ($opt_l >= 4);
check_for_mismatched_filename () if ($opt_l >= 2);
+check_for_old_run_test () if ($opt_l >= 6);
print "\nFuzz.pl - $errors error(s), $warnings warning(s)\n";
diff --git a/bin/msvc_auto_compile.pl b/bin/msvc_auto_compile.pl
index f90db53c151..4630cd2f0a2 100755
--- a/bin/msvc_auto_compile.pl
+++ b/bin/msvc_auto_compile.pl
@@ -23,6 +23,7 @@ else {
"$ACE_ROOT\\tests",
"$ACE_ROOT\\websvcs");
+$debug = 0;
$verbose = 0;
$print_status = 0;
$Ignore_errors = 0; # By default, bail out if an error occurs.
@@ -104,11 +105,17 @@ sub Build ($$)
{
my ($project, $config) = @_;
- print "Auto_compiling $project : $config\n";
-
- print "Building $project $config\n" if $verbose;
-
- return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd $useenv");
+ if ($debug == 1) {
+ print "$project\n";
+ return 0;
+ }
+ else {
+ print "Auto_compiling $project : $config\n";
+
+ print "Building $project $config\n" if $verbose;
+
+ return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd $useenv");
+ }
}
# Only builds the core libraries.
@@ -227,6 +234,9 @@ while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ )
print "Ignore errors\n" if ( $verbose );
$Ignore_errors = 1;
}
+ elsif ($ARGV[0] =~ /^-d$/i) { # debug
+ $debug = 1;
+ }
elsif ($ARGV[0] =~ '-v') { # verbose mode
$verbose = 1;
}
@@ -287,6 +297,7 @@ while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ )
}
elsif ($ARGV[0] =~ '-(\?|h)') { # Help information
print "Options\n";
+ print "-d = Debug (only print out projects)\n";
print "-k = Ignore Errors\n";
print "-v = Script verbose Mode\n";
print "-s = Print status messages to STDERR\n";
diff --git a/tests/run_test.lst b/tests/run_test.lst
index abaf453e79d..eac55c9224a 100644
--- a/tests/run_test.lst
+++ b/tests/run_test.lst
@@ -1,29 +1,40 @@
+# $Id$
+#
# This is the list of tests that need to be run by run_test.pl.
# Each line has its own test, and a test can be followed by a
-# list of platforms it does _not_ run on.
+# list of platforms it runs or does not run on.
#
-# Example: Foo_Test: MSVC SUNCC5 CHORUS
+# Example: Foo_Test: !linux
+# Example: Bar_Test:
+# Example: Baz_Test: Win32 !Borland
+#
+# Foo_Test runs on all configurations except for linux
+#
+# Bar_Test runs on all configurations
+#
+# Baz_Test only runs on Win32 configurations but not on Borland
+# configurations.
-ACE_Init_Test: UNIX BORLAND
+ACE_Init_Test: MSVC
Atomic_Op_Test
Auto_IncDec_Test
Barrier_Test
Basic_Types_Test
Buffer_Stream_Test
Cache_Map_Manager_Test
-Cached_Conn_Test
+Cached_Conn_Test: !LynxOS
Cached_Accept_Conn_Test
Capabilities_Test
CDR_Test
CDR_File_Test
CDR_Array_Test
Collection_Test
-Conn_Test
-DLL_Test
+Conn_Test: !chorus
+DLL_Test: !Unicos !STATIC
DLList_Test
Dynamic_Priority_Test
Enum_Interfaces_Test
-Env_Value_Test
+Env_Value_Test: !chorus
Future_Test
Future_Set_Test
Handle_Set_Test
@@ -31,35 +42,35 @@ Hash_Map_Manager_Test
Hash_Map_Bucket_Iterator_Test
High_Res_Timer_Test
IOStream_Test
-Lazy_Map_Manager_Test
+Lazy_Map_Manager_Test
Map_Manager_Test
Map_Test
-Mem_Map_Test
-Message_Block_Test
+Mem_Map_Test: !chorus !Unicos
+Message_Block_Test: !chorus
Message_Queue_Notifications_Test
-Message_Queue_Test
-MM_Shared_Memory_Test
-MT_Reactor_Timer_Test
-MT_SOCK_Test
+Message_Queue_Test: !chorus
+MM_Shared_Memory_Test: !chorus !Unicos
+MT_Reactor_Timer_Test: ALL MSVC !DISABLED
+MT_SOCK_Test: !chorus
Malloc_Test
-Naming_Test
-# (Using all the memory has bad side effects) New_Fail_Test: MSVC
+Naming_Test: OTHER !chorus !LynxOS !Unicos
+New_Fail_Test: ALL !DISABLED
Notify_Performance_Test
Object_Manager_Test
OrdMultiSet_Test
OS_Test
-Pipe_Test: MSVC
+Pipe_Test: !MSVC !chorus
Priority_Buffer_Test
-Priority_Reactor_Test
-Priority_Task_Test
-Process_Manager_Test
-Process_Mutex_Test: MSVC
-Process_Strategy_Test
+Priority_Reactor_Test: !chorus
+Priority_Task_Test: !Unicos
+Process_Manager_Test: ALL MSVC !DISABLED
+Process_Mutex_Test: !MSVC !chorus
+Process_Strategy_Test: !chorus !LynxOS
RB_Tree_Test
Reactors_Test
Reactor_Exceptions_Test
Reactor_Notify_Test
-Reactor_Performance_Test
+Reactor_Performance_Test: !chorus
Reactor_Timer_Test
Reader_Writer_Test
Recursive_Mutex_Test
@@ -67,24 +78,24 @@ Reverse_Lock_Test
Semaphore_Test
Service_Config_Test
Sigset_Ops_Test
-Simple_Message_Block_Test
+Simple_Message_Block_Test: !chorus
Svc_Handler_Test
-SOCK_Test
+SOCK_Test: !chorus
SOCK_Connector_Test
-SOCK_Send_Recv_Test
+SOCK_Send_Recv_Test: !LynxOS
SPIPE_Test
SString_Test
-SV_Shared_Memory_Test: MSVC
+SV_Shared_Memory_Test: !MSVC !Unicos
Task_Test
-Thread_Manager_Test
-Thread_Mutex_Test
+Thread_Manager_Test: !Unicos
+Thread_Mutex_Test: !chorus
Thread_Pool_Reactor_Test
-Thread_Pool_Test
+Thread_Pool_Test: !LynxOS
Timer_Queue_Test
Timeprobe_Test
-Time_Service_Test
+Time_Service_Test: ALL !DISABLED !missing_netsvcs TOKEN !chorus !Unicos
Time_Value_Test
-Tokens_Test
+Tokens_Test: ALL MSVC !DISABLED TOKEN !chorus !Unicos
TSS_Test
UPIPE_SAP_Test
-Upgradable_RW_Test
+Upgradable_RW_Test: !chorus
diff --git a/tests/run_test.pl b/tests/run_test.pl
index 6c689b2bcd5..8410dfbc9d1 100755
--- a/tests/run_test.pl
+++ b/tests/run_test.pl
@@ -7,138 +7,182 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# This file is for running the tests in the ACE tests directory.
# It is usually used for auto_compiles.
-unshift @INC, '../bin';
-require ACEutils;
-
-if ($^O ne "MSWin32") {
- #### On platforms other than Windows, use run_tests.sh because
- #### it knows about the various test peculiarities.
- exec "${EXEPREFIX}run_tests.sh";
-}
+use lib '../bin';
+use PerlACE::Run_Test;
use Cwd;
use English;
use Getopt::Std;
+use FileHandle;
-if (!getopts ('tc:') || $opt_h) {
- print "run_test.pl [-h] [-c config] [-t] [file1 file2 ...]\n";
- print "\n";
- print "Runs the tests listed in run_test.lst\n";
- print "\n";
- print "Options:\n";
- print " -c config Run the tests for the <config> platform\n";
- print " -h display this help\n";
- print " -t Runs all the tests passed via the cmd line\n";
- print "\n";
- print "Configs: MSVC\n";
- exit (1);
-}
+$config_list = new PerlACE::ConfigList;
-if ($OSNAME eq 'MSWin32') {
- $config = 'MSVC';
-} else {
- $config = 'UNIX';
-}
+################################################################################
-if ($opt_c) {
- $config = $opt_c;
-}
-else {
- print "Defaulting to configuration: $config\n";
-}
+sub check_for_more_configs ()
+{
+ my $fh = new FileHandle;
+
+ if ($fh->open ("< ../ace/ACE_COMPONENTS.list")) {
+ while (<$fh>) {
+ if (m/ Other /) {
+ print "Adding 'Other' as my config\n" if defined $opt_d;
+ $config_list->add_one_config ('OTHER');
+ }
+ if (m/ Token /) {
+ print "Adding 'Token' as my config\n" if defined $opt_d;
+ $config_list->add_one_config ('TOKEN');
+ }
+ }
+
+ $fh->close ();
+ }
+ elsif (defined $opt_d) {
+ print "Could not open ACE_COMPONENTS.list file\n" if defined $opt_d;
+ print "Assuming TOKEN and OTHER subsets are included\n" if defined $opt_d;
+ $config_list->add_one_config ('OTHER');
+ $config_list->add_one_config ('TOKEN');
+ }
+
+ my $P = new PerlACE::Process ("../netsvcs/servers/main");
-if (!($tmp = $ENV{TMP})) {
- $tmp="/tmp";
+ if (!-x $P->Executable ()) {
+ $config_list->add_one_config ('missing_netsvcs');
+ }
}
################################################################################
-@tests = ();
-
-# Loads the list and runs it
-sub read_run_test_list ()
+sub record_resources ()
{
- my $line;
- open (LIST, "<run_test.lst")
- || die "Cannot open run_test.lst";
-
- while (<LIST>) {
- next if (/^#/ || /^\s*$/); # ignore comments and blank lines
+ if ($config_list->check_config ('CHECK_RESOURCES')) {
+ if (!defined $ENV{'LOGNAME'}) {
+ $user=`whoami`;
+ }
+ else {
+ $user = $ENV{'LOGNAME'};
+ }
+
+ $start_test_resources=`ipcs | egrep $user`;
+ }
+}
- chomp;
- my @stuff = split ":";
+################################################################################
- if (!/$config/) {
- my $program = shift @stuff;
- $program =~ s/\s*//g; #remove any extra whitepace
- push @tests, $program;
+sub check_resources ()
+{
+ if ($config_list->check_config ('CHECK_RESOURCES')) {
+ $end_test_resources=`ipcs | egrep $user`;
+
+ if ("$start_test_resources" ne "$end_test_resources") {
+ print STDERR "Warning: the ACE tests _may_ have leaked OS ".
+ "resources!\n";
+ print STDERR "Warning: Before: $start_test_resources\n";
+ print STDERR "Warning: After: $end_test_resources\n";
}
}
-
- close (LIST);
}
+################################################################################
+
sub run_program ($)
{
my $program = shift;
- $program_exe = $EXEPREFIX.$program.$EXE_EXT;
-
- unlink "core";
local $log = "log/".$program.".log";
unlink $log;
+ unlink "core";
+
+ my $P = new PerlACE::Process ($program);
### Try to run the program
- if (! -x $program_exe) {
- print STDERR "Error: $program_exe does not exist\n";
+ if (! -x $P->Executable ()) {
+ print STDERR "Error: " . $P->Executable () .
+ " does not exist or is not runnable\n";
return;
}
print STDERR "Running $program\n";
- $P = Process::Create ($program_exe, "");
- $status = $P->TimedWait (300);
+ $status = $P->SpawnWaitKill (300);
+
+ ### Check for problems
if ($status == -1) {
print STDERR "Error: $program FAILED (time out)\n";
- $P->Kill (); $P->TimedWait (1);
- } elsif ($status != 0) {
+ $P->Kill ();
+ $P->TimedWait (1);
+ }
+ elsif ($status != 0) {
print STDERR "Error: $program FAILED with exit status $status\n";
}
- check_log ($log);
+ check_log ($program, $log);
}
-sub check_log ($)
+################################################################################
+
+sub purify_program ($)
{
+ ### @todo
+
+ my $program = shift;
+
+ $program_exe = $program;
+
+ print STDERR "Purifying $program\n";
+
+ system ("purify ".
+ "/run ".
+ "/save-data=purify_results\$program.pfy ".
+ "/save-text-data=purify_results\$program.txt ".
+ "/AllocCallStackLength=20 ".
+ "/ErrorCallStackLength=20 ".
+ "/HandlesInUseAtExit ".
+ "/InUseAtExit ".
+ "/LeaksAtExit ".
+ "$program_exe");
+}
+
+################################################################################
+
+sub check_log ($$)
+{
+ my $program = shift;
my $log = shift;
+
### Check the logs
+
if (-e "core") {
- print STDERR "$program dumped core!!!!\n";
+ print STDERR "Error: $program dumped core\n";
+ unlink "core";
}
+
if (! -e $log ) {
print STDERR "Error: No log file ($log) is present\n";
- } else {
+ }
+ else {
if (open (LOG, "<".$log) == 0) {
print STDERR "Error: Cannot open log file $log\n";
- } else {
+ }
+ else {
my $starting_matched = 0;
my $ending_matched = 0;
-
+
while (<LOG>) {
chomp;
-
+
if (m/Starting/) {
$starting_matched = 1;
}
-
+
if (m/Ending/) {
$ending_matched = 1;
}
-
+
if (/LM\_ERROR\@(.*)$/) {
print STDERR "Error: ($log): $1\n";
- }
+ }
}
close (LOG); # ignore errors
@@ -146,15 +190,16 @@ sub check_log ($)
if ($starting_matched == 0) {
print STDERR "Error ($log): no line with 'starting'\n";
}
-
+
if ($ending_matched == 0) {
print STDERR "Error ($log): no line with 'Ending'\n";
}
-
}
}
}
+################################################################################
+
sub delete_temp_files ()
{
my @files = ('ace_pipe_name', 'pattern');
@@ -167,7 +212,7 @@ sub delete_temp_files ()
foreach $file (readdir (DIR)) {
if ($file =~ /^ace_temp_file/ || $file =~ /^Naming_Test/) {
- push @files, $tmp.$DIR_SEPARATOR.$file;
+ push @files, $tmp . '/' . $file;
}
}
closedir (DIR);
@@ -182,17 +227,62 @@ sub delete_temp_files ()
################################################################################
-if (!$opt_t) {
- read_run_test_list ();
+$config_list->load ("run_test.lst");
+
+if (!getopts ('dht') || $opt_h) {
+ print "run_test.pl [-h] [-t file1 file2 ...]\n";
+ print "\n";
+ print "Runs the tests listed in run_test.lst\n";
+ print "\n";
+ print "Options:\n";
+ print " -d Debug mode (do not run tests)\n";
+ print " -h Display this help\n";
+ print " -t Runs all the tests passed via the cmd line\n";
+ print "\n";
+ print "Pass in configs using \"-Config XXXXX\"\n";
+ print "\n";
+ print "Possible Configs: CHECK_RESOURCES Purify",
+ $config_list->list_configs (), "\n";
+ exit (1);
+}
+
+## since we can't use "our" to get rid of warnings.
+$opt_h = $opt_h if (defined $opt_h);
+$opt_t = $opt_t if (defined $opt_t);
+
+if (!($tmp = $ENV{TMP}) && !($tmp = $ENV{TEMP})) {
+ $tmp="/tmp";
}
-else {
+
+check_for_more_configs ();
+
+@tests = ();
+
+if (defined $opt_t) {
@tests = @ARGV;
}
+else {
+ @tests = $config_list->valid_entries ();
+}
+
+if (defined $opt_d) {
+ $config_list->dump ();
+}
+
+record_resources () if (!defined $opt_d);
foreach $test (@tests) {
- run_program ($test);
+ if (defined $opt_d) {
+ print "Would run test $test now\n";
+ }
+ elsif ($config_list->check_config ('Purify')) {
+ purify_program ($test);
+ }
+ else {
+ run_program ($test);
+ }
}
-delete_temp_files ();
+check_resources () if (!defined $opt_d);
-exit ();
+delete_temp_files ();