#!/usr/bin/perl
use POSIX qw(strftime);
use File::Copy;
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
# regressions and performance changes. Submits this information
# to llvm.org where it is placed into the nightlytestresults database.
#
# Modified heavily by Patrick Jenkins, July 2006
#
# Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
# where
# OPTIONS may include one or more of the following:
# -nocheckout Do not create, checkout, update, or configure
# the source tree.
# -noremove Do not remove the BUILDDIR after it has been built.
# -noremoveresults Do not remove the WEBDIR after it has been built.
# -nobuild Do not build llvm. If tests are enabled perform them
# on the llvm build specified in the build directory
# -notest Do not even attempt to run the test programs. Implies
# -norunningtests.
# -norunningtests Do not run the Olden benchmark suite with
# LARGE_PROBLEM_SIZE enabled.
# -nodejagnu Do not run feature or regression tests
# -parallel Run two parallel jobs with GNU Make.
# -release Build an LLVM Release version
# -release-asserts Build an LLVM ReleaseAsserts version
# -enable-llcbeta Enable testing of beta features in llc.
# -enable-lli Enable testing of lli (interpreter) features, default is off
# -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.
# -verbose Turn on some debug output
# -debug Print information useful only to maintainers of this script.
# -nice Checkout/Configure/Build with "nice" to reduce impact
# on busy servers.
# -f2c Next argument specifies path to F2C utility
# -nickname The next argument specifieds the nickname this script
# will submit to the nightlytest results repository.
# -gccpath Path to gcc/g++ used to build LLVM
# -cvstag Check out a specific CVS tag to build LLVM (useful for
# testing release branches)
# -usesvn Check code out from a subversion repository. With no
# argument, use the standard repository. An argument specifies
# the repository URL to use.
# -svnurl Specify the SVN URL where LLVM can be found
# -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.
# -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.
#
# ---------------- Options to configure llvm-test ----------------------------
# -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.
# -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.
#
# CVSROOT is the CVS repository from which the tree will be checked out,
# specified either in the full :method:user@host:/dir syntax, or
# just /dir if using a local repo.
# 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
# exist before the script is run; it will be created by the cvs checkout
# 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
#
##############################################################
my $HOME = $ENV{'HOME'};
my $SVNURL = $ENV{"SVNURL"};
$SVNURL = 'svn://anon@hlvm.org:3691/llvm.svn' unless $SVNURL;
my $CVSRootDir = $ENV{'CVSROOT'};
$CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
my $BuildDir = $ENV{'BUILDDIR'};
$BuildDir = "$HOME/buildtest" unless $BuildDir;
my $WebDir = $ENV{'WEBDIR'};
$WebDir = "$HOME/cvs/testresults-X86" unless $WebDir;
##############################################################
#
# Calculate the date prefix...
#
##############################################################
@TIME = localtime;
my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
my $DateString = strftime "%B %d, %Y", localtime;
my $TestStartTime = gmtime() . "GMT<br>" . localtime() . " (local)";
##############################################################
#
# Parse arguments...
#
##############################################################
$CONFIGUREARGS="";
$nickname="";
$NOTEST=0;
$USESVN=0;
$NORUNNINGTESTS=0;
$MAKECMD="make";
$SUBMITSERVER = "llvm.org";
$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
shift;
last if /^--$/; # Stop processing arguments on --
# List command line options here...
if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
if (/^-nocvsstats$/) { $NOCVSSTATS = 1; next; }
if (/^-noremove$/) { $NOREMOVE = 1;