2006-07-07 05:19:32 +08:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use POSIX qw(strftime);
|
|
|
|
use File::Copy;
|
2009-06-20 01:19:38 +08:00
|
|
|
use File::Find;
|
2006-07-07 05:19:32 +08:00
|
|
|
use Socket;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Program: NewNightlyTest.pl
|
|
|
|
#
|
|
|
|
# Synopsis: Perform a series of tests which are designed to be run nightly.
|
|
|
|
# This is used to keep track of the status of the LLVM tree, tracking
|
2009-01-03 00:28:18 +08:00
|
|
|
# regressions and performance changes. Submits this information
|
2006-08-13 17:53:02 +08:00
|
|
|
# to llvm.org where it is placed into the nightlytestresults database.
|
2006-07-07 05:19:32 +08:00
|
|
|
#
|
|
|
|
# Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
|
|
|
|
# where
|
|
|
|
# OPTIONS may include one or more of the following:
|
2009-10-19 17:18:24 +08:00
|
|
|
#
|
|
|
|
# MAIN OPTIONS:
|
|
|
|
# -config LLVMPATH If specified, use an existing LLVM build and only run and
|
|
|
|
# report the test information. The LLVMCONFIG argument should
|
|
|
|
# be the path to the llvm-config executable in the LLVM build.
|
|
|
|
# This should be the first argument if given. NOT YET
|
|
|
|
# IMPLEMENTED.
|
|
|
|
# -nickname NAME The NAME argument specifieds the nickname this script
|
|
|
|
# will submit to the nightlytest results repository.
|
2010-03-16 23:53:02 +08:00
|
|
|
# -nouname Don't include uname data (machine will be identified by nickname only).
|
2009-10-19 17:18:24 +08:00
|
|
|
# -submit-server Specifies a server to submit the test results too. If this
|
|
|
|
# option is not specified it defaults to
|
|
|
|
# llvm.org. This is basically just the address of the
|
|
|
|
# webserver
|
|
|
|
# -submit-script Specifies which script to call on the submit server. If
|
|
|
|
# this option is not specified it defaults to
|
|
|
|
# /nightlytest/NightlyTestAccept.php. This is basically
|
|
|
|
# everything after the www.yourserver.org.
|
|
|
|
# -submit-aux If specified, an auxiliary script to run in addition to the
|
|
|
|
# normal submit script. The script will be passed the path to
|
|
|
|
# the "sentdata.txt" file as its sole argument.
|
|
|
|
# -nosubmit Do not report the test results back to a submit server.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# BUILD OPTIONS (not used with -config):
|
2006-07-07 05:19:32 +08:00
|
|
|
# -nocheckout Do not create, checkout, update, or configure
|
|
|
|
# the source tree.
|
|
|
|
# -noremove Do not remove the BUILDDIR after it has been built.
|
2006-07-08 01:31:38 +08:00
|
|
|
# -noremoveresults Do not remove the WEBDIR after it has been built.
|
2009-11-06 12:12:07 +08:00
|
|
|
# -noclean Do not run 'make clean' before building.
|
2006-07-07 05:19:32 +08:00
|
|
|
# -nobuild Do not build llvm. If tests are enabled perform them
|
|
|
|
# on the llvm build specified in the build directory
|
2010-07-07 15:48:00 +08:00
|
|
|
# -release Build an LLVM Release+Asserts version
|
|
|
|
# -release-asserts Build an LLVM Release version
|
2009-10-19 17:18:24 +08:00
|
|
|
# -disable-bindings Disable building LLVM bindings.
|
|
|
|
# -with-clang Checkout Clang source into tools/clang.
|
|
|
|
# -compileflags Next argument specifies extra options passed to make when
|
|
|
|
# building LLVM.
|
|
|
|
# -use-gmake Use gmake instead of the default make command to build
|
|
|
|
# llvm and run tests.
|
2009-11-06 12:11:29 +08:00
|
|
|
# -llvmgccdir Next argument specifies the llvm-gcc install prefix.
|
2009-10-19 17:18:24 +08:00
|
|
|
#
|
|
|
|
# TESTING OPTIONS:
|
|
|
|
# -notest Do not even attempt to run the test programs.
|
|
|
|
# -nodejagnu Do not run feature or regression tests
|
2006-07-07 05:19:32 +08:00
|
|
|
# -enable-llcbeta Enable testing of beta features in llc.
|
2006-11-25 04:34:16 +08:00
|
|
|
# -enable-lli Enable testing of lli (interpreter) features, default is off
|
2009-06-12 21:02:52 +08:00
|
|
|
# -disable-pic Disable building with Position Independent Code.
|
2006-07-07 05:19:32 +08:00
|
|
|
# -disable-llc Disable LLC tests in the nightly tester.
|
|
|
|
# -disable-jit Disable JIT tests in the nightly tester.
|
|
|
|
# -disable-cbe Disable C backend tests in the nightly tester.
|
2008-01-12 12:27:18 +08:00
|
|
|
# -disable-lto Disable link time optimization.
|
2009-10-19 17:18:24 +08:00
|
|
|
# -test-cflags Next argument specifies that C compilation options that
|
|
|
|
# override the default when running the testsuite.
|
|
|
|
# -test-cxxflags Next argument specifies that C++ compilation options that
|
|
|
|
# override the default when running the testsuite.
|
|
|
|
# -extraflags Next argument specifies extra options that are passed to
|
|
|
|
# compile the tests.
|
|
|
|
# -noexternals Do not run the external tests (for cases where povray
|
|
|
|
# or SPEC are not installed)
|
|
|
|
# -with-externals Specify a directory where the external tests are located.
|
|
|
|
#
|
|
|
|
# OTHER OPTIONS:
|
|
|
|
# -parallel Run parallel jobs with GNU Make (see -parallel-jobs).
|
|
|
|
# -parallel-jobs The number of parallel Make jobs to use (default is two).
|
2009-10-19 21:20:56 +08:00
|
|
|
# -parallel-test Allow parallel execution of llvm-test
|
2006-07-07 05:19:32 +08:00
|
|
|
# -verbose Turn on some debug output
|
|
|
|
# -nice Checkout/Configure/Build with "nice" to reduce impact
|
|
|
|
# on busy servers.
|
|
|
|
# -f2c Next argument specifies path to F2C utility
|
|
|
|
# -gccpath Path to gcc/g++ used to build LLVM
|
|
|
|
# -target Specify the target triplet
|
|
|
|
# -cflags Next argument specifies that C compilation options that
|
|
|
|
# override the default.
|
|
|
|
# -cxxflags Next argument specifies that C++ compilation options that
|
|
|
|
# override the default.
|
|
|
|
# -ldflags Next argument specifies that linker options that override
|
|
|
|
# the default.
|
|
|
|
#
|
2009-10-19 17:18:54 +08:00
|
|
|
# CVSROOT is ignored, it is passed for backwards compatibility.
|
2006-07-07 05:19:32 +08:00
|
|
|
# BUILDDIR is the directory where sources for this test run will be checked out
|
|
|
|
# AND objects for this test run will be built. This directory MUST NOT
|
2009-10-19 17:18:54 +08:00
|
|
|
# exist before the script is run; it will be created by the svn checkout
|
2006-07-07 05:19:32 +08:00
|
|
|
# process and erased (unless -noremove is specified; see above.)
|
|
|
|
# WEBDIR is the directory into which the test results web page will be written,
|
|
|
|
# AND in which the "index.html" is assumed to be a symlink to the most recent
|
|
|
|
# copy of the results. This directory will be created if it does not exist.
|
|
|
|
# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
|
|
|
|
# to. This is the same as you would have for a normal LLVM build.
|
|
|
|
#
|
|
|
|
##############################################################
|
|
|
|
#
|
|
|
|
# Getting environment variables
|
|
|
|
#
|
|
|
|
##############################################################
|
2006-08-13 17:53:02 +08:00
|
|
|
my $HOME = $ENV{'HOME'};
|
2007-04-07 12:41:16 +08:00
|
|
|
my $SVNURL = $ENV{"SVNURL"};
|
2009-06-12 21:02:52 +08:00
|
|
|
$SVNURL = 'http://llvm.org/svn/llvm-project' unless $SVNURL;
|
2009-06-19 05:39:50 +08:00
|
|
|
my $TestSVNURL = $ENV{"TestSVNURL"};
|
2009-07-14 14:23:41 +08:00
|
|
|
$TestSVNURL = 'http://llvm.org/svn/llvm-project' unless $TestSVNURL;
|
2006-07-07 05:19:32 +08:00
|
|
|
my $BuildDir = $ENV{'BUILDDIR'};
|
|
|
|
my $WebDir = $ENV{'WEBDIR'};
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
#
|
|
|
|
# Calculate the date prefix...
|
|
|
|
#
|
|
|
|
##############################################################
|
2009-11-06 12:12:13 +08:00
|
|
|
use POSIX;
|
2006-07-07 05:19:32 +08:00
|
|
|
@TIME = localtime;
|
2009-11-06 12:12:13 +08:00
|
|
|
my $DATE = strftime("%Y-%m-%d_%H-%M-%S", localtime());
|
2006-07-07 05:19:32 +08:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
#
|
|
|
|
# Parse arguments...
|
|
|
|
#
|
|
|
|
##############################################################
|
2009-10-19 17:18:24 +08:00
|
|
|
$CONFIG_PATH="";
|
2006-07-07 05:19:32 +08:00
|
|
|
$CONFIGUREARGS="";
|
2006-07-21 09:39:42 +08:00
|
|
|
$nickname="";
|
2006-07-07 05:19:32 +08:00
|
|
|
$NOTEST=0;
|
2006-07-27 09:17:17 +08:00
|
|
|
$MAKECMD="make";
|
2006-08-12 07:02:09 +08:00
|
|
|
$SUBMITSERVER = "llvm.org";
|
2006-09-16 01:03:36 +08:00
|
|
|
$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
|
2009-05-19 07:24:26 +08:00
|
|
|
$SUBMITAUX="";
|
2008-03-10 15:28:08 +08:00
|
|
|
$SUBMIT = 1;
|
2009-05-29 06:45:24 +08:00
|
|
|
$PARALLELJOBS = "2";
|
2009-07-17 06:59:17 +08:00
|
|
|
my $TESTFLAGS="";
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-11-06 12:11:29 +08:00
|
|
|
if ($ENV{'LLVMGCCDIR'}) {
|
|
|
|
$CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
|
|
|
|
$LLVMGCCPATH = $ENV{'LLVMGCCDIR'} . '/bin';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$LLVMGCCPATH = "";
|
|
|
|
}
|
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
|
2006-08-13 17:53:02 +08:00
|
|
|
shift;
|
|
|
|
last if /^--$/; # Stop processing arguments on --
|
2006-07-07 05:19:32 +08:00
|
|
|
|
|
|
|
# List command line options here...
|
2009-10-19 17:18:24 +08:00
|
|
|
if (/^-config$/) { $CONFIG_PATH = "$ARGV[0]"; shift; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
|
2009-11-06 12:12:07 +08:00
|
|
|
if (/^-noclean$/) { $NOCLEAN = 1; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-noremove$/) { $NOREMOVE = 1; next; }
|
2009-07-14 06:17:49 +08:00
|
|
|
if (/^-noremoveatend$/) { $NOREMOVEATEND = 1; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
|
2009-06-03 05:14:15 +08:00
|
|
|
if (/^-notest$/) { $NOTEST = 1; next; }
|
|
|
|
if (/^-norunningtests$/) { next; } # Backward compatibility, ignored.
|
2009-05-29 06:45:24 +08:00
|
|
|
if (/^-parallel-jobs$/) { $PARALLELJOBS = "$ARGV[0]"; shift; next;}
|
2009-10-19 21:20:50 +08:00
|
|
|
if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j$PARALLELJOBS"; next; }
|
2009-10-19 21:20:56 +08:00
|
|
|
if (/^-parallel-test$/) { $PROGTESTOPTS .= " ENABLE_PARALLEL_REPORT=1"; next; }
|
2009-06-12 21:02:52 +08:00
|
|
|
if (/^-with-clang$/) { $WITHCLANG = 1; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
|
2009-10-20 15:30:46 +08:00
|
|
|
"OPTIMIZE_OPTION=-O2"; next;}
|
2006-09-29 01:49:20 +08:00
|
|
|
if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
|
2008-10-30 09:08:03 +08:00
|
|
|
"DISABLE_ASSERTIONS=1 ".
|
2009-10-20 15:30:46 +08:00
|
|
|
"OPTIMIZE_OPTION=-O2"; next;}
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
|
2009-06-12 21:02:52 +08:00
|
|
|
if (/^-disable-pic$/) { $CONFIGUREARGS .= " --enable-pic=no"; next; }
|
2006-11-25 04:34:16 +08:00
|
|
|
if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
|
2009-01-03 00:28:18 +08:00
|
|
|
$CONFIGUREARGS .= " --enable-lli"; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
|
2009-01-03 00:28:18 +08:00
|
|
|
$CONFIGUREARGS .= " --disable-llc_diffs"; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
|
|
|
|
$CONFIGUREARGS .= " --disable-jit"; next; }
|
2009-03-11 03:33:13 +08:00
|
|
|
if (/^-disable-bindings$/) { $CONFIGUREARGS .= " --disable-bindings"; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
|
2008-01-12 12:27:18 +08:00
|
|
|
if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
|
2008-01-15 01:58:03 +08:00
|
|
|
if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-verbose$/) { $VERBOSE = 1; next; }
|
2009-06-26 09:53:05 +08:00
|
|
|
if (/^-teelogs$/) { $TEELOGS = 1; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-nice$/) { $NICE = "nice "; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-07-14 06:31:58 +08:00
|
|
|
if (/^-configure-args$/) { $CONFIGUREARGS .= " $ARGV[0]";
|
|
|
|
shift; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
|
|
|
|
if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
|
2009-05-19 07:24:26 +08:00
|
|
|
if (/^-submit-aux/) { $SUBMITAUX = "$ARGV[0]"; shift; next; }
|
2008-03-10 15:28:08 +08:00
|
|
|
if (/^-nosubmit$/) { $SUBMIT = 0; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
|
|
|
|
if (/^-gccpath/) { $CONFIGUREARGS .=
|
|
|
|
" CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
|
2006-08-13 17:53:02 +08:00
|
|
|
$GCCPATH=$ARGV[0]; shift; next; }
|
|
|
|
else { $GCCPATH=""; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
|
2006-08-13 17:53:02 +08:00
|
|
|
shift; next; }
|
2009-07-17 06:59:17 +08:00
|
|
|
if (/^-test-cflags/) { $TESTFLAGS = "$TESTFLAGS CFLAGS=\'$ARGV[0]\'";
|
|
|
|
shift; next; }
|
|
|
|
if (/^-test-cxxflags/) { $TESTFLAGS = "$TESTFLAGS CXXFLAGS=\'$ARGV[0]\'";
|
|
|
|
shift; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
|
2009-11-06 12:11:29 +08:00
|
|
|
if (/^-llvmgccdir/) { $CONFIGUREARGS .= " --with-llvmgccdir=\'$ARGV[0]\'";
|
|
|
|
$LLVMGCCPATH = $ARGV[0] . '/bin';
|
|
|
|
shift; next;}
|
|
|
|
if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
|
2010-03-16 23:53:02 +08:00
|
|
|
if (/^-nouname$/) { $NOUNAME = 1; next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
|
2009-01-03 00:28:18 +08:00
|
|
|
if (/^-extraflags/) { $CONFIGUREARGS .=
|
2006-08-13 17:53:02 +08:00
|
|
|
" --with-extra-options=\'$ARGV[0]\'"; shift; next;}
|
|
|
|
if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
|
2009-11-08 17:34:14 +08:00
|
|
|
if (/^-nodejagnu$/) { next; }
|
2006-08-13 17:53:02 +08:00
|
|
|
if (/^-nobuild$/) { $NOBUILD = 1; next; }
|
|
|
|
print "Unknown option: $_ : ignoring!\n";
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($CONFIGUREARGS !~ /--disable-jit/) {
|
2006-08-13 17:53:02 +08:00
|
|
|
$CONFIGUREARGS .= " --enable-jit";
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
2009-10-19 17:19:19 +08:00
|
|
|
if (@ARGV != 0 and @ARGV != 3) {
|
|
|
|
die "error: must specify 0 or 3 options!";
|
2006-07-27 09:03:46 +08:00
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
|
|
|
if (@ARGV == 3) {
|
2009-10-19 17:19:19 +08:00
|
|
|
if ($CONFIG_PATH ne "") {
|
|
|
|
die "error: arguments are unsupported in -config mode,";
|
|
|
|
}
|
|
|
|
|
2009-10-19 17:18:54 +08:00
|
|
|
# ARGV[0] used to be the CVS root, ignored for backward compatibility.
|
2006-08-13 17:53:02 +08:00
|
|
|
$BuildDir = $ARGV[1];
|
|
|
|
$WebDir = $ARGV[2];
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
2009-10-20 15:30:54 +08:00
|
|
|
if ($CONFIG_PATH ne "") {
|
|
|
|
$BuildDir = "";
|
|
|
|
$SVNURL = $TestSVNURL = "";
|
|
|
|
if ($WebDir eq "") {
|
|
|
|
die("please specify a web directory");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ($BuildDir eq "" or
|
|
|
|
$WebDir eq "") {
|
|
|
|
die("please specify a build directory, and a web directory");
|
|
|
|
}
|
|
|
|
}
|
2009-01-03 00:28:18 +08:00
|
|
|
|
2006-08-13 17:53:02 +08:00
|
|
|
if ($nickname eq "") {
|
2009-01-03 00:28:18 +08:00
|
|
|
die ("Please invoke NewNightlyTest.pl with command line option " .
|
2006-08-13 17:53:02 +08:00
|
|
|
"\"-nickname <nickname>\"");
|
2006-07-21 06:28:43 +08:00
|
|
|
}
|
|
|
|
|
2009-11-06 12:12:02 +08:00
|
|
|
my $LLVMSrcDir = $ENV{'LLVMSRCDIR'};
|
|
|
|
$LLVMSrcDir = "$BuildDir/llvm" unless $LLVMSrcDir;
|
|
|
|
my $LLVMObjDir = $ENV{'LLVMOBJDIR'};
|
|
|
|
$LLVMObjDir = "$BuildDir/llvm" unless $LLVMObjDir;
|
|
|
|
my $LLVMTestDir = $ENV{'LLVMTESTDIR'};
|
|
|
|
$LLVMTestDir = "$BuildDir/llvm/projects/llvm-test" unless $LLVMTestDir;
|
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
##############################################################
|
|
|
|
#
|
2009-10-19 17:18:24 +08:00
|
|
|
# Define the file names we'll use
|
2006-07-07 05:19:32 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
2009-10-20 15:30:54 +08:00
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
my $Prefix = "$WebDir/$DATE";
|
|
|
|
my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
|
|
|
|
my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
|
2006-07-24 06:57:28 +08:00
|
|
|
my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-20 15:30:54 +08:00
|
|
|
# These are only valid in non-config mode.
|
|
|
|
my $ConfigureLog = "", $BuildLog = "", $COLog = "";
|
|
|
|
my $DejagnuLog = "", $DejagnuSum = "", $DejagnuLog = "";
|
|
|
|
|
|
|
|
# Are we in config mode?
|
|
|
|
my $ConfigMode = 0;
|
2006-07-07 05:19:32 +08:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
#
|
|
|
|
# Helper functions
|
|
|
|
#
|
|
|
|
##############################################################
|
2009-10-19 17:18:24 +08:00
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
sub GetDir {
|
2006-08-13 17:53:02 +08:00
|
|
|
my $Suffix = shift;
|
|
|
|
opendir DH, $WebDir;
|
|
|
|
my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
|
|
|
|
closedir DH;
|
|
|
|
return @Result;
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
2009-06-26 09:53:05 +08:00
|
|
|
sub RunLoggedCommand {
|
|
|
|
my $Command = shift;
|
|
|
|
my $Log = shift;
|
2009-06-26 10:30:49 +08:00
|
|
|
my $Title = shift;
|
2009-06-26 09:53:05 +08:00
|
|
|
if ($TEELOGS) {
|
2009-06-26 10:30:49 +08:00
|
|
|
if ($VERBOSE) {
|
|
|
|
print "$Title\n";
|
|
|
|
print "$Command 2>&1 | tee $Log\n";
|
|
|
|
}
|
2009-06-26 09:53:05 +08:00
|
|
|
system "$Command 2>&1 | tee $Log";
|
|
|
|
} else {
|
2009-06-26 10:30:49 +08:00
|
|
|
if ($VERBOSE) {
|
|
|
|
print "$Title\n";
|
2009-12-15 08:41:47 +08:00
|
|
|
print "$Command > $Log 2>&1\n";
|
2009-06-26 10:30:49 +08:00
|
|
|
}
|
2009-12-15 08:41:47 +08:00
|
|
|
system "$Command > $Log 2>&1";
|
2009-06-26 09:53:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub RunAppendingLoggedCommand {
|
|
|
|
my $Command = shift;
|
|
|
|
my $Log = shift;
|
2009-06-26 10:30:49 +08:00
|
|
|
my $Title = shift;
|
2009-06-26 09:53:05 +08:00
|
|
|
if ($TEELOGS) {
|
2009-06-26 10:30:49 +08:00
|
|
|
if ($VERBOSE) {
|
|
|
|
print "$Title\n";
|
|
|
|
print "$Command 2>&1 | tee -a $Log\n";
|
|
|
|
}
|
2009-06-26 09:53:05 +08:00
|
|
|
system "$Command 2>&1 | tee -a $Log";
|
|
|
|
} else {
|
2009-06-26 10:30:49 +08:00
|
|
|
if ($VERBOSE) {
|
|
|
|
print "$Title\n";
|
2009-12-15 08:41:47 +08:00
|
|
|
print "$Command >> $Log 2>&1\n";
|
2009-06-26 10:30:49 +08:00
|
|
|
}
|
2009-12-15 08:41:47 +08:00
|
|
|
system "$Command >> $Log 2>&1";
|
2009-06-26 09:53:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
sub GetRegex { # (Regex with ()'s, value)
|
2009-10-19 21:20:19 +08:00
|
|
|
if ($_[1] =~ /$_[0]/m) {
|
|
|
|
return $1;
|
|
|
|
}
|
2006-08-13 17:53:02 +08:00
|
|
|
return "0";
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub ChangeDir { # directory, logical name
|
2006-08-13 17:53:02 +08:00
|
|
|
my ($dir,$name) = @_;
|
|
|
|
chomp($dir);
|
|
|
|
if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
|
|
|
|
$result = chdir($dir);
|
|
|
|
if (!$result) {
|
2009-10-19 21:20:50 +08:00
|
|
|
print "ERROR!!! Cannot change directory to: $name ($dir) because $!\n";
|
2006-08-13 17:53:02 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub ReadFile {
|
2006-08-13 17:53:02 +08:00
|
|
|
if (open (FILE, $_[0])) {
|
|
|
|
undef $/;
|
|
|
|
my $Ret = <FILE>;
|
|
|
|
close FILE;
|
|
|
|
$/ = '\n';
|
|
|
|
return $Ret;
|
|
|
|
} else {
|
|
|
|
print "Could not open file '$_[0]' for reading!\n";
|
|
|
|
return "";
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub WriteFile { # (filename, contents)
|
2006-08-13 17:53:02 +08:00
|
|
|
open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
|
|
|
|
print FILE $_[1];
|
|
|
|
close FILE;
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub CopyFile { #filename, newfile
|
2006-08-13 17:53:02 +08:00
|
|
|
my ($file, $newfile) = @_;
|
|
|
|
chomp($file);
|
|
|
|
if ($VERBOSE) { print "Copying $file to $newfile\n"; }
|
|
|
|
copy($file, $newfile);
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#
|
|
|
|
# This function acts as a mini web browswer submitting data
|
|
|
|
# to our central server via the post method
|
|
|
|
#
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2009-12-15 01:58:27 +08:00
|
|
|
sub WriteSentData {
|
|
|
|
$variables = $_[0];
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-05-29 02:31:40 +08:00
|
|
|
# Write out the "...-sentdata.txt" file.
|
|
|
|
|
|
|
|
my $sentdata="";
|
|
|
|
foreach $x (keys (%$variables)){
|
|
|
|
$value = $variables->{$x};
|
|
|
|
$sentdata.= "$x => $value\n";
|
|
|
|
}
|
|
|
|
WriteFile "$Prefix-sentdata.txt", $sentdata;
|
2009-12-15 01:58:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
sub SendData {
|
|
|
|
$host = $_[0];
|
|
|
|
$file = $_[1];
|
|
|
|
$variables = $_[2];
|
2009-05-29 02:31:40 +08:00
|
|
|
|
|
|
|
if (!($SUBMITAUX eq "")) {
|
2009-06-27 06:33:28 +08:00
|
|
|
system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
|
|
|
|
}
|
|
|
|
|
2009-10-19 17:18:24 +08:00
|
|
|
if (!$SUBMIT) {
|
2009-06-27 06:33:28 +08:00
|
|
|
return "Skipped standard submit.\n";
|
2009-05-29 02:31:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Create the content to send to the server.
|
2006-07-07 05:19:32 +08:00
|
|
|
|
|
|
|
my $content;
|
|
|
|
foreach $key (keys (%$variables)){
|
|
|
|
$value = $variables->{$key};
|
|
|
|
$value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
|
|
|
|
$content .= "$key=$value&";
|
|
|
|
}
|
|
|
|
|
2009-05-29 02:31:40 +08:00
|
|
|
# Send the data to the server.
|
2009-10-19 17:18:24 +08:00
|
|
|
#
|
2009-05-29 02:31:40 +08:00
|
|
|
# FIXME: This code should be more robust?
|
2009-10-19 17:18:24 +08:00
|
|
|
|
2009-05-29 02:31:40 +08:00
|
|
|
$port=80;
|
|
|
|
$socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
|
|
|
|
socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
|
|
|
|
die "Bad socket\n";
|
|
|
|
connect SOCK, $socketaddr or die "Bad connection\n";
|
|
|
|
select((select(SOCK), $| = 1)[0]);
|
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
$length = length($content);
|
|
|
|
|
|
|
|
my $send= "POST $file HTTP/1.0\n";
|
2007-05-03 22:05:07 +08:00
|
|
|
$send.= "Host: $host\n";
|
2006-07-07 05:19:32 +08:00
|
|
|
$send.= "Content-Type: application/x-www-form-urlencoded\n";
|
|
|
|
$send.= "Content-length: $length\n\n";
|
|
|
|
$send.= "$content";
|
|
|
|
|
2006-08-07 09:54:37 +08:00
|
|
|
print SOCK $send;
|
2006-07-07 05:19:32 +08:00
|
|
|
my $result;
|
|
|
|
while(<SOCK>){
|
|
|
|
$result .= $_;
|
|
|
|
}
|
|
|
|
close(SOCK);
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
2006-07-08 02:50:51 +08:00
|
|
|
##############################################################
|
|
|
|
#
|
2009-10-19 21:20:31 +08:00
|
|
|
# Individual Build & Test Functions
|
2006-07-08 02:50:51 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:31 +08:00
|
|
|
# Create the source repository directory.
|
2009-10-19 21:20:06 +08:00
|
|
|
sub CheckoutSource {
|
2009-10-20 15:30:54 +08:00
|
|
|
die "Invalid call!" unless $ConfigMode == 0;
|
2009-10-19 21:20:38 +08:00
|
|
|
if (-d $BuildDir) {
|
|
|
|
if (!$NOREMOVE) {
|
|
|
|
if ( $VERBOSE ) {
|
|
|
|
print "Build directory exists! Removing it\n";
|
2006-08-13 17:53:02 +08:00
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
system "rm -rf $BuildDir";
|
2009-10-19 21:20:06 +08:00
|
|
|
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
2009-10-19 21:20:38 +08:00
|
|
|
} else {
|
|
|
|
if ( $VERBOSE ) {
|
|
|
|
print "Build directory exists!\n";
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
} else {
|
|
|
|
mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
ChangeDir( $BuildDir, "checkout directory" );
|
|
|
|
my $SVNCMD = "$NICE svn co --non-interactive";
|
|
|
|
RunLoggedCommand("( time -p $SVNCMD $SVNURL/llvm/trunk llvm; cd llvm/projects ; " .
|
|
|
|
" $SVNCMD $TestSVNURL/test-suite/trunk llvm-test )", $COLog,
|
|
|
|
"CHECKOUT LLVM");
|
|
|
|
if ($WITHCLANG) {
|
|
|
|
RunLoggedCommand("( cd llvm/tools ; " .
|
|
|
|
" $SVNCMD $SVNURL/cfe/trunk clang )", $COLog,
|
|
|
|
"CHECKOUT CLANG");
|
2007-04-07 12:41:16 +08:00
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
# Build the entire tree, saving build messages to the build log. Returns false
|
|
|
|
# on build failure.
|
2009-10-19 21:20:13 +08:00
|
|
|
sub BuildLLVM {
|
2009-10-20 15:30:54 +08:00
|
|
|
die "Invalid call!" unless $ConfigMode == 0;
|
2009-10-19 21:20:38 +08:00
|
|
|
my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
|
|
|
|
RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
|
|
|
|
$ConfigureLog, "CONFIGURE");
|
|
|
|
# Build the entire tree, capturing the output into $BuildLog
|
2009-11-06 12:12:07 +08:00
|
|
|
if (!$NOCLEAN) {
|
|
|
|
RunAppendingLoggedCommand("($NICE $MAKECMD $MAKEOPTS clean)", $BuildLog, "BUILD CLEAN");
|
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
|
|
|
|
|
2009-12-15 01:58:33 +08:00
|
|
|
if (`grep -a '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
|
|
|
|
`grep -a '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l` + 0) {
|
2009-10-19 21:20:38 +08:00
|
|
|
return 0;
|
2009-10-19 21:20:13 +08:00
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
return 1;
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
2009-10-19 21:20:13 +08:00
|
|
|
|
2009-10-19 21:20:31 +08:00
|
|
|
# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
|
2006-07-07 05:19:32 +08:00
|
|
|
sub TestDirectory {
|
2009-01-03 00:28:18 +08:00
|
|
|
my $SubDir = shift;
|
2009-06-26 09:53:05 +08:00
|
|
|
ChangeDir( "$LLVMTestDir/$SubDir",
|
2006-08-13 17:53:02 +08:00
|
|
|
"Programs Test Subdirectory" ) || return ("", "");
|
2009-01-03 00:28:18 +08:00
|
|
|
|
2006-08-13 17:53:02 +08:00
|
|
|
my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
|
2009-01-03 00:28:18 +08:00
|
|
|
|
2009-11-06 12:12:07 +08:00
|
|
|
# Make sure to clean the test results.
|
|
|
|
RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS clean $TESTFLAGS",
|
|
|
|
$ProgramTestLog, "TEST DIRECTORY $SubDir");
|
2009-10-20 15:30:54 +08:00
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
# Run the programs tests... creating a report.nightly.csv file.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $LLCBetaOpts = "";
|
2009-10-19 21:20:38 +08:00
|
|
|
RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
|
|
|
|
"$TESTFLAGS TEST=nightly",
|
|
|
|
$ProgramTestLog, "TEST DIRECTORY $SubDir");
|
|
|
|
$LLCBetaOpts = `$MAKECMD print-llcbeta-option`;
|
2006-08-13 17:53:02 +08:00
|
|
|
|
2006-07-28 02:28:50 +08:00
|
|
|
my $ProgramsTable;
|
2009-12-15 01:58:33 +08:00
|
|
|
if (`grep -a '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
|
2006-07-28 02:28:50 +08:00
|
|
|
$ProgramsTable="Error running test $SubDir\n";
|
|
|
|
print "ERROR TESTING\n";
|
2009-12-15 01:58:33 +08:00
|
|
|
} elsif (`grep -a '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
|
2006-07-28 02:28:50 +08:00
|
|
|
$ProgramsTable="Makefile error running tests $SubDir!\n";
|
|
|
|
print "ERROR TESTING\n";
|
|
|
|
} else {
|
2009-10-19 21:20:38 +08:00
|
|
|
# Create a list of the tests which were run...
|
2009-12-15 01:58:33 +08:00
|
|
|
system "egrep -a 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
|
2009-10-19 21:20:38 +08:00
|
|
|
"| sort > $Prefix-$SubDir-Tests.txt";
|
2006-07-28 02:28:50 +08:00
|
|
|
}
|
|
|
|
$ProgramsTable = ReadFile "report.nightly.csv";
|
|
|
|
|
|
|
|
ChangeDir( "../../..", "Programs Test Parent Directory" );
|
2009-10-19 21:20:19 +08:00
|
|
|
return ($ProgramsTable, $LLCBetaOpts);
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:44 +08:00
|
|
|
# Run all the nightly tests and return the program tables and the list of tests,
|
2009-10-19 21:20:31 +08:00
|
|
|
# passes, fails, and xfails.
|
2009-10-19 21:20:25 +08:00
|
|
|
sub RunNightlyTest() {
|
2009-10-19 21:20:38 +08:00
|
|
|
($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
|
|
|
|
WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
|
|
|
|
($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
|
|
|
|
WriteFile "$Prefix-MultiSource-Performance.txt", $MSProgs;
|
|
|
|
if ( ! $NOEXTERNALS ) {
|
|
|
|
($ExtProgs, $llcbeta_options) = TestDirectory("External");
|
|
|
|
WriteFile "$Prefix-External-Performance.txt", $ExtProgs;
|
|
|
|
system "cat $Prefix-SingleSource-Tests.txt " .
|
|
|
|
"$Prefix-MultiSource-Tests.txt ".
|
|
|
|
"$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
|
|
|
|
system "cat $Prefix-SingleSource-Performance.txt " .
|
|
|
|
"$Prefix-MultiSource-Performance.txt ".
|
|
|
|
"$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
|
|
|
|
} else {
|
|
|
|
$ExtProgs = "External TEST STAGE SKIPPED\n";
|
|
|
|
if ( $VERBOSE ) {
|
|
|
|
print "External TEST STAGE SKIPPED\n";
|
2006-08-13 17:53:02 +08:00
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
system "cat $Prefix-SingleSource-Tests.txt " .
|
|
|
|
"$Prefix-MultiSource-Tests.txt ".
|
|
|
|
" | sort > $Prefix-Tests.txt";
|
|
|
|
system "cat $Prefix-SingleSource-Performance.txt " .
|
|
|
|
"$Prefix-MultiSource-Performance.txt ".
|
|
|
|
" | sort > $Prefix-Performance.txt";
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
# Compile passes, fails, xfails.
|
2009-10-19 21:20:44 +08:00
|
|
|
my $All = (ReadFile "$Prefix-Tests.txt");
|
|
|
|
my @TestSuiteResultLines = split "\n", $All;
|
2009-10-19 21:20:38 +08:00
|
|
|
my ($Passes, $Fails, $XFails) = "";
|
2006-08-23 02:11:19 +08:00
|
|
|
|
2009-10-19 21:20:38 +08:00
|
|
|
for ($x=0; $x < @TestSuiteResultLines; $x++) {
|
|
|
|
if (@TestSuiteResultLines[$x] =~ m/^PASS:/) {
|
|
|
|
$Passes .= "$TestSuiteResultLines[$x]\n";
|
|
|
|
}
|
|
|
|
elsif (@TestSuiteResultLines[$x] =~ m/^FAIL:/) {
|
|
|
|
$Fails .= "$TestSuiteResultLines[$x]\n";
|
|
|
|
}
|
|
|
|
elsif (@TestSuiteResultLines[$x] =~ m/^XFAIL:/) {
|
|
|
|
$XFails .= "$TestSuiteResultLines[$x]\n";
|
2006-08-13 17:53:02 +08:00
|
|
|
}
|
|
|
|
}
|
2009-10-19 21:20:25 +08:00
|
|
|
|
2009-10-19 21:20:44 +08:00
|
|
|
return ($SSProgs, $MSProgs, $ExtProgs, $All, $Passes, $Fails, $XFails);
|
2009-10-19 21:20:19 +08:00
|
|
|
}
|
2006-08-23 02:11:19 +08:00
|
|
|
|
2006-07-08 02:50:51 +08:00
|
|
|
##############################################################
|
|
|
|
#
|
2009-10-20 15:30:54 +08:00
|
|
|
# Initialize filenames
|
2006-07-08 02:50:51 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
|
|
|
|
2009-10-20 15:30:54 +08:00
|
|
|
if (! -d $WebDir) {
|
|
|
|
mkdir $WebDir, 0777 or die "Unable to create web directory: '$WebDir'.";
|
|
|
|
if($VERBOSE){
|
|
|
|
warn "$WebDir did not exist; creating it.\n";
|
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
}
|
|
|
|
|
2009-10-20 15:30:54 +08:00
|
|
|
if ($CONFIG_PATH ne "") {
|
|
|
|
$ConfigMode = 1;
|
|
|
|
$LLVMSrcDir = GetRegex "^(.*)\\s+", `$CONFIG_PATH --src-root`;
|
|
|
|
$LLVMObjDir = GetRegex "^(.*)\\s+", `$CONFIG_PATH --obj-root`;
|
|
|
|
# FIXME: Add llvm-config hook for this?
|
|
|
|
$LLVMTestDir = $LLVMObjDir . "/projects/test-suite";
|
2009-10-19 21:20:38 +08:00
|
|
|
} else {
|
2009-10-20 15:30:54 +08:00
|
|
|
$ConfigureLog = "$Prefix-Configure-Log.txt";
|
|
|
|
$BuildLog = "$Prefix-Build-Log.txt";
|
|
|
|
$COLog = "$Prefix-CVS-Log.txt";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($VERBOSE) {
|
|
|
|
if ($CONFIG_PATH ne "") {
|
|
|
|
print "INITIALIZED (config mode)\n";
|
|
|
|
print "WebDir = $WebDir\n";
|
|
|
|
print "Prefix = $Prefix\n";
|
|
|
|
print "LLVM Src = $LLVMSrcDir\n";
|
|
|
|
print "LLVM Obj = $LLVMObjDir\n";
|
|
|
|
print "LLVM Test = $LLVMTestDir\n";
|
|
|
|
} else {
|
|
|
|
print "INITIALIZED\n";
|
|
|
|
print "SVN URL = $SVNURL\n";
|
|
|
|
print "COLog = $COLog\n";
|
|
|
|
print "BuildDir = $BuildDir\n";
|
|
|
|
print "WebDir = $WebDir\n";
|
|
|
|
print "Prefix = $Prefix\n";
|
|
|
|
print "BuildLog = $BuildLog\n";
|
2009-10-19 21:20:38 +08:00
|
|
|
}
|
2009-10-19 21:20:31 +08:00
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
|
2009-10-20 15:30:54 +08:00
|
|
|
##############################################################
|
|
|
|
#
|
|
|
|
# The actual NewNightlyTest logic.
|
|
|
|
#
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
|
|
|
|
|
|
|
|
my $BuildError = 0, $BuildStatus = "OK";
|
|
|
|
if ($ConfigMode == 0) {
|
|
|
|
if (!$NOCHECKOUT) {
|
|
|
|
CheckoutSource();
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build LLVM.
|
|
|
|
ChangeDir( $LLVMSrcDir , "llvm source directory") ;
|
|
|
|
if ($NOCHECKOUT || $NOBUILD) {
|
|
|
|
$BuildStatus = "Skipped by user";
|
|
|
|
} else {
|
|
|
|
if (!BuildLLVM()) {
|
|
|
|
if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
|
|
|
|
$BuildError = 1;
|
|
|
|
$BuildStatus = "Error: compilation aborted";
|
|
|
|
}
|
|
|
|
}
|
2009-10-19 21:20:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Run the llvm-test tests.
|
2009-10-19 21:20:31 +08:00
|
|
|
my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
2009-10-19 21:20:44 +08:00
|
|
|
$all_tests, $passes, $fails, $xfails) = "";
|
2009-10-19 21:20:38 +08:00
|
|
|
if (!$NOTEST && !$BuildError) {
|
|
|
|
($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
|
2009-10-19 21:20:44 +08:00
|
|
|
$all_tests, $passes, $fails, $xfails) = RunNightlyTest();
|
2009-10-19 21:20:38 +08:00
|
|
|
}
|
2009-10-19 21:20:31 +08:00
|
|
|
|
|
|
|
$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:50 +08:00
|
|
|
# The last bit of logic is to remove the build and web dirs, after sending data
|
|
|
|
# to the server.
|
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
##############################################################
|
|
|
|
#
|
2009-10-19 21:20:31 +08:00
|
|
|
# Accumulate the information to send to the server.
|
2006-07-07 05:19:32 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
2009-10-19 21:20:31 +08:00
|
|
|
|
2006-07-07 05:19:32 +08:00
|
|
|
if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
|
|
|
|
|
2010-03-16 23:53:02 +08:00
|
|
|
if ( ! $NOUNAME ) {
|
|
|
|
$machine_data = "uname: ".`uname -a`.
|
|
|
|
"hardware: ".`uname -m`.
|
|
|
|
"os: ".`uname -sr`.
|
|
|
|
"name: ".`uname -n`.
|
|
|
|
"date: ".`date \"+20%y-%m-%d\"`.
|
|
|
|
"time: ".`date +\"%H:%M:%S\"`;
|
|
|
|
} else {
|
|
|
|
$machine_data = "uname: (excluded)\n".
|
|
|
|
"hardware: ".`uname -m`.
|
|
|
|
"os: ".`uname -sr`.
|
|
|
|
"name: $nickname\n".
|
|
|
|
"date: ".`date \"+20%y-%m-%d\"`.
|
|
|
|
"time: ".`date +\"%H:%M:%S\"`;
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:31 +08:00
|
|
|
# Get gcc version.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $gcc_version_long = "";
|
2006-08-23 02:11:19 +08:00
|
|
|
if ($GCCPATH ne "") {
|
2009-10-19 21:20:19 +08:00
|
|
|
$gcc_version_long = `$GCCPATH/gcc --version`;
|
2007-04-11 03:13:43 +08:00
|
|
|
} elsif ($ENV{"CC"}) {
|
2009-10-19 21:20:19 +08:00
|
|
|
$gcc_version_long = `$ENV{"CC"} --version`;
|
2006-08-23 02:11:19 +08:00
|
|
|
} else {
|
2009-10-19 21:20:19 +08:00
|
|
|
$gcc_version_long = `gcc --version`;
|
2006-08-23 02:11:19 +08:00
|
|
|
}
|
2009-10-19 21:20:19 +08:00
|
|
|
my $gcc_version = (split '\n', $gcc_version_long)[0];
|
2006-08-23 02:11:19 +08:00
|
|
|
|
2009-10-19 21:20:31 +08:00
|
|
|
# Get llvm-gcc target triple.
|
2009-11-06 12:11:29 +08:00
|
|
|
#
|
|
|
|
# FIXME: This shouldn't be hardwired to llvm-gcc.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $llvmgcc_version_long = "";
|
2007-04-13 12:36:48 +08:00
|
|
|
if ($LLVMGCCPATH ne "") {
|
|
|
|
$llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
|
|
|
|
} else {
|
|
|
|
$llvmgcc_version_long = `llvm-gcc -v 2>&1`;
|
|
|
|
}
|
2009-10-19 21:20:19 +08:00
|
|
|
(split '\n', $llvmgcc_version_long)[1] =~ /Target: (.+)/;
|
|
|
|
my $targetTriple = $1;
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-10-19 21:20:19 +08:00
|
|
|
# Logs.
|
2009-11-08 17:34:14 +08:00
|
|
|
my ($ConfigureLogData, $BuildLogData, $CheckoutLogData) = "";
|
2009-10-20 15:30:54 +08:00
|
|
|
if ($ConfigMode == 0) {
|
|
|
|
$ConfigureLogData = ReadFile $ConfigureLog;
|
|
|
|
$BuildLogData = ReadFile $BuildLog;
|
|
|
|
$CheckoutLogData = ReadFile $COLog;
|
|
|
|
}
|
2009-10-19 21:20:19 +08:00
|
|
|
|
2009-10-19 21:20:13 +08:00
|
|
|
# Checkout info.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $CheckoutTime_Wall = GetRegex "^real ([0-9.]+)", $CheckoutLogData;
|
|
|
|
my $CheckoutTime_User = GetRegex "^user ([0-9.]+)", $CheckoutLogData;
|
|
|
|
my $CheckoutTime_Sys = GetRegex "^sys ([0-9.]+)", $CheckoutLogData;
|
2009-10-19 21:20:06 +08:00
|
|
|
my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
|
|
|
|
|
2009-10-19 21:20:13 +08:00
|
|
|
# Configure info.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $ConfigTimeU = GetRegex "^user ([0-9.]+)", $ConfigureLogData;
|
|
|
|
my $ConfigTimeS = GetRegex "^sys ([0-9.]+)", $ConfigureLogData;
|
2009-10-19 21:20:13 +08:00
|
|
|
my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
|
2009-10-19 21:20:19 +08:00
|
|
|
my $ConfigWallTime = GetRegex "^real ([0-9.]+)",$ConfigureLogData;
|
2009-10-19 21:20:13 +08:00
|
|
|
$ConfigTime=-1 unless $ConfigTime;
|
|
|
|
$ConfigWallTime=-1 unless $ConfigWallTime;
|
|
|
|
|
|
|
|
# Build info.
|
2009-10-19 21:20:19 +08:00
|
|
|
my $BuildTimeU = GetRegex "^user ([0-9.]+)", $BuildLogData;
|
|
|
|
my $BuildTimeS = GetRegex "^sys ([0-9.]+)", $BuildLogData;
|
2009-10-19 21:20:13 +08:00
|
|
|
my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
|
2009-10-19 21:20:19 +08:00
|
|
|
my $BuildWallTime = GetRegex "^real ([0-9.]+)", $BuildLogData;
|
2009-10-19 21:20:13 +08:00
|
|
|
$BuildTime=-1 unless $BuildTime;
|
|
|
|
$BuildWallTime=-1 unless $BuildWallTime;
|
|
|
|
|
2009-10-19 21:20:50 +08:00
|
|
|
if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
|
|
|
|
|
2006-08-13 17:53:02 +08:00
|
|
|
my %hash_of_data = (
|
|
|
|
'machine_data' => $machine_data,
|
2009-10-19 21:20:19 +08:00
|
|
|
'build_data' => $ConfigureLogData . $BuildLogData,
|
2006-08-13 17:53:02 +08:00
|
|
|
'gcc_version' => $gcc_version,
|
|
|
|
'nickname' => $nickname,
|
2009-11-08 17:34:14 +08:00
|
|
|
'dejagnutime_wall' => "0.0",
|
|
|
|
'dejagnutime_cpu' => "0.0",
|
2007-04-07 12:41:16 +08:00
|
|
|
'cvscheckouttime_wall' => $CheckoutTime_Wall,
|
|
|
|
'cvscheckouttime_cpu' => $CheckoutTime_CPU,
|
2006-08-13 17:53:02 +08:00
|
|
|
'configtime_wall' => $ConfigWallTime,
|
|
|
|
'configtime_cpu'=> $ConfigTime,
|
|
|
|
'buildtime_wall' => $BuildWallTime,
|
|
|
|
'buildtime_cpu' => $BuildTime,
|
|
|
|
'buildstatus' => $BuildStatus,
|
|
|
|
'singlesource_programstable' => $SingleSourceProgramsTable,
|
|
|
|
'multisource_programstable' => $MultiSourceProgramsTable,
|
|
|
|
'externalsource_programstable' => $ExternalProgramsTable,
|
2009-10-19 21:20:19 +08:00
|
|
|
'llcbeta_options' => $llcbeta_options,
|
2006-08-13 17:53:02 +08:00
|
|
|
'passing_tests' => $passes,
|
|
|
|
'expfail_tests' => $xfails,
|
|
|
|
'unexpfail_tests' => $fails,
|
2009-10-19 21:20:44 +08:00
|
|
|
'all_tests' => $all_tests,
|
2009-11-08 17:34:14 +08:00
|
|
|
'dejagnutests_results' => "Dejagnu skipped by user choice.",
|
|
|
|
'dejagnutests_log' => "",
|
2006-08-13 17:53:02 +08:00
|
|
|
'starttime' => $starttime,
|
|
|
|
'endtime' => $endtime,
|
2009-10-19 21:20:50 +08:00
|
|
|
'target_triple' => $targetTriple,
|
|
|
|
|
2011-04-15 13:18:47 +08:00
|
|
|
# Unused, but left around for backwards compatibility.
|
2009-10-19 21:20:50 +08:00
|
|
|
'warnings' => "",
|
|
|
|
'cvsusercommitlist' => "",
|
|
|
|
'cvsuserupdatelist' => "",
|
|
|
|
'cvsaddedfiles' => "",
|
|
|
|
'cvsmodifiedfiles' => "",
|
|
|
|
'cvsremovedfiles' => "",
|
|
|
|
'lines_of_code' => "",
|
|
|
|
'cvs_file_count' => 0,
|
|
|
|
'cvs_dir_count' => 0,
|
|
|
|
'warnings_removed' => "",
|
|
|
|
'warnings_added' => "",
|
|
|
|
'new_tests' => "",
|
|
|
|
'removed_tests' => "",
|
2009-10-19 21:20:00 +08:00
|
|
|
'o_file_sizes' => "",
|
2009-10-19 21:20:50 +08:00
|
|
|
'a_file_sizes' => ""
|
2006-08-13 17:53:02 +08:00
|
|
|
);
|
2006-07-07 05:19:32 +08:00
|
|
|
|
2009-12-15 01:58:27 +08:00
|
|
|
# Write out the "...-sentdata.txt" file.
|
|
|
|
WriteSentData \%hash_of_data;
|
|
|
|
|
2009-06-27 06:33:28 +08:00
|
|
|
if ($SUBMIT || !($SUBMITAUX eq "")) {
|
2008-03-10 15:28:08 +08:00
|
|
|
my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
|
|
|
|
if( $VERBOSE) { print "============================\n$response"; }
|
|
|
|
} else {
|
2006-08-13 17:53:02 +08:00
|
|
|
print "============================\n";
|
|
|
|
foreach $x(keys %hash_of_data){
|
|
|
|
print "$x => $hash_of_data{$x}\n";
|
|
|
|
}
|
2006-07-07 05:19:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
#
|
2009-10-19 17:18:54 +08:00
|
|
|
# Remove the source tree...
|
2006-07-07 05:19:32 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
2009-01-03 00:28:18 +08:00
|
|
|
system ( "$NICE rm -rf $BuildDir")
|
2009-07-14 06:17:49 +08:00
|
|
|
if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVEATEND);
|
2009-01-03 00:28:18 +08:00
|
|
|
system ( "$NICE rm -rf $WebDir")
|
2006-08-13 17:53:02 +08:00
|
|
|
if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);
|