jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 3 | #---------------------------------------------------------------------------- |
| 4 | # Automated build and test for Valgrind. Compares Valgrind from 24 hours |
njn | 5a1ba02 | 2009-01-07 04:14:42 +0000 | [diff] [blame] | 5 | # ago with the current one. See the README.txt on how to run it. |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 6 | #---------------------------------------------------------------------------- |
| 7 | |
| 8 | #---------------------------------------------------------------------------- |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 9 | # Helper functions |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 10 | #---------------------------------------------------------------------------- |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 11 | |
bart | 3bd1fc5 | 2012-02-13 08:47:51 +0000 | [diff] [blame] | 12 | # Returns the revision number for the source files at date $1 in Subversion |
| 13 | # repo $2. Note: the "--depth" command line argument is supported from |
| 14 | # Subversion version 1.5 on. |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 15 | get_svn_revision() { |
bart | 3bd1fc5 | 2012-02-13 08:47:51 +0000 | [diff] [blame] | 16 | ( |
| 17 | cd $DIR |
| 18 | rm -rf infodir |
| 19 | if ! svn co -r "{$1}" --depth empty "$2" infodir > /dev/null 2>&1; then |
| 20 | # Subversion 1.4 or before. |
| 21 | rm -rf infodir |
| 22 | svn co -r "{$1}" --non-recursive "$2" infodir > /dev/null |
| 23 | fi |
| 24 | svn info infodir | sed -n 's/^Revision: //p' |
| 25 | rm -rf infodir |
| 26 | ) |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 27 | } |
| 28 | |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 29 | runcmd () { |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 30 | logfile=$1 |
| 31 | str=$2 |
| 32 | shift 2 |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 33 | |
njn | e21f85d | 2009-06-04 01:43:49 +0000 | [diff] [blame] | 34 | # Header in short logfile. |
| 35 | # We use "printf" to avoid printing a newline; "echo -n" isn't POSIX and |
| 36 | # so isn't supported on all systems. |
| 37 | printf " $str ... " >> $logfile.short |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 38 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 39 | # Header and command in verbose logfile |
njn | e21f85d | 2009-06-04 01:43:49 +0000 | [diff] [blame] | 40 | printf " $str ... " >> $logfile.verbose |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 41 | echo "$*" >> $logfile.verbose |
| 42 | |
| 43 | # Run the command |
bart | fd97cec | 2009-01-12 08:23:15 +0000 | [diff] [blame] | 44 | ("${ABT_EVAL}" "$*") >> $logfile.verbose 2>&1 |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 45 | res=$? |
| 46 | |
| 47 | # Write result to the short logfile |
njn | 62647eb | 2009-01-07 04:47:20 +0000 | [diff] [blame] | 48 | if [ $res = 0 ] |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 49 | then |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 50 | echo "done" >> $logfile.short |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 51 | else |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 52 | echo "failed" >> $logfile.short |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 53 | fi |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 54 | |
| 55 | return $res |
tom | 44380b1 | 2005-03-31 10:19:59 +0000 | [diff] [blame] | 56 | } |
| 57 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 58 | #---------------------------------------------------------------------------- |
| 59 | # Startup |
| 60 | #---------------------------------------------------------------------------- |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 61 | |
| 62 | valgrind_svn_repo="svn://svn.valgrind.org/valgrind/trunk" |
bart | 3bd1fc5 | 2012-02-13 08:47:51 +0000 | [diff] [blame] | 63 | vex_svn_repo="svn://svn.valgrind.org/vex/trunk" |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 64 | |
bart | fd97cec | 2009-01-12 08:23:15 +0000 | [diff] [blame] | 65 | # Must have exactly two arguments |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 66 | if [ $# -ne 2 ] ; then |
bart | 87fa0df | 2009-04-05 11:02:29 +0000 | [diff] [blame] | 67 | echo "usage: $0 /path/to/valgrind/nightly <tag>" |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 68 | exit 1 |
| 69 | fi |
| 70 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 71 | # Get args from command line |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 72 | DIR=$1 |
| 73 | TAG=$2 |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 74 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 75 | # Get times and date |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 76 | START=`date "+%F %H:%M:%S %Z"` |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 77 | |
njn | e21f85d | 2009-06-04 01:43:49 +0000 | [diff] [blame] | 78 | # This is one of the formats SVN accepts. Yes, the 'T' appears in the final |
| 79 | # string, it's supposed to be like that. |
| 80 | svn_date_format="+%Y-%m-%dT%H:%M:%S" |
| 81 | |
| 82 | # The time-and-date from 24 hours ago is tricky; Linux and Darwin have |
| 83 | # different ways of getting it, so we try things until something works. |
| 84 | svn_old_date= |
| 85 | if [ "z" = "z${svn_old_date}" ] ; then |
| 86 | # Linux method. |
| 87 | svn_old_date=`date --date=yesterday $svn_date_format 2> /dev/null` |
| 88 | fi |
| 89 | if [ "z" = "z${svn_old_date}" ] ; then |
| 90 | # Darwin method. |
| 91 | svn_old_date=`date -v-24H $svn_date_format 2> /dev/null` |
| 92 | fi |
| 93 | if [ "z" = "z${svn_old_date}" ] ; then |
| 94 | echo "Sorry, can't work out the time and date for 24 hours ago, aborting" |
| 95 | exit 1; |
| 96 | fi |
| 97 | |
| 98 | # The time-and-date for now is easy. |
| 99 | svn_new_date=`date $svn_date_format` |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 100 | |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 101 | cd $DIR |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 102 | |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 103 | # Clean up output files produced by a previous run. |
bart | 72e4063 | 2011-07-30 11:26:57 +0000 | [diff] [blame] | 104 | rm -rf diffs diffs.txt diff.short final new.short new.verbose old.short old.verbose |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 105 | rm -rf sendmail.log unchanged.log valgrind-old valgrind-new |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 106 | |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 107 | # Setup any relevant environment variables from conf/<tag>.conf. |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 108 | . conf/$TAG.conf |
bart | 4a10107 | 2008-09-08 18:43:53 +0000 | [diff] [blame] | 109 | if [ "${ABT_JOBS}" = "" ]; then |
| 110 | ABT_JOBS=1 |
| 111 | fi |
bart | fd97cec | 2009-01-12 08:23:15 +0000 | [diff] [blame] | 112 | if [ "${ABT_EVAL}" = "" ]; then |
| 113 | ABT_EVAL="eval" |
| 114 | fi |
bart | 4a10107 | 2008-09-08 18:43:53 +0000 | [diff] [blame] | 115 | if [ "${ABT_RUN_REGTEST}" = "" ]; then |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 116 | ABT_RUN_REGTEST="make regtest" |
bart | 4a10107 | 2008-09-08 18:43:53 +0000 | [diff] [blame] | 117 | fi |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 118 | |
philippe | f31fe6f | 2013-09-27 18:10:29 +0000 | [diff] [blame] | 119 | if [ "${ABT_PERF_TOOLS}" = "" ]; then |
| 120 | ABT_PERF_TOOLS="--tools=none,memcheck,callgrind,helgrind,cachegrind,drd,massif" |
| 121 | fi |
| 122 | if [ "${ABT_PERF_REPS}" = "" ]; then |
| 123 | ABT_PERF_REPS="--reps=3" |
| 124 | fi |
| 125 | |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 126 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 127 | #---------------------------------------------------------------------------- |
| 128 | # Check out, build, test |
| 129 | #---------------------------------------------------------------------------- |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 130 | |
bart | 3bd1fc5 | 2012-02-13 08:47:51 +0000 | [diff] [blame] | 131 | vg_old_rev="`get_svn_revision ${svn_old_date} ${valgrind_svn_repo}`" |
| 132 | vg_new_rev="`get_svn_revision ${svn_new_date} ${valgrind_svn_repo}`" |
| 133 | vex_old_rev="`get_svn_revision ${svn_old_date} ${vex_svn_repo}`" |
| 134 | vex_new_rev="`get_svn_revision ${svn_new_date} ${vex_svn_repo}`" |
| 135 | if [ "${vg_old_rev}" = "${vg_new_rev}" -a "${vex_old_rev}" = "${vex_new_rev}" ] |
| 136 | then |
| 137 | echo "Both {$svn_old_date} and {$svn_new_date} correspond to Valgrind r${vg_new_rev} / VEX r${vex_new_rev}"\ |
bart | 8286496 | 2009-04-27 08:04:57 +0000 | [diff] [blame] | 138 | "-- skipping nightly build." >unchanged.log |
| 139 | exit 0 |
| 140 | fi |
| 141 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 142 | # Do everything twice -- once for the 24 hours old Valgrind, and once |
| 143 | # for the current one. |
| 144 | for logfile in old new ; do |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 145 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 146 | # Remove old short and verbose log files, and start the new ones |
| 147 | for ext in short verbose ; do |
| 148 | echo > $logfile.$ext |
| 149 | done |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 150 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 151 | # Choose the current Valgrind, or one from 24 hours ago |
| 152 | if [ $logfile = "old" ] ; then |
| 153 | svn_date=$svn_old_date |
| 154 | else |
| 155 | svn_date=$svn_new_date |
| 156 | fi |
jseward | e2cac93 | 2004-02-25 13:14:39 +0000 | [diff] [blame] | 157 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 158 | # Get dates for the old and new versions |
| 159 | |
| 160 | # Check out, build, run tests |
| 161 | runcmd $logfile \ |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 162 | "Checking out valgrind source tree" \ |
bart | 3bd1fc5 | 2012-02-13 08:47:51 +0000 | [diff] [blame] | 163 | "svn co ${valgrind_svn_repo} -r {$svn_date} valgrind-$logfile\ |
| 164 | && svn update -r {$svn_date} valgrind-$logfile/VEX" && \ |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 165 | \ |
| 166 | runcmd $logfile \ |
| 167 | "Configuring valgrind " \ |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 168 | "cd valgrind-$logfile && ./autogen.sh && ./configure --prefix=`pwd`/valgrind-$logfile/Inst ${ABT_CONFIGURE_OPTIONS}" && \ |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 169 | \ |
| 170 | runcmd $logfile \ |
| 171 | "Building valgrind " \ |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 172 | "cd valgrind-$logfile && make -j ${ABT_JOBS} && make -j ${ABT_JOBS} check && make install" && \ |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 173 | \ |
| 174 | runcmd $logfile \ |
| 175 | "Running regression tests " \ |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 176 | "cd valgrind-$logfile && ${ABT_RUN_REGTEST}" |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 177 | |
florian | dfc9bd1 | 2015-08-03 20:03:41 +0000 | [diff] [blame] | 178 | # Stash away the return code of the regression run |
| 179 | regrun_rc=$? |
| 180 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 181 | # Grab some indicative text for the short log file -- if the regtests |
| 182 | # succeeded, show their results. If we didn't make it that far, show the |
| 183 | # last 20 lines. |
| 184 | egrep -q '^== [0-9]+ tests' $logfile.verbose && ( |
| 185 | echo >> $logfile.short |
| 186 | echo "Regression test results follow" >> $logfile.short |
| 187 | echo >> $logfile.short |
| 188 | awk '/^== [0-9]+ tests/, /^$/ { print }' $logfile.verbose >> $logfile.short |
florian | dfc9bd1 | 2015-08-03 20:03:41 +0000 | [diff] [blame] | 189 | # Check the return code of the regression run; we might have successfully |
| 190 | # run all tests but still failed in the post-regtest checks. |
| 191 | if [ $regrun_rc != "0" ]; then |
| 192 | echo >> $logfile.short |
| 193 | echo "Last 20 lines of verbose log follow" >> $logfile.short \ |
| 194 | echo >> $logfile.short |
| 195 | tail -20 $logfile.verbose >> $logfile.short |
| 196 | fi |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 197 | ) || ( |
| 198 | echo >> $logfile.short |
| 199 | echo "Last 20 lines of verbose log follow" >> $logfile.short \ |
| 200 | echo >> $logfile.short |
| 201 | tail -20 $logfile.verbose >> $logfile.short |
| 202 | ) |
| 203 | done |
| 204 | |
philippe | f31fe6f | 2013-09-27 18:10:29 +0000 | [diff] [blame] | 205 | # if requested, run regression tests and produce results in perflogfile.out |
| 206 | if [ "${ABT_PERF}" != "" ]; then |
| 207 | cd valgrind-new |
| 208 | echo ${ABT_PERF_TOOLS} ${ABT_PERF_REPS} ${ABT_PERF} > ../perflogfile |
| 209 | (time perl perf/vg_perf ${ABT_PERF_TOOLS} ${ABT_PERF_REPS} ${ABT_PERF} perf) >> ../perflogfile 2>&1 |
| 210 | cd .. |
| 211 | fi |
| 212 | |
| 213 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 214 | #---------------------------------------------------------------------------- |
| 215 | # Prepare results and send |
| 216 | #---------------------------------------------------------------------------- |
| 217 | |
njn | 951c826 | 2009-06-04 02:25:39 +0000 | [diff] [blame] | 218 | # Get times and date |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 219 | END=`date "+%F %H:%M:%S %Z"` |
njn | 951c826 | 2009-06-04 02:25:39 +0000 | [diff] [blame] | 220 | |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 221 | # Gather some information about this run and its environment |
| 222 | valgrind_revision="`svn info valgrind-new | grep Revision | sed 's/Revision[ ]*:[ ]*//'`" |
| 223 | vex_revision="`svn info valgrind-new/VEX | grep Revision | sed 's/Revision[ ]*:[ ]*//'`" |
florian | 6a27ab3 | 2011-11-03 02:10:02 +0000 | [diff] [blame] | 224 | gcc_version="`gcc --version 2> /dev/null | head -1`" |
philippe | dd6c514 | 2013-01-23 21:46:22 +0000 | [diff] [blame] | 225 | gdb_version="`gdb --version 2> /dev/null | head -1`" |
florian | 6a27ab3 | 2011-11-03 02:10:02 +0000 | [diff] [blame] | 226 | as_version="`as --version 2> /dev/null | head -1`" |
mjw | 76f2cb1 | 2014-09-06 17:37:54 +0000 | [diff] [blame] | 227 | libc_so="`ls -1 /lib/libc.so.* /lib64/libc.so.* /lib32/libc.so.* /lib/*-linux-gnu/libc.so.* 2>/dev/null | tail -1`" |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 228 | libc="unknown" |
| 229 | if [ "x$libc_so" != "x" ]; then |
| 230 | if [ -e "$libc_so" -a -r "$libc_so" ]; then |
mjw | f2c0230 | 2014-09-03 17:06:05 +0000 | [diff] [blame] | 231 | libc="`$libc_so | head -1`" |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 232 | fi |
| 233 | fi |
florian | 472e42d | 2011-11-24 16:07:41 +0000 | [diff] [blame] | 234 | libc=`echo $libc | sed "s/, by Roland.*//"` |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 235 | uname_stuff="`uname -mrs`" |
mjw | ac5aafe | 2014-09-06 17:37:55 +0000 | [diff] [blame] | 236 | if [ -r /etc/os-release ]; then |
mjw | 83b18f4 | 2014-09-06 18:33:14 +0000 | [diff] [blame] | 237 | vendor_stuff="`. /etc/os-release; echo ${NAME} ${VERSION}`" |
mjw | ac5aafe | 2014-09-06 17:37:55 +0000 | [diff] [blame] | 238 | elif which lsb_release 2>&1 > /dev/null; then |
| 239 | vendor_stuff="`lsb_release -sicr | xargs echo`" |
| 240 | elif [ -e "/etc/issue.net" -a -r "/etc/issue.net" ]; then |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 241 | vendor_stuff="`cat /etc/issue.net | head -1`" |
| 242 | else |
| 243 | vendor_stuff="unknown" |
| 244 | fi |
| 245 | |
| 246 | echo "valgrind revision: $valgrind_revision" > final |
| 247 | echo "VEX revision: $vex_revision" >> final |
florian | 6a27ab3 | 2011-11-03 02:10:02 +0000 | [diff] [blame] | 248 | echo "C compiler: $gcc_version" >> final |
philippe | dd6c514 | 2013-01-23 21:46:22 +0000 | [diff] [blame] | 249 | echo "GDB: $gdb_version" >> final |
florian | 6a27ab3 | 2011-11-03 02:10:02 +0000 | [diff] [blame] | 250 | echo "Assembler: $as_version" >> final |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 251 | echo "C library: $libc" >> final |
| 252 | echo "uname -mrs: $uname_stuff" >> final |
| 253 | echo "Vendor version: $vendor_stuff" >> final |
| 254 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 255 | # 'final' shows the difference between the old and new results |
florian | 84ada6b | 2011-10-04 16:53:34 +0000 | [diff] [blame] | 256 | echo >> final |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 257 | echo "Nightly build on" $TAG "(" $ABT_DETAILS ")" >> final |
| 258 | echo "Started at" $START >> final |
| 259 | echo "Ended at" $END >> final |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 260 | |
njn | 2e3fcf3 | 2005-08-16 03:28:47 +0000 | [diff] [blame] | 261 | # If the results differ from 24 hours ago, print extra stuff. |
| 262 | diff -C1 old.short new.short > diff.short |
| 263 | changed=$? |
| 264 | |
| 265 | if [ $changed != 0 ] ; then |
| 266 | echo "Results differ from 24 hours ago" >> final |
njn | cec804b | 2009-03-10 03:38:05 +0000 | [diff] [blame] | 267 | changed_str="" |
njn | 2e3fcf3 | 2005-08-16 03:28:47 +0000 | [diff] [blame] | 268 | else |
| 269 | echo "Results unchanged from 24 hours ago" >> final |
njn | cec804b | 2009-03-10 03:38:05 +0000 | [diff] [blame] | 270 | changed_str="(unchanged) " |
njn | 2e3fcf3 | 2005-08-16 03:28:47 +0000 | [diff] [blame] | 271 | fi |
| 272 | |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 273 | # Always show the current results. |
| 274 | cat new.short >> final |
| 275 | |
njn | 2e3fcf3 | 2005-08-16 03:28:47 +0000 | [diff] [blame] | 276 | if [ $changed != 0 ] ; then |
njn | f0e0a64 | 2005-07-21 21:26:07 +0000 | [diff] [blame] | 277 | echo "=================================================" >> final |
| 278 | echo "== Results from 24 hours ago ==" >> final |
| 279 | echo "=================================================" >> final |
| 280 | cat old.short >> final |
| 281 | |
| 282 | echo >> final |
| 283 | echo "=================================================" >> final |
| 284 | echo "== Difference between 24 hours ago and now ==" >> final |
| 285 | echo "=================================================" >> final |
| 286 | echo >> final |
| 287 | cat diff.short >> final |
| 288 | echo >> final |
| 289 | fi |
| 290 | |
philippe | f31fe6f | 2013-09-27 18:10:29 +0000 | [diff] [blame] | 291 | # add perf results if requested |
| 292 | if [ "${ABT_PERF}" != "" ]; then |
| 293 | cat perflogfile >> final |
| 294 | fi |
| 295 | |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 296 | # Gather up the diffs (at most the first 100 lines for each one) into a |
| 297 | # single file. |
| 298 | MAX_LINES=100 |
bart | 3040125 | 2009-01-12 11:06:05 +0000 | [diff] [blame] | 299 | diff_files=`find . -name '*.diff*' | sort` |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 300 | if [ z"$diff_files" = z ] ; then |
| 301 | echo "Congratulations, all tests passed!" >> diffs |
| 302 | else |
| 303 | for i in $diff_files ; do |
| 304 | echo "=================================================" >> diffs |
| 305 | echo $i >> diffs |
| 306 | echo "=================================================" >> diffs |
| 307 | if [ `wc -l < $i` -le $MAX_LINES ] ; then |
| 308 | cat $i >> diffs |
| 309 | else |
njn | 1f2df3e | 2009-01-07 08:08:41 +0000 | [diff] [blame] | 310 | head -n $MAX_LINES $i >> diffs |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 311 | echo "<truncated beyond $MAX_LINES lines>" >> diffs |
| 312 | fi |
| 313 | done |
| 314 | fi |
| 315 | |
bart | 72e4063 | 2011-07-30 11:26:57 +0000 | [diff] [blame] | 316 | # Rename diffs into diffs.txt such that it can be viewed easily with an |
| 317 | # e-mail client. |
| 318 | mv diffs diffs.txt |
| 319 | |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 320 | # Use the conf/<tag>.sendmail script to email the results. |
njn | e43358f | 2009-06-04 23:17:12 +0000 | [diff] [blame] | 321 | conf/$TAG.sendmail \ |
| 322 | "$changed_str$START nightly build ($TAG, $ABT_DETAILS)" \ |
njn | df8a111 | 2009-01-07 06:19:03 +0000 | [diff] [blame] | 323 | final \ |
bart | 72e4063 | 2011-07-30 11:26:57 +0000 | [diff] [blame] | 324 | diffs.txt > sendmail.log 2>&1 |