- Only send e-mail if any changes were committed in the Subversion
  repository during the last 24 hours.
- E-mail sent by this script now includes the revision numbers of the
  revisions that have been compared by this script.
- Moved section with differences from bottom to top of output.
- Changed diff options from -C1 to -u.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@769 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2009-04-11 08:32:15 +00:00
parent bbfce9739f
commit f8b0c59cf2
+32 -13
View File
@@ -5,10 +5,16 @@
# ago with the current one. See the README.txt on how to run it.
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Helper function
# Helper functions
#----------------------------------------------------------------------------
# Returns the revision number of the source files with date $1.
get_svn_revision() {
svn info -r "{$1}" "${scst_svn_repo}" | sed -n 's/^Revision: //p'
}
runcmd () {
logfile="$1"
str="$2"
@@ -38,6 +44,9 @@ runcmd () {
#----------------------------------------------------------------------------
# Startup
#----------------------------------------------------------------------------
scst_svn_repo="https://scst.svn.sourceforge.net/svnroot/scst/trunk"
# Must have exactly one argument
if [ "$#" -ne 1 ] ; then
echo "usage: $0 <tag>"
@@ -78,6 +87,13 @@ fi
# Check out, build, test
#----------------------------------------------------------------------------
svn_old_rev="`get_svn_revision ${svn_old_date}`"
svn_new_rev="`get_svn_revision ${svn_new_date}`"
if [ "${svn_old_rev}" = "${svn_new_rev}" ]; then
echo "No changes have been committed between ${svn_old_date} (r${svn_old_rev}) and ${svn_new_date} (r${svn_new_rev})."
exit 0
fi
# Do everything twice -- once for the 24 hours old SCST, and once
# for the current one.
for logfile in old new ; do
@@ -101,7 +117,7 @@ for logfile in old new ; do
# Check out and run the tests.
runcmd ${logfile} \
"Checking out SCST source tree" \
"svn co -q -r {${svn_date}} https://scst.svn.sourceforge.net/svnroot/scst/trunk ${ABT_TMPDIR}/scst" && \
"svn co -q -r {${svn_date}} ${scst_svn_repo} ${ABT_TMPDIR}/scst" && \
runcmd ${logfile} \
"Running regression tests" \
"cd ${ABT_TMPDIR}/scst && scripts/run-regression-tests -d ${ABT_TMPDIR}/regtest -j ${ABT_JOBS} -q ${ABT_KERNELS}"
@@ -118,12 +134,13 @@ done
#----------------------------------------------------------------------------
# 'final' shows the difference between the old and new results
echo > final
echo "Nightly build on" $ABT_MACHINE "(" $ABT_DETAILS ")" \
"started at" $ABT_START >> final
echo > final
echo "Nightly build on $ABT_MACHINE ($ABT_DETAILS)" >> final
echo "started at $ABT_START and compared r${svn_old_rev} with r${svn_new_rev}." \
>> final
# If the results differ from 24 hours ago, print extra stuff.
diff -C1 old.short new.short > diff.short
diff -u old.short new.short > diff.short
changed=$?
if [ $changed != 0 ] ; then
@@ -134,6 +151,15 @@ else
changed_str="(unchanged) "
fi
if [ $changed != 0 ] ; then
echo "=================================================" >> final
echo "== Difference between 24 hours ago and now ==" >> final
echo "=================================================" >> final
echo >> final
cat diff.short >> final
echo >> final
fi
# Always show the current results.
echo >> final
echo "=================================================" >> final
@@ -147,13 +173,6 @@ if [ $changed != 0 ] ; then
echo "== Results from 24 hours ago ==" >> final
echo "=================================================" >> final
cat old.short >> final
echo >> final
echo "=================================================" >> final
echo "== Difference between 24 hours ago and now ==" >> final
echo "=================================================" >> final
echo >> final
cat diff.short >> final
echo >> final
fi