Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl |
| 2 | use POSIX qw(strftime); |
| 3 | use File::Copy; |
Bob Wilson | 722d58b | 2009-06-19 17:19:38 +0000 | [diff] [blame] | 4 | use File::Find; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 5 | use Socket; |
| 6 | |
| 7 | # |
| 8 | # Program: NewNightlyTest.pl |
| 9 | # |
| 10 | # Synopsis: Perform a series of tests which are designed to be run nightly. |
| 11 | # This is used to keep track of the status of the LLVM tree, tracking |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 12 | # regressions and performance changes. Submits this information |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 13 | # to llvm.org where it is placed into the nightlytestresults database. |
| 14 | # |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 15 | # Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR] |
| 16 | # where |
| 17 | # OPTIONS may include one or more of the following: |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 18 | # |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 19 | # MAIN OPTIONS: |
| 20 | # -config LLVMPATH If specified, use an existing LLVM build and only run and |
| 21 | # report the test information. The LLVMCONFIG argument should |
| 22 | # be the path to the llvm-config executable in the LLVM build. |
| 23 | # This should be the first argument if given. NOT YET |
| 24 | # IMPLEMENTED. |
| 25 | # -nickname NAME The NAME argument specifieds the nickname this script |
| 26 | # will submit to the nightlytest results repository. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 27 | # -submit-server Specifies a server to submit the test results too. If this |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 28 | # option is not specified it defaults to |
| 29 | # llvm.org. This is basically just the address of the |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 30 | # webserver |
| 31 | # -submit-script Specifies which script to call on the submit server. If |
| 32 | # this option is not specified it defaults to |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 33 | # /nightlytest/NightlyTestAccept.php. This is basically |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 34 | # everything after the www.yourserver.org. |
Daniel Dunbar | 016a4bb | 2009-05-18 23:24:26 +0000 | [diff] [blame] | 35 | # -submit-aux If specified, an auxiliary script to run in addition to the |
| 36 | # normal submit script. The script will be passed the path to |
| 37 | # the "sentdata.txt" file as its sole argument. |
Tanya Lattner | 084a3ee | 2008-03-10 07:28:08 +0000 | [diff] [blame] | 38 | # -nosubmit Do not report the test results back to a submit server. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 39 | # |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 40 | # |
| 41 | # BUILD OPTIONS (not used with -config): |
| 42 | # -nocheckout Do not create, checkout, update, or configure |
| 43 | # the source tree. |
| 44 | # -noremove Do not remove the BUILDDIR after it has been built. |
| 45 | # -noremoveresults Do not remove the WEBDIR after it has been built. |
| 46 | # -nobuild Do not build llvm. If tests are enabled perform them |
| 47 | # on the llvm build specified in the build directory |
| 48 | # -release Build an LLVM Release version |
| 49 | # -release-asserts Build an LLVM ReleaseAsserts version |
| 50 | # -disable-bindings Disable building LLVM bindings. |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 51 | # -with-clang Checkout Clang source into tools/clang. |
| 52 | # -compileflags Next argument specifies extra options passed to make when |
| 53 | # building LLVM. |
| 54 | # -use-gmake Use gmake instead of the default make command to build |
| 55 | # llvm and run tests. |
| 56 | # |
| 57 | # TESTING OPTIONS: |
| 58 | # -notest Do not even attempt to run the test programs. |
| 59 | # -nodejagnu Do not run feature or regression tests |
| 60 | # -enable-llcbeta Enable testing of beta features in llc. |
| 61 | # -enable-lli Enable testing of lli (interpreter) features, default is off |
| 62 | # -disable-pic Disable building with Position Independent Code. |
| 63 | # -disable-llc Disable LLC tests in the nightly tester. |
| 64 | # -disable-jit Disable JIT tests in the nightly tester. |
| 65 | # -disable-cbe Disable C backend tests in the nightly tester. |
| 66 | # -disable-lto Disable link time optimization. |
| 67 | # -test-cflags Next argument specifies that C compilation options that |
| 68 | # override the default when running the testsuite. |
| 69 | # -test-cxxflags Next argument specifies that C++ compilation options that |
| 70 | # override the default when running the testsuite. |
| 71 | # -extraflags Next argument specifies extra options that are passed to |
| 72 | # compile the tests. |
| 73 | # -noexternals Do not run the external tests (for cases where povray |
| 74 | # or SPEC are not installed) |
| 75 | # -with-externals Specify a directory where the external tests are located. |
| 76 | # |
| 77 | # OTHER OPTIONS: |
| 78 | # -parallel Run parallel jobs with GNU Make (see -parallel-jobs). |
| 79 | # -parallel-jobs The number of parallel Make jobs to use (default is two). |
| 80 | # -verbose Turn on some debug output |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 81 | # -nice Checkout/Configure/Build with "nice" to reduce impact |
| 82 | # on busy servers. |
| 83 | # -f2c Next argument specifies path to F2C utility |
| 84 | # -gccpath Path to gcc/g++ used to build LLVM |
| 85 | # -target Specify the target triplet |
| 86 | # -cflags Next argument specifies that C compilation options that |
| 87 | # override the default. |
| 88 | # -cxxflags Next argument specifies that C++ compilation options that |
| 89 | # override the default. |
| 90 | # -ldflags Next argument specifies that linker options that override |
| 91 | # the default. |
| 92 | # |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 93 | # CVSROOT is ignored, it is passed for backwards compatibility. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 94 | # BUILDDIR is the directory where sources for this test run will be checked out |
| 95 | # AND objects for this test run will be built. This directory MUST NOT |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 96 | # exist before the script is run; it will be created by the svn checkout |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 97 | # process and erased (unless -noremove is specified; see above.) |
| 98 | # WEBDIR is the directory into which the test results web page will be written, |
| 99 | # AND in which the "index.html" is assumed to be a symlink to the most recent |
| 100 | # copy of the results. This directory will be created if it does not exist. |
| 101 | # LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed |
| 102 | # to. This is the same as you would have for a normal LLVM build. |
| 103 | # |
| 104 | ############################################################## |
| 105 | # |
| 106 | # Getting environment variables |
| 107 | # |
| 108 | ############################################################## |
| 109 | my $HOME = $ENV{'HOME'}; |
| 110 | my $SVNURL = $ENV{"SVNURL"}; |
Duncan Sands | 01388f9 | 2009-06-12 13:02:52 +0000 | [diff] [blame] | 111 | $SVNURL = 'http://llvm.org/svn/llvm-project' unless $SVNURL; |
Evan Cheng | b6d7fc3 | 2009-06-18 21:39:50 +0000 | [diff] [blame] | 112 | my $TestSVNURL = $ENV{"TestSVNURL"}; |
Evan Cheng | e45329e | 2009-07-14 06:23:41 +0000 | [diff] [blame] | 113 | $TestSVNURL = 'http://llvm.org/svn/llvm-project' unless $TestSVNURL; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 114 | my $BuildDir = $ENV{'BUILDDIR'}; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 115 | my $WebDir = $ENV{'WEBDIR'}; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 116 | |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 117 | my $LLVMSrcDir = $ENV{'LLVMSRCDIR'}; |
| 118 | $LLVMSrcDir = "$BuildDir/llvm" unless $LLVMSrcDir; |
| 119 | my $LLVMObjDir = $ENV{'LLVMOBJDIR'}; |
| 120 | $LLVMObjDir = "$BuildDir/llvm" unless $LLVMObjDir; |
| 121 | my $LLVMTestDir = $ENV{'LLVMTESTDIR'}; |
| 122 | $LLVMTestDir = "$BuildDir/llvm/projects/llvm-test" unless $LLVMTestDir; |
| 123 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 124 | ############################################################## |
| 125 | # |
| 126 | # Calculate the date prefix... |
| 127 | # |
| 128 | ############################################################## |
| 129 | @TIME = localtime; |
Daniel Dunbar | 93ad6a8 | 2009-07-01 14:52:59 +0000 | [diff] [blame] | 130 | my $DATE = sprintf "%4d-%02d-%02d_%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3], $TIME[1], $TIME[0]; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 131 | |
| 132 | ############################################################## |
| 133 | # |
| 134 | # Parse arguments... |
| 135 | # |
| 136 | ############################################################## |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 137 | $CONFIG_PATH=""; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 138 | $CONFIGUREARGS=""; |
| 139 | $nickname=""; |
| 140 | $NOTEST=0; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 141 | $MAKECMD="make"; |
| 142 | $SUBMITSERVER = "llvm.org"; |
| 143 | $SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php"; |
Daniel Dunbar | 016a4bb | 2009-05-18 23:24:26 +0000 | [diff] [blame] | 144 | $SUBMITAUX=""; |
Tanya Lattner | 084a3ee | 2008-03-10 07:28:08 +0000 | [diff] [blame] | 145 | $SUBMIT = 1; |
Daniel Dunbar | f8cdaec | 2009-05-28 22:45:24 +0000 | [diff] [blame] | 146 | $PARALLELJOBS = "2"; |
Bill Wendling | 085ff3f | 2009-07-16 22:59:17 +0000 | [diff] [blame] | 147 | my $TESTFLAGS=""; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 148 | |
| 149 | while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { |
| 150 | shift; |
| 151 | last if /^--$/; # Stop processing arguments on -- |
| 152 | |
| 153 | # List command line options here... |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 154 | if (/^-config$/) { $CONFIG_PATH = "$ARGV[0]"; shift; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 155 | if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 156 | if (/^-noremove$/) { $NOREMOVE = 1; next; } |
Daniel Dunbar | d3ecefe | 2009-07-13 22:17:49 +0000 | [diff] [blame] | 157 | if (/^-noremoveatend$/) { $NOREMOVEATEND = 1; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 158 | if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; } |
Daniel Dunbar | 2041d9a | 2009-06-02 21:14:15 +0000 | [diff] [blame] | 159 | if (/^-notest$/) { $NOTEST = 1; next; } |
| 160 | if (/^-norunningtests$/) { next; } # Backward compatibility, ignored. |
Daniel Dunbar | f8cdaec | 2009-05-28 22:45:24 +0000 | [diff] [blame] | 161 | if (/^-parallel-jobs$/) { $PARALLELJOBS = "$ARGV[0]"; shift; next;} |
| 162 | if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j$PARALLELJOBS -l3.0"; next; } |
Duncan Sands | 01388f9 | 2009-06-12 13:02:52 +0000 | [diff] [blame] | 163 | if (/^-with-clang$/) { $WITHCLANG = 1; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 164 | if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ". |
| 165 | "OPTIMIZE_OPTION=-O2"; $BUILDTYPE="release"; next;} |
| 166 | if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ". |
Dan Gohman | bd39976 | 2008-10-30 01:08:03 +0000 | [diff] [blame] | 167 | "DISABLE_ASSERTIONS=1 ". |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 168 | "OPTIMIZE_OPTION=-O2"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 169 | $BUILDTYPE="release-asserts"; next;} |
| 170 | if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; } |
Duncan Sands | 01388f9 | 2009-06-12 13:02:52 +0000 | [diff] [blame] | 171 | if (/^-disable-pic$/) { $CONFIGUREARGS .= " --enable-pic=no"; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 172 | if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1"; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 173 | $CONFIGUREARGS .= " --enable-lli"; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 174 | if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1"; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 175 | $CONFIGUREARGS .= " --disable-llc_diffs"; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 176 | if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1"; |
| 177 | $CONFIGUREARGS .= " --disable-jit"; next; } |
Daniel Dunbar | 31a1f1c | 2009-03-10 19:33:13 +0000 | [diff] [blame] | 178 | if (/^-disable-bindings$/) { $CONFIGUREARGS .= " --disable-bindings"; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 179 | if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; } |
Evan Cheng | 32efae0 | 2008-01-12 04:27:18 +0000 | [diff] [blame] | 180 | if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; } |
Evan Cheng | 0820677 | 2008-01-14 17:58:03 +0000 | [diff] [blame] | 181 | if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 182 | if (/^-verbose$/) { $VERBOSE = 1; next; } |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 183 | if (/^-teelogs$/) { $TEELOGS = 1; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 184 | if (/^-nice$/) { $NICE = "nice "; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 185 | if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 186 | shift; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 187 | if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 188 | shift; next; } |
Daniel Dunbar | dd9c4aa | 2009-07-13 22:31:58 +0000 | [diff] [blame] | 189 | if (/^-configure-args$/) { $CONFIGUREARGS .= " $ARGV[0]"; |
| 190 | shift; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 191 | if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; } |
| 192 | if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; } |
Daniel Dunbar | 016a4bb | 2009-05-18 23:24:26 +0000 | [diff] [blame] | 193 | if (/^-submit-aux/) { $SUBMITAUX = "$ARGV[0]"; shift; next; } |
Tanya Lattner | 084a3ee | 2008-03-10 07:28:08 +0000 | [diff] [blame] | 194 | if (/^-nosubmit$/) { $SUBMIT = 0; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 195 | if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; } |
| 196 | if (/^-gccpath/) { $CONFIGUREARGS .= |
| 197 | " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 198 | $GCCPATH=$ARGV[0]; shift; next; } |
| 199 | else { $GCCPATH=""; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 200 | if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 201 | shift; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 202 | if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 203 | shift; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 204 | if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 205 | shift; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 206 | if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 207 | shift; next; } |
Bill Wendling | 085ff3f | 2009-07-16 22:59:17 +0000 | [diff] [blame] | 208 | if (/^-test-cflags/) { $TESTFLAGS = "$TESTFLAGS CFLAGS=\'$ARGV[0]\'"; |
| 209 | shift; next; } |
| 210 | if (/^-test-cxxflags/) { $TESTFLAGS = "$TESTFLAGS CXXFLAGS=\'$ARGV[0]\'"; |
| 211 | shift; next; } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 212 | if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; } |
| 213 | if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 214 | if (/^-extraflags/) { $CONFIGUREARGS .= |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 215 | " --with-extra-options=\'$ARGV[0]\'"; shift; next;} |
| 216 | if (/^-noexternals$/) { $NOEXTERNALS = 1; next; } |
| 217 | if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; } |
| 218 | if (/^-nobuild$/) { $NOBUILD = 1; next; } |
| 219 | print "Unknown option: $_ : ignoring!\n"; |
| 220 | } |
| 221 | |
| 222 | if ($ENV{'LLVMGCCDIR'}) { |
| 223 | $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'}; |
Bob Wilson | c6d296b | 2009-03-12 19:47:24 +0000 | [diff] [blame] | 224 | $LLVMGCCPATH = $ENV{'LLVMGCCDIR'} . '/bin'; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 225 | } |
| 226 | else { |
| 227 | $LLVMGCCPATH = ""; |
| 228 | } |
| 229 | |
| 230 | if ($CONFIGUREARGS !~ /--disable-jit/) { |
| 231 | $CONFIGUREARGS .= " --enable-jit"; |
| 232 | } |
| 233 | |
Daniel Dunbar | dce5acc | 2009-10-19 09:19:19 +0000 | [diff] [blame] | 234 | if (@ARGV != 0 and @ARGV != 3) { |
| 235 | die "error: must specify 0 or 3 options!"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | if (@ARGV == 3) { |
Daniel Dunbar | dce5acc | 2009-10-19 09:19:19 +0000 | [diff] [blame] | 239 | if ($CONFIG_PATH ne "") { |
| 240 | die "error: arguments are unsupported in -config mode,"; |
| 241 | } |
| 242 | |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 243 | # ARGV[0] used to be the CVS root, ignored for backward compatibility. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 244 | $BuildDir = $ARGV[1]; |
| 245 | $WebDir = $ARGV[2]; |
| 246 | } |
| 247 | |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 248 | if ($BuildDir eq "" or |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 249 | $WebDir eq "") { |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 250 | die("please specify a build directory, and a web directory"); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 251 | } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 252 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 253 | if ($nickname eq "") { |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 254 | die ("Please invoke NewNightlyTest.pl with command line option " . |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 255 | "\"-nickname <nickname>\""); |
| 256 | } |
| 257 | |
| 258 | if ($BUILDTYPE ne "release" && $BUILDTYPE ne "release-asserts") { |
| 259 | $BUILDTYPE = "debug"; |
| 260 | } |
| 261 | |
Daniel Dunbar | dce5acc | 2009-10-19 09:19:19 +0000 | [diff] [blame] | 262 | if ($CONFIG_PATH ne "") { |
| 263 | die "error: -config mode is not yet implemented,"; |
| 264 | } |
| 265 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 266 | ############################################################## |
| 267 | # |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 268 | # Define the file names we'll use |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 269 | # |
| 270 | ############################################################## |
| 271 | my $Prefix = "$WebDir/$DATE"; |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 272 | my $ConfigureLog = "$Prefix-Configure-Log.txt"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 273 | my $BuildLog = "$Prefix-Build-Log.txt"; |
| 274 | my $COLog = "$Prefix-CVS-Log.txt"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 275 | my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz"; |
| 276 | my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz"; |
| 277 | my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz"; |
| 278 | my $DejagnuLog = "$Prefix-Dejagnu-testrun.log"; |
| 279 | my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum"; |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 280 | my $DejagnuLog = "$Prefix-DejagnuTests-Log.txt"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 281 | if (! -d $WebDir) { |
Daniel Dunbar | 6981e02 | 2009-10-19 13:19:53 +0000 | [diff] [blame] | 282 | mkdir $WebDir, 0777 or die "Unable to create web directory: '$WebDir'."; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 283 | if($VERBOSE){ |
| 284 | warn "$WebDir did not exist; creating it.\n"; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | if ($VERBOSE) { |
| 289 | print "INITIALIZED\n"; |
Daniel Dunbar | affc0a5 | 2009-10-19 09:18:46 +0000 | [diff] [blame] | 290 | print "SVN URL = $SVNURL\n"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 291 | print "COLog = $COLog\n"; |
| 292 | print "BuildDir = $BuildDir\n"; |
| 293 | print "WebDir = $WebDir\n"; |
| 294 | print "Prefix = $Prefix\n"; |
| 295 | print "BuildLog = $BuildLog\n"; |
| 296 | } |
| 297 | |
| 298 | ############################################################## |
| 299 | # |
| 300 | # Helper functions |
| 301 | # |
| 302 | ############################################################## |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 303 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 304 | sub GetDir { |
| 305 | my $Suffix = shift; |
| 306 | opendir DH, $WebDir; |
| 307 | my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH; |
| 308 | closedir DH; |
| 309 | return @Result; |
| 310 | } |
| 311 | |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 312 | sub RunLoggedCommand { |
| 313 | my $Command = shift; |
| 314 | my $Log = shift; |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 315 | my $Title = shift; |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 316 | if ($TEELOGS) { |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 317 | if ($VERBOSE) { |
| 318 | print "$Title\n"; |
| 319 | print "$Command 2>&1 | tee $Log\n"; |
| 320 | } |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 321 | system "$Command 2>&1 | tee $Log"; |
| 322 | } else { |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 323 | if ($VERBOSE) { |
| 324 | print "$Title\n"; |
| 325 | print "$Command 2>&1 > $Log\n"; |
| 326 | } |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 327 | system "$Command 2>&1 > $Log"; |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | sub RunAppendingLoggedCommand { |
| 332 | my $Command = shift; |
| 333 | my $Log = shift; |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 334 | my $Title = shift; |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 335 | if ($TEELOGS) { |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 336 | if ($VERBOSE) { |
| 337 | print "$Title\n"; |
| 338 | print "$Command 2>&1 | tee -a $Log\n"; |
| 339 | } |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 340 | system "$Command 2>&1 | tee -a $Log"; |
| 341 | } else { |
Daniel Dunbar | e2d4fc5 | 2009-06-26 02:30:49 +0000 | [diff] [blame] | 342 | if ($VERBOSE) { |
| 343 | print "$Title\n"; |
| 344 | print "$Command 2>&1 > $Log\n"; |
| 345 | } |
| 346 | system "$Command 2>&1 >> $Log"; |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 347 | } |
| 348 | } |
| 349 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 350 | sub GetRegex { # (Regex with ()'s, value) |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 351 | if ($_[1] =~ /$_[0]/m) { |
| 352 | return $1; |
| 353 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 354 | return "0"; |
| 355 | } |
| 356 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 357 | sub ChangeDir { # directory, logical name |
| 358 | my ($dir,$name) = @_; |
| 359 | chomp($dir); |
| 360 | if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; } |
| 361 | $result = chdir($dir); |
| 362 | if (!$result) { |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 363 | print "ERROR!!! Cannot change directory to: $name ($dir) because $!"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 364 | return false; |
| 365 | } |
| 366 | return true; |
| 367 | } |
| 368 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 369 | sub ReadFile { |
| 370 | if (open (FILE, $_[0])) { |
| 371 | undef $/; |
| 372 | my $Ret = <FILE>; |
| 373 | close FILE; |
| 374 | $/ = '\n'; |
| 375 | return $Ret; |
| 376 | } else { |
| 377 | print "Could not open file '$_[0]' for reading!\n"; |
| 378 | return ""; |
| 379 | } |
| 380 | } |
| 381 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 382 | sub WriteFile { # (filename, contents) |
| 383 | open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n"; |
| 384 | print FILE $_[1]; |
| 385 | close FILE; |
| 386 | } |
| 387 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 388 | sub CopyFile { #filename, newfile |
| 389 | my ($file, $newfile) = @_; |
| 390 | chomp($file); |
| 391 | if ($VERBOSE) { print "Copying $file to $newfile\n"; } |
| 392 | copy($file, $newfile); |
| 393 | } |
| 394 | |
| 395 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 396 | # |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 397 | # This function is meant to read in the dejagnu sum file and |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 398 | # return a string with only the results (i.e. PASS/FAIL/XPASS/ |
| 399 | # XFAIL). |
| 400 | # |
| 401 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 402 | sub GetDejagnuTestResults { # (filename, log) |
| 403 | my ($filename, $DejagnuLog) = @_; |
| 404 | my @lines; |
| 405 | $/ = "\n"; #Make sure we're going line at a time. |
| 406 | |
| 407 | if( $VERBOSE) { print "DEJAGNU TEST RESULTS:\n"; } |
| 408 | |
| 409 | if (open SRCHFILE, $filename) { |
| 410 | # Process test results |
| 411 | while ( <SRCHFILE> ) { |
| 412 | if ( length($_) > 1 ) { |
| 413 | chomp($_); |
| 414 | if ( m/^(PASS|XPASS|FAIL|XFAIL): .*\/llvm\/test\/(.*)$/ ) { |
| 415 | push(@lines, "$1: test/$2"); |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | close SRCHFILE; |
| 421 | |
| 422 | my $content = join("\n", @lines); |
| 423 | return $content; |
| 424 | } |
| 425 | |
| 426 | |
| 427 | |
| 428 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 429 | # |
| 430 | # This function acts as a mini web browswer submitting data |
| 431 | # to our central server via the post method |
| 432 | # |
| 433 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 434 | sub SendData { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 435 | $host = $_[0]; |
| 436 | $file = $_[1]; |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 437 | $variables = $_[2]; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 438 | |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 439 | # Write out the "...-sentdata.txt" file. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 440 | |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 441 | my $sentdata=""; |
| 442 | foreach $x (keys (%$variables)){ |
| 443 | $value = $variables->{$x}; |
| 444 | $sentdata.= "$x => $value\n"; |
| 445 | } |
| 446 | WriteFile "$Prefix-sentdata.txt", $sentdata; |
| 447 | |
| 448 | if (!($SUBMITAUX eq "")) { |
Daniel Dunbar | 3b377ef | 2009-06-26 22:33:28 +0000 | [diff] [blame] | 449 | system "$SUBMITAUX \"$Prefix-sentdata.txt\""; |
| 450 | } |
| 451 | |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 452 | if (!$SUBMIT) { |
Daniel Dunbar | 3b377ef | 2009-06-26 22:33:28 +0000 | [diff] [blame] | 453 | return "Skipped standard submit.\n"; |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | # Create the content to send to the server. |
| 457 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 458 | my $content; |
| 459 | foreach $key (keys (%$variables)){ |
| 460 | $value = $variables->{$key}; |
| 461 | $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; |
| 462 | $content .= "$key=$value&"; |
| 463 | } |
| 464 | |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 465 | # Send the data to the server. |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 466 | # |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 467 | # FIXME: This code should be more robust? |
Daniel Dunbar | ae3faf1 | 2009-10-19 09:18:24 +0000 | [diff] [blame] | 468 | |
Daniel Dunbar | a253300 | 2009-05-28 18:31:40 +0000 | [diff] [blame] | 469 | $port=80; |
| 470 | $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n"; |
| 471 | socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or |
| 472 | die "Bad socket\n"; |
| 473 | connect SOCK, $socketaddr or die "Bad connection\n"; |
| 474 | select((select(SOCK), $| = 1)[0]); |
| 475 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 476 | $length = length($content); |
| 477 | |
| 478 | my $send= "POST $file HTTP/1.0\n"; |
| 479 | $send.= "Host: $host\n"; |
| 480 | $send.= "Content-Type: application/x-www-form-urlencoded\n"; |
| 481 | $send.= "Content-length: $length\n\n"; |
| 482 | $send.= "$content"; |
| 483 | |
| 484 | print SOCK $send; |
| 485 | my $result; |
| 486 | while(<SOCK>){ |
| 487 | $result .= $_; |
| 488 | } |
| 489 | close(SOCK); |
| 490 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 491 | return $result; |
| 492 | } |
| 493 | |
| 494 | ############################################################## |
| 495 | # |
| 496 | # Getting Start timestamp |
| 497 | # |
| 498 | ############################################################## |
| 499 | $starttime = `date "+20%y-%m-%d %H:%M:%S"`; |
| 500 | |
| 501 | ############################################################## |
| 502 | # |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 503 | # Create the source repository directory |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 504 | # |
| 505 | ############################################################## |
Daniel Dunbar | 4493e94 | 2009-10-19 13:20:06 +0000 | [diff] [blame] | 506 | sub CheckoutSource { |
| 507 | if (!$NOCHECKOUT) { |
| 508 | if (-d $BuildDir) { |
| 509 | if (!$NOREMOVE) { |
| 510 | if ( $VERBOSE ) { |
| 511 | print "Build directory exists! Removing it\n"; |
| 512 | } |
| 513 | system "rm -rf $BuildDir"; |
| 514 | mkdir $BuildDir or die "Could not create checkout directory $BuildDir!"; |
| 515 | } else { |
| 516 | if ( $VERBOSE ) { |
| 517 | print "Build directory exists!\n"; |
| 518 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 519 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 520 | } else { |
Daniel Dunbar | 4493e94 | 2009-10-19 13:20:06 +0000 | [diff] [blame] | 521 | mkdir $BuildDir or die "Could not create checkout directory $BuildDir!"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 522 | } |
Daniel Dunbar | 4493e94 | 2009-10-19 13:20:06 +0000 | [diff] [blame] | 523 | |
| 524 | ChangeDir( $BuildDir, "checkout directory" ); |
| 525 | my $SVNCMD = "$NICE svn co --non-interactive"; |
| 526 | RunLoggedCommand("( time -p $SVNCMD $SVNURL/llvm/trunk llvm; cd llvm/projects ; " . |
| 527 | " $SVNCMD $TestSVNURL/test-suite/trunk llvm-test )", $COLog, |
| 528 | "CHECKOUT LLVM"); |
| 529 | if ($WITHCLANG) { |
| 530 | RunLoggedCommand("( cd llvm/tools ; " . |
| 531 | " $SVNCMD $SVNURL/cfe/trunk clang )", $COLog, |
| 532 | "CHECKOUT CLANG"); |
| 533 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 534 | } |
| 535 | } |
Daniel Dunbar | 4493e94 | 2009-10-19 13:20:06 +0000 | [diff] [blame] | 536 | CheckoutSource(); |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 537 | ChangeDir( $LLVMSrcDir , "llvm source directory") ; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 538 | |
| 539 | ############################################################## |
| 540 | # |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 541 | # Build the entire tree, saving build messages to the build log |
| 542 | # |
| 543 | ############################################################## |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 544 | sub BuildLLVM { |
| 545 | if (!$NOCHECKOUT && !$NOBUILD) { |
| 546 | my $EXTRAFLAGS = "--enable-spec --with-objroot=."; |
| 547 | RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ", |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 548 | $ConfigureLog, "CONFIGURE"); |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 549 | # Build the entire tree, capturing the output into $BuildLog |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 550 | RunAppendingLoggedCommand("($NICE $MAKECMD clean)", $BuildLog, "BUILD CLEAN"); |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 551 | RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD"); |
| 552 | } |
| 553 | |
| 554 | # Check for build error. |
| 555 | my $HadError = 0, $Status = "OK"; |
| 556 | if ($NOBUILD) { |
| 557 | $Status = "Skipped by user"; |
| 558 | } |
| 559 | elsif (`grep '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 || |
| 560 | `grep '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l`+0) { |
| 561 | $Status = "Error: compilation aborted"; |
| 562 | $HadError = 1; |
| 563 | } |
| 564 | |
| 565 | return ($HadError, $Status); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 566 | } |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 567 | ($BuildError, $BuildStatus) = BuildLLVM(); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 568 | |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 569 | if ($BuildError) { |
| 570 | if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; } |
| 571 | $NODEJAGNU=1; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 572 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 573 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 574 | ############################################################## |
| 575 | # |
| 576 | # Running dejagnu tests |
| 577 | # |
| 578 | ############################################################## |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 579 | |
| 580 | # String containing the results of the dejagnu |
| 581 | my $DejagnuTestResults="Dejagnu skipped by user choice."; |
| 582 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 583 | if (!$NODEJAGNU) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 584 | #Run the feature and regression tests, results are put into testrun.sum |
| 585 | #Full log in testrun.log |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 586 | RunLoggedCommand("(time -p $MAKECMD $MAKEOPTS check)", $DejagnuLog, "DEJAGNU"); |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 587 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 588 | #Copy the testrun.log and testrun.sum to our webdir |
| 589 | CopyFile("test/testrun.log", $DejagnuLog); |
| 590 | CopyFile("test/testrun.sum", $DejagnuSum); |
| 591 | #can be done on server |
| 592 | $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 593 | } |
| 594 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 595 | ############################################################## |
| 596 | # |
| 597 | # If we built the tree successfully, run the nightly programs tests... |
| 598 | # |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 599 | # A set of tests to run is passed in (i.e. "SingleSource" "MultiSource" |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 600 | # "External") |
| 601 | # |
| 602 | ############################################################## |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 603 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 604 | sub TestDirectory { |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 605 | my $SubDir = shift; |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 606 | ChangeDir( "$LLVMTestDir/$SubDir", |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 607 | "Programs Test Subdirectory" ) || return ("", ""); |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 608 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 609 | my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt"; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 610 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 611 | # Run the programs tests... creating a report.nightly.csv file |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 612 | my $LLCBetaOpts = ""; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 613 | if (!$NOTEST) { |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 614 | if( $VERBOSE) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 615 | print "$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ". |
Bill Wendling | 085ff3f | 2009-07-16 22:59:17 +0000 | [diff] [blame] | 616 | "$TESTFLAGS TEST=nightly > $ProgramTestLog 2>&1\n"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 617 | } |
Daniel Dunbar | 83968bb | 2009-06-26 01:53:05 +0000 | [diff] [blame] | 618 | RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ". |
Bill Wendling | 085ff3f | 2009-07-16 22:59:17 +0000 | [diff] [blame] | 619 | "$TESTFLAGS TEST=nightly", |
| 620 | $ProgramTestLog, "TEST DIRECTORY $SubDir"); |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 621 | $LLCBetaOpts = `$MAKECMD print-llcbeta-option`; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 622 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 623 | |
| 624 | my $ProgramsTable; |
| 625 | if (`grep '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) { |
| 626 | $TestError = 1; |
| 627 | $ProgramsTable="Error running test $SubDir\n"; |
| 628 | print "ERROR TESTING\n"; |
| 629 | } elsif (`grep '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) { |
| 630 | $TestError = 1; |
| 631 | $ProgramsTable="Makefile error running tests $SubDir!\n"; |
| 632 | print "ERROR TESTING\n"; |
| 633 | } else { |
| 634 | $TestError = 0; |
| 635 | # |
| 636 | # Create a list of the tests which were run... |
| 637 | # |
| 638 | system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ". |
| 639 | "| sort > $Prefix-$SubDir-Tests.txt"; |
| 640 | } |
| 641 | $ProgramsTable = ReadFile "report.nightly.csv"; |
| 642 | |
| 643 | ChangeDir( "../../..", "Programs Test Parent Directory" ); |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 644 | return ($ProgramsTable, $LLCBetaOpts); |
| 645 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 646 | |
| 647 | ############################################################## |
| 648 | # |
| 649 | # Calling sub TestDirectory |
| 650 | # |
| 651 | ############################################################## |
| 652 | if (!$BuildError) { |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 653 | ($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource"); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 654 | WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 655 | ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource"); |
| 656 | WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable; |
| 657 | if ( ! $NOEXTERNALS ) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 658 | ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External"); |
| 659 | WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 660 | system "cat $Prefix-SingleSource-Tests.txt " . |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 661 | "$Prefix-MultiSource-Tests.txt ". |
| 662 | "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 663 | system "cat $Prefix-SingleSource-Performance.txt " . |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 664 | "$Prefix-MultiSource-Performance.txt ". |
| 665 | "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt"; |
| 666 | } else { |
| 667 | $ExternalProgramsTable = "External TEST STAGE SKIPPED\n"; |
| 668 | if ( $VERBOSE ) { |
| 669 | print "External TEST STAGE SKIPPED\n"; |
| 670 | } |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 671 | system "cat $Prefix-SingleSource-Tests.txt " . |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 672 | "$Prefix-MultiSource-Tests.txt ". |
| 673 | " | sort > $Prefix-Tests.txt"; |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 674 | system "cat $Prefix-SingleSource-Performance.txt " . |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 675 | "$Prefix-MultiSource-Performance.txt ". |
| 676 | " | sort > $Prefix-Performance.txt"; |
| 677 | } |
| 678 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 679 | # Compile passes, fails, xfails. |
| 680 | my @TestSuiteResultLines = split "\n", (ReadFile "$Prefix-Tests.txt"); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 681 | my ($passes, $fails, $xfails) = ""; |
| 682 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 683 | for ($x=0; $x < @TestSuiteResultLines; $x++) { |
| 684 | if (@TestSuiteResultLines[$x] =~ m/^PASS:/) { |
| 685 | $passes .= "$TestSuiteResultLines[$x]\n"; |
| 686 | } |
| 687 | elsif (@TestSuiteResultLines[$x] =~ m/^FAIL:/) { |
| 688 | $fails .= "$TestSuiteResultLines[$x]\n"; |
| 689 | } |
| 690 | elsif (@TestSuiteResultLines[$x] =~ m/^XFAIL:/) { |
| 691 | $xfails .= "$TestSuiteResultLines[$x]\n"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 692 | } |
| 693 | } |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 694 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 695 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 696 | ############################################################## |
| 697 | # |
| 698 | # Getting end timestamp |
| 699 | # |
| 700 | ############################################################## |
| 701 | $endtime = `date "+20%y-%m-%d %H:%M:%S"`; |
| 702 | |
| 703 | |
| 704 | ############################################################## |
| 705 | # |
| 706 | # Place all the logs neatly into one humungous file |
| 707 | # |
| 708 | ############################################################## |
| 709 | if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; } |
| 710 | |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 711 | $machine_data = "uname: ".`uname -a`. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 712 | "hardware: ".`uname -m`. |
| 713 | "os: ".`uname -sr`. |
| 714 | "name: ".`uname -n`. |
| 715 | "date: ".`date \"+20%y-%m-%d\"`. |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 716 | "time: ".`date +\"%H:%M:%S\"`; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 717 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 718 | my $gcc_version_long = ""; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 719 | if ($GCCPATH ne "") { |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 720 | $gcc_version_long = `$GCCPATH/gcc --version`; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 721 | } elsif ($ENV{"CC"}) { |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 722 | $gcc_version_long = `$ENV{"CC"} --version`; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 723 | } else { |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 724 | $gcc_version_long = `gcc --version`; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 725 | } |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 726 | my $gcc_version = (split '\n', $gcc_version_long)[0]; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 727 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 728 | my $llvmgcc_version_long = ""; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 729 | if ($LLVMGCCPATH ne "") { |
| 730 | $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`; |
| 731 | } else { |
| 732 | $llvmgcc_version_long = `llvm-gcc -v 2>&1`; |
| 733 | } |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 734 | (split '\n', $llvmgcc_version_long)[1] =~ /Target: (.+)/; |
| 735 | my $targetTriple = $1; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 736 | |
| 737 | ############################################################## |
| 738 | # |
| 739 | # Send data via a post request |
| 740 | # |
| 741 | ############################################################## |
| 742 | |
| 743 | if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; } |
| 744 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 745 | # Logs. |
| 746 | my $ConfigureLogData = ReadFile $ConfigureLog; |
| 747 | my $BuildLogData = ReadFile $BuildLog; |
| 748 | my $DejagnuLogData = ReadFile $DejagnuLog; |
| 749 | my $CheckoutLogData = ReadFile $COLog; |
| 750 | |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 751 | # Checkout info. |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 752 | my $CheckoutTime_Wall = GetRegex "^real ([0-9.]+)", $CheckoutLogData; |
| 753 | my $CheckoutTime_User = GetRegex "^user ([0-9.]+)", $CheckoutLogData; |
| 754 | my $CheckoutTime_Sys = GetRegex "^sys ([0-9.]+)", $CheckoutLogData; |
Daniel Dunbar | 4493e94 | 2009-10-19 13:20:06 +0000 | [diff] [blame] | 755 | my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys; |
| 756 | |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 757 | # Configure info. |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 758 | my $ConfigTimeU = GetRegex "^user ([0-9.]+)", $ConfigureLogData; |
| 759 | my $ConfigTimeS = GetRegex "^sys ([0-9.]+)", $ConfigureLogData; |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 760 | my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 761 | my $ConfigWallTime = GetRegex "^real ([0-9.]+)",$ConfigureLogData; |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 762 | $ConfigTime=-1 unless $ConfigTime; |
| 763 | $ConfigWallTime=-1 unless $ConfigWallTime; |
| 764 | |
| 765 | # Build info. |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 766 | my $BuildTimeU = GetRegex "^user ([0-9.]+)", $BuildLogData; |
| 767 | my $BuildTimeS = GetRegex "^sys ([0-9.]+)", $BuildLogData; |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 768 | my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 769 | my $BuildWallTime = GetRegex "^real ([0-9.]+)", $BuildLogData; |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 770 | $BuildTime=-1 unless $BuildTime; |
| 771 | $BuildWallTime=-1 unless $BuildWallTime; |
| 772 | |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 773 | # DejaGNU info. |
| 774 | my $DejagnuTimeU = GetRegex "^user ([0-9.]+)", $DejagnuLogData; |
| 775 | my $DejagnuTimeS = GetRegex "^sys ([0-9.]+)", $DejagnuLogData; |
| 776 | $DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System |
| 777 | $DejagnuWallTime = GetRegex "^real ([0-9.]+)", $DejagnuLogData; |
| 778 | $DejagnuTime = "0.0" unless $DejagnuTime; |
| 779 | $DejagnuWallTime = "0.0" unless $DejagnuWallTime; |
Daniel Dunbar | f2ec009 | 2009-10-19 13:20:13 +0000 | [diff] [blame] | 780 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 781 | my %hash_of_data = ( |
| 782 | 'machine_data' => $machine_data, |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 783 | 'build_data' => $ConfigureLogData . $BuildLogData, |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 784 | 'gcc_version' => $gcc_version, |
| 785 | 'nickname' => $nickname, |
| 786 | 'dejagnutime_wall' => $DejagnuWallTime, |
| 787 | 'dejagnutime_cpu' => $DejagnuTime, |
| 788 | 'cvscheckouttime_wall' => $CheckoutTime_Wall, |
| 789 | 'cvscheckouttime_cpu' => $CheckoutTime_CPU, |
| 790 | 'configtime_wall' => $ConfigWallTime, |
| 791 | 'configtime_cpu'=> $ConfigTime, |
| 792 | 'buildtime_wall' => $BuildWallTime, |
| 793 | 'buildtime_cpu' => $BuildTime, |
Daniel Dunbar | 6981e02 | 2009-10-19 13:19:53 +0000 | [diff] [blame] | 794 | 'warnings' => "", |
Daniel Dunbar | 9ec7b9e | 2009-10-19 09:19:09 +0000 | [diff] [blame] | 795 | 'cvsusercommitlist' => "", |
| 796 | 'cvsuserupdatelist' => "", |
| 797 | 'cvsaddedfiles' => "", |
| 798 | 'cvsmodifiedfiles' => "", |
| 799 | 'cvsremovedfiles' => "", |
| 800 | 'lines_of_code' => "", |
| 801 | 'cvs_file_count' => 0, |
| 802 | 'cvs_dir_count' => 0, |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 803 | 'buildstatus' => $BuildStatus, |
| 804 | 'singlesource_programstable' => $SingleSourceProgramsTable, |
| 805 | 'multisource_programstable' => $MultiSourceProgramsTable, |
| 806 | 'externalsource_programstable' => $ExternalProgramsTable, |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 807 | 'llcbeta_options' => $llcbeta_options, |
Daniel Dunbar | 6981e02 | 2009-10-19 13:19:53 +0000 | [diff] [blame] | 808 | 'warnings_removed' => "", |
| 809 | 'warnings_added' => "", |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 810 | 'passing_tests' => $passes, |
| 811 | 'expfail_tests' => $xfails, |
| 812 | 'unexpfail_tests' => $fails, |
| 813 | 'all_tests' => $dejagnu_test_list, |
| 814 | 'new_tests' => "", |
| 815 | 'removed_tests' => "", |
| 816 | 'dejagnutests_results' => $DejagnuTestResults, |
Daniel Dunbar | ce25daf | 2009-10-19 13:20:19 +0000 | [diff] [blame^] | 817 | 'dejagnutests_log' => $DejagnuLogData, |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 818 | 'starttime' => $starttime, |
| 819 | 'endtime' => $endtime, |
Daniel Dunbar | 3c52ad1 | 2009-10-19 13:20:00 +0000 | [diff] [blame] | 820 | 'o_file_sizes' => "", |
| 821 | 'a_file_sizes' => "", |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 822 | 'target_triple' => $targetTriple |
| 823 | ); |
| 824 | |
Daniel Dunbar | 3b377ef | 2009-06-26 22:33:28 +0000 | [diff] [blame] | 825 | if ($SUBMIT || !($SUBMITAUX eq "")) { |
Tanya Lattner | 084a3ee | 2008-03-10 07:28:08 +0000 | [diff] [blame] | 826 | my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data; |
| 827 | if( $VERBOSE) { print "============================\n$response"; } |
| 828 | } else { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 829 | print "============================\n"; |
| 830 | foreach $x(keys %hash_of_data){ |
| 831 | print "$x => $hash_of_data{$x}\n"; |
| 832 | } |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 833 | } |
| 834 | |
| 835 | ############################################################## |
| 836 | # |
Daniel Dunbar | 414cffe | 2009-10-19 09:18:54 +0000 | [diff] [blame] | 837 | # Remove the source tree... |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 838 | # |
| 839 | ############################################################## |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 840 | system ( "$NICE rm -rf $BuildDir") |
Daniel Dunbar | d3ecefe | 2009-07-13 22:17:49 +0000 | [diff] [blame] | 841 | if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVEATEND); |
Misha Brukman | afa1e86 | 2009-01-02 16:28:18 +0000 | [diff] [blame] | 842 | system ( "$NICE rm -rf $WebDir") |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 843 | if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS); |