summaryrefslogtreecommitdiff
path: root/bin/auto_compile
diff options
context:
space:
mode:
Diffstat (limited to 'bin/auto_compile')
-rwxr-xr-xbin/auto_compile242
1 files changed, 0 insertions, 242 deletions
diff --git a/bin/auto_compile b/bin/auto_compile
deleted file mode 100755
index 1fab6da8ab1..00000000000
--- a/bin/auto_compile
+++ /dev/null
@@ -1,242 +0,0 @@
-# -*- perl -*-
-# $Id$
-#
-# This script checkouts ACE from CVS, updates the "clone" directory,
-# compiles $ACE_ROOT/ace and $ACE_ROOT/tests and finally runs
-# $ACE_ROOT/tests/run_tests.sh.
-#
-# If it detects any problem it send email.
-#
-# DO NOT invoke this script from your crontab, use
-# auto_compile_wrapper for that.
-#
-# This script requires Perl5.
-#
-# TODO: Modify the script or split it in such a way that the main copy
-# can be obtained either using cvs or downloading the lastest beta
-# from the WWW.
-#
-
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
-
-# The first three lines above let this script run without specifying the
-# full path to perl, as long as it is in the user's PATH.
-# Taken from perlrun man page.
-
-use File::Basename;
-use FileHandle;
-require POSIX;
-
-# This is the module we will checkout, someday someone could define a
-# smaller module.
-$MODULE='ACE_wrappers';
-
-# This are the sub-directories (in the module) we really compile.
-
-@BUILD_LIST=
- ('ace',
- 'netsvcs',
- 'tests',
- 'apps/gperf',
- 'TAO');
-
-# This are the pairs "sub-directory , script" we run; the separator
-# *must* be a space followed by a comma and then another space.
-
-@RUN_LIST =
- ( 'tests , run_tests.sh',
- 'TAO/tests/Param_Test , run_test.pl',
- 'TAO/tests/Param_Test , run_test.pl -i dii',
- 'TAO/orbsvcs/tests/Simple_Naming , run_test.pl',
- 'TAO/orbsvcs/tests/Property , run_test.pl',
- 'TAO/performance-tests/Cubit/TAO/IDL_Cubit , run_test.pl');
-
-# We obtain our revision to report errors.
-$REVISION='$Revision$';
-
-# Find out the command name.
-$CMD = basename($0);
-
-# Extract configuration information from command line.
-# TODO: Some validation and checking should be done here.
-$CHECKOUT = $ARGV[0];
-$BUILD = $ARGV[1];
-$LOGDIR = $ARGV[2];
-$ADMIN = $ARGV[3];
-$MAKEFLAGS = $ARGV[4];
-
-# When an error is found we try to die gracefully and send some email
-# to ADMIN.
-
-sub mydie {
- local @msg = @_;
- open(MAIL, "|mail $ADMIN")
- || die "cannot open email pipe on error: $msg\n";
- print MAIL 'The following error is brought to you by: ', "\n";
- print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n";
- print MAIL "\n";
- local $m;
- foreach $m (@msg) {
- print MAIL $m, "\n";
- }
- print MAIL "\nPlease check log files for more info\n";
- close(MAIL)
- || die "cannot close email pipe on error: $msg\n";
- print HIST 'FAILED', "\n";
- exit 0;
-}
-
-### MAIN FUNCTION
-
-$histfile = $LOGDIR . '/history';
-open(HIST, '>>' . $histfile)
- # Do not use 'mydie' to report the problem, it tries to use HIST....
- || die "cannot open history file \"$histfile\"\n";
-
-$date = localtime;
-
-print HIST $CMD, ': running at ', $date, ' ';
-
-if (-f $LOGDIR . '/.disable') {
- print HIST "DISABLED\n";
- exit 0;
-}
-
-$LOGFILE = $LOGDIR . '/' . POSIX::strftime("%b%d_%Y.log", localtime);
-open(LOG, '>' . $LOGFILE)
- || mydie "cannot open log file";
-
-LOG->autoflush ();
-
-# The following lines are useful when debugging the script or wrapper.
-# print LOG $CHECKOUT, " ", $BUILD, " ", $LOGDIR, " ", $ADMIN, "\n";
-#while (($key,$value) = each %ENV) {
-# print LOG $key, " = ", $value, "\n";
-#}
-
-chdir($CHECKOUT)
- || mydie "Cannot chdir to $CHECKOUT";
-
-$date = localtime;
-print LOG "$CMD: starting checkout at ", $date, "\n";
-open(CVS, "cvs checkout -P $MODULE 2>&1 |")
- || mydie "cannot start checkout of $MODULE";
-
-$conflicts = 0;
-while (<CVS>) {
- if (m/^C /) {
- $conflicts = 1;
- }
- print LOG $_;
-}
-close(CVS)
- || mydie "error while checking out $MODULE";
-$date = localtime;
-print LOG "$CMD: checkout finished at ", $date, "\n";
-
-if ($conflicts != 0) {
- mydie "conflicts on checkout";
-}
-
-chdir($MODULE)
- || mydie "cannot chdir to $MODULE";
-
-$date = localtime;
-print LOG "$CMD: starting clone at ", $date, "\n";
-open(MAKE, "bin/create_ace_build -a -v $BUILD 2>&1 |")
- || mydie "cannot clone directory";
-while(<MAKE>) {
- print LOG $_;
-}
-close(MAKE)
- || mydie "error while cloning ACE_ROOT";
-$date = localtime;
-print LOG "$CMD: clone finished at ", $date, "\n";
-
-chdir('build/' . $BUILD)
- || mydie "cannot chdir to $BUILD";
-
-# This is needed for real make run....
-$ENV{'ACE_ROOT'} = $CHECKOUT . '/' . $MODULE . '/build/' . $BUILD;
-$ENV{'TAO_ROOT'} = $CHECKOUT . '/' . $MODULE . '/build/' . $BUILD . '/TAO';
-
-@failures = ();
-$MAKEFLAGS .= " shared_libs_only=1";
-foreach $i (@BUILD_LIST) {
- $date = localtime;
- print LOG "$CMD: make for $i started at ", $date, "\n";
- open(MAKE, "make -k $MAKEFLAGS -C $i 2>&1 |")
- || mydie "cannot start make for $i";
-
- local $current_dir = $i;
- local $last_error = "";
- while (<MAKE>) {
- print LOG $_;
- chop;
- if (m/^make(\[[0-9]+\])?: Entering directory /) {
- s/^make(\[[0-9]+\])?: Entering directory //;
- s%^$ENV{'ACE_ROOT'}/%%;
- $current_dir = $_;
- }
- if (m/^make(\[[0-9]+\])?: \*\*\*/) {
- if ($last_error ne $current_dir) {
- push @failures, "Error while compiling in $current_dir \n";
- $last_error = $current_dir;
- }
- }
- }
- if (close(MAKE) == 0) {
- push @failures, "errors while running make in $i";
- }
- $date = localtime;
- print LOG "$CMD: make for $i finished at ", $date, "\n";
-}
-
-foreach $i (@RUN_LIST) {
- local @test_info = split (/\ \,\ /, $i);
- local $directory = $test_info[0];
- local $program = $test_info[1];
-
- $date = localtime;
- print LOG "$CMD: running $program in $directory at ", $date, "\n";
- local $subdir =
- $CHECKOUT .'/'. $MODULE .'/build/'. $BUILD .'/'. $directory;
- chdir ($subdir)
- || mydie "cannot chdir to $subdir";
-
- $run_error = 0;
- if (open(RUN, "$program 2>&1 |") == 0) {
- push @failures, "cannot run $program in $directory";
- next;
- }
- while (<RUN>) {
- print LOG $_;
- if (m/^Error/ || m/FAILED/) {
- $run_error = 1;
- }
- }
- if (close(RUN) == 0) {
- push @failures, "cannot finish $program in $directory";
- next;
- }
- $date = localtime;
- print LOG "$CMD: $program finished ", $date, "\n";
-
- if ($run_error != 0) {
- push @failures,
- "errors detected while running $program in $directory";
- }
-}
-
-if ($#failures >= 0) {
- mydie @failures;
-}
-
-close(LOG)
- || mydie "cannot close LOGFILE";
-
-print HIST "OK\n";
-close(HIST)
- || mydie "cannot close history file";