From 72e5540cd07a0186fef255158293db1d811d4ec0 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 7 Jan 2009 06:19:03 +0000 Subject: [PATCH] Index: nightly/bin/nightly - Check that it is passed two arguments, abort if not (avoids some possibly confusing behaviour). - Remove various uses of $ABT_TOP in paths; it's not necessary because the first thing the script does is 'cd' to $ABT_TOP. Furthemore, some paths lacked the $ABT_TOP which was confusing. - Gather up all the diffs from the tests, grab the first 100 lines (or less, if shorter) of each, and concatenate into a file, the name of which is passed to the .sendmail script so it can be attached. Index: nightly/README.txt Explain the new 3rd argument. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8915 --- nightly/README.txt | 7 +++++-- nightly/bin/nightly | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/nightly/README.txt b/nightly/README.txt index 76ab6ca30..b3817fe38 100644 --- a/nightly/README.txt +++ b/nightly/README.txt @@ -9,7 +9,7 @@ existing tree. To use, choose a tag, probably a machine name, and run - bin/nightly /path/to/valgrind/nightly + bin/nightly /path/to/valgrind/nightly/ and supply the following two config files: @@ -29,4 +29,7 @@ and supply the following two config files: - conf/.sendmail: this should be a script that sends an email to the desired recipient (eg. the valgrind-developers list). It must take two command line arguments. The first is the email subject line, the second - is the email's body. + is the name of the file containing the email's body (showing the tests + that failed, and the difference between now and 24 hours ago), the third + is the name of the file containing all the diffs (which can be made into + an attachment, for example). diff --git a/nightly/bin/nightly b/nightly/bin/nightly index cc6c49be9..42152230e 100755 --- a/nightly/bin/nightly +++ b/nightly/bin/nightly @@ -39,6 +39,12 @@ runcmd () { #---------------------------------------------------------------------------- # Startup #---------------------------------------------------------------------------- +# Must have at two arguments +if [ $# -ne 2 ] ; then + echo "usage: bin/night /path/to/valgrind/nightly " + exit 1 +fi + # Get args from command line ABT_TOP=$1 ABT_MACHINE=$2 @@ -51,7 +57,8 @@ svn_new_date=`date --date=today +%Y-%m-%dT%H:%M:%S` cd $ABT_TOP -source $ABT_TOP/conf/$ABT_MACHINE.conf +# Setup any relevant environment variables from conf/.conf. +source conf/$ABT_MACHINE.conf if [ "${ABT_JOBS}" = "" ]; then ABT_JOBS=1 fi @@ -92,7 +99,7 @@ for logfile in old new ; do \ runcmd $logfile \ "Configuring valgrind " \ - "cd valgrind && ./autogen.sh && ./configure --prefix=$ABT_TOP/Inst ${ABT_CONFIGURE_OPTIONS}" && \ + "cd valgrind && ./autogen.sh && ./configure --prefix=`pwd`/Inst ${ABT_CONFIGURE_OPTIONS}" && \ \ runcmd $logfile \ "Building valgrind " \ @@ -155,7 +162,29 @@ if [ $changed != 0 ] ; then echo >> final fi -# Email the results -$ABT_TOP/conf/$ABT_MACHINE.sendmail \ +# Gather up the diffs (at most the first 100 lines for each one) into a +# single file. +MAX_LINES=100 +rm -f diffs +diff_files=`find . -name '*.diff'` +if [ z"$diff_files" = z ] ; then + echo "Congratulations, all tests passed!" >> diffs +else + for i in $diff_files ; do + echo "=================================================" >> diffs + echo $i >> diffs + echo "=================================================" >> diffs + if [ `wc -l < $i` -le $MAX_LINES ] ; then + cat $i >> diffs + else + head -$MAX_LINES $i >> diffs + echo "" >> diffs + fi + done +fi + +# Use the conf/.sendmail script to email the results. +conf/$ABT_MACHINE.sendmail \ "$ABT_START nightly build ($ABT_MACHINE, $ABT_DETAILS)" \ - $ABT_TOP/final + final \ + diffs