[m-dev.] diff: include branch name in test log file names

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Mar 11 17:29:51 AEDT 2001


Estimated hours taken: 0.5
Branches: main

tools/run_all_tests_from_cron:
tools/test_mercury:
	Include the branch name in the test log file names.

Workspace: /home/mercury/public/test_mercury/scripts/mercury
Index: tools/run_all_tests_from_cron
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/run_all_tests_from_cron,v
retrieving revision 1.27
diff -u -d -r1.27 run_all_tests_from_cron
--- tools/run_all_tests_from_cron	2001/03/05 19:10:18	1.27
+++ tools/run_all_tests_from_cron	2001/03/11 06:27:19
@@ -75,11 +75,40 @@
 
 #-----------------------------------------------------------------------------#
 
-echo run_test $HOST
+DAY=`date '+%e'`
+case $HOST in
+	murlibobo|taifun|hg|hydra)
+		#
+		# For these hosts:
+		# On odd-numbered days, test the release branch.
+		# On even-numbered days, test the main branch.
+		#
+		case $DAY in
+			*[13579]) BRANCH=0.10 ;;
+			*)	  BRANCH=latest ;;
+		esac
+		;;
+	*)
+		#
+		# For the remaining hosts, do the reverse:
+		# On odd-numbered days, test the main branch.
+		# On even-numbered days, test the release branch.
+		#
+		case $DAY in
+			*[13579]) BRANCH=latest ;;
+			*)	  BRANCH=0.10 ;;
+		esac
+		;;
+esac
+
+#-----------------------------------------------------------------------------#
+
+echo run_test $HOST $C_COMPILER
+echo branch $BRANCH
 
 case "$C_COMPILER" in
-	gcc)	logname="test_mercury_$HOST.out" ;;
-	*)	logname="test_mercury_$HOST-$C_COMPILER.out" ;;
+	gcc)	logname="test-$BRANCH-$HOST.out" ;;
+	*)	logname="test-$BRANCH-$HOST-$C_COMPILER.out" ;;
 esac
 
 mv -f $tm_dir/logs/old/$logname $tm_dir/logs/old2 2>/dev/null
@@ -91,7 +120,7 @@
 {
 echo "Subject: Mercury auto-test on $HOST (with $C_COMPILER)"
 echo
-if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH $C_COMPILER \
+if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH $BRANCH $C_COMPILER \
 		> $logfile 2>&1
 then
 	echo test passed
@@ -107,14 +136,14 @@
 	ls -l mercury_compile
 	size mercury_compile
 	{
-		echo $FULLARCH $HOST
+		echo $FULLARCH $BRANCH $HOST $C_COMPILER
 		ls -l mercury_compile
 		size mercury_compile
 		echo
 	} >> $tm_dir/logs/sizes
 else
 	echo test FAILED
-	echo log file in $tm_dir/logs/test_mercury_$HOST.out
+	echo log file in $logfile
 	echo
 	echo last 20 lines of log file:
 	tail -20 $logfile
Index: tools/test_mercury
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/test_mercury,v
retrieving revision 1.144
diff -u -d -r1.144 test_mercury
--- tools/test_mercury	2001/03/05 19:10:18	1.144
+++ tools/test_mercury	2001/03/11 06:14:42
@@ -11,7 +11,7 @@
 echo "test_mercury starting at `date`" 1>&2
 
 case $# in
-	4)	HOST=$1; ARCH=$2; FULLARCH=$3; C_COMPILER=$4 ;;
+	5)	HOST=$1; ARCH=$2; FULLARCH=$3; BRANCH=$4; C_COMPILER=$5 ;;
 	*)	echo "Usage: $0 host arch fullarch c_compiler" 1>&2; exit 1 ;;
 esac
 
@@ -42,38 +42,19 @@
 
 #-----------------------------------------------------------------------------#
 
-DATE=`date '+%Y-%m-%d'`
-DAY=`date '+%e'`
-
-case $HOST in
-	murlibobo|taifun|hg|hydra)
-		#
-		# For these hosts:
-		# On odd-numbered days, test the release branch.
-		# On even-numbered days, test the main branch.
-		#
-		case $DAY in
-			*[13579]) INSTALL_DIR_NAME=mercury-0.10 ;;
-			*)	  INSTALL_DIR_NAME=mercury-latest ;;
-		esac
-		;;
-	*)
-		#
-		# For the remaining hosts, do the reverse:
-		# On odd-numbered days, test the main branch.
-		# On even-numbered days, test the release branch.
-		#
-		case $DAY in
-			*[13579]) INSTALL_DIR_NAME=mercury-latest ;;
-			*)	  INSTALL_DIR_NAME=mercury-0.10 ;;
-		esac
-		;;
-esac
-
 #
 # We set the following variables according to which
 # branch we're testing.
 #
+# BRANCH:
+# An abstract name for the branch, i.e. `0.10' or `latest'.
+# This is not the same as the branch name used by CVS.
+#
+# INSTALL_DIR_NAME:
+# The name of the directory in which to install this branch.
+# (Not the full path, just the final directory name.)
+# More generally used for naming stuff related to this branch.
+#
 # CHECKOUT_OPTS:
 # Options to pass to cvs checkout.
 #
@@ -94,14 +75,16 @@
 # This should usually be the same as $RELEASE_VERSION,
 # but with `*' instead of $DATE.
 #
-case $INSTALL_DIR_NAME in
-	mercury-latest)
+INSTALL_DIR_NAME=mercury-$BRANCH
+DATE=`date '+%Y-%m-%d'`
+case $BRANCH in
+	latest)
 		CHECKOUT_OPTS=-A
 		BASE_TAG_NAME=rotd
 		RELEASE_VERSION=rotd-$DATE
 		RELEASE_VERSION_PATTERN=rotd-*
 		;;
-	mercury-0.10)
+	0.10)
 		#CHECKOUT_OPTS=-rversion-0_10
 		#BASE_TAG_NAME=version-0_10_y
 		#RELEASE_VERSION=0.10
@@ -201,13 +184,13 @@
 		# due to a bug in the DEC loader, INSTALL_DIR should be
 		# as short as possible, to avoid overflow of fixed length
 		# buffers for -rpath options. The above definition is too long.
-		case $INSTALL_DIR_NAME in
-		mercury-latest) INSTALL_DIR=/home/mercury/public/.a ;;
-		mercury-0.8)	INSTALL_DIR=/home/mercury/public/.b ;;
-		mercury-0.9)	INSTALL_DIR=/home/mercury/public/.c ;;
-		mercury-0.10)	INSTALL_DIR=/home/mercury/public/.d ;;
+		case $BRANCH in
+		latest) INSTALL_DIR=/home/mercury/public/.a ;;
+		0.8)	INSTALL_DIR=/home/mercury/public/.b ;;
+		0.9)	INSTALL_DIR=/home/mercury/public/.c ;;
+		0.10)	INSTALL_DIR=/home/mercury/public/.d ;;
 		*)
-			echo "unknown INSTALL_DIR_NAME \`$INSTALL_DIR_NAME'!"
+			echo "unknown BRANCH \`$BRANCH'!"
 			exit 1
 			;;
 		esac

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list