[m-dev.] diff: test with lcc

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 7 19:20:29 AEDT 2001


Estimated hours taken: 0.5

Support testing with lcc.

tools/run_all_test_from_cron:
	Add an optional second argument, namely the C compiler to test with.
	This defaults to `gcc'.  Pass this on to tools/test_mercury.

	Also preserve the last three copies of the log files,
	rather than just the last two.  This is useful when
	running different tests at different times.

tools/test_mercury:
	Add a fourth argument, namely the C compiler to test with.
	Set CC to this argument before running configure.
	Include this argument in various components, e.g. the
	name of the install directory, and the successful_tests 
	log file, etc.
	Set things up for testing with lcc on venus.

cvs diff: Diffing .
Index: run_all_tests_from_cron
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/run_all_tests_from_cron,v
retrieving revision 1.24
diff -u -d -u -r1.24 run_all_tests_from_cron
--- run_all_tests_from_cron	2001/02/04 04:59:09	1.24
+++ run_all_tests_from_cron	2001/02/04 05:09:25
@@ -19,9 +19,11 @@
 
 ulimit -c 0
 
+C_COMPILER=gcc
 case $# in
 	1)	HOST=$1 ;;
-	*)	echo "Usage: $0 host" 1>&2; exit 1 ;;
+	2)	HOST=$1; C_COMPILER=$2 ;;
+	*)	echo "Usage: $0 host [c-compiler]" 1>&2; exit 1 ;;
 esac
 
 case $HOST in
@@ -39,7 +41,7 @@
 	venus)		ARCH=i686	FULLARCH=i686-pc-linux-gnu ;;
 	*)		echo "$0: unknown HOST $HOST" 1>&2; exit 1 ;;
 esac
-
+	
 case $HOST in
 	kryten|taifun) 	mail="rsh mundook /bin/mail" ;;
 	hydra|ender|roy|venus) mail=/usr/bin/mail ;;
@@ -74,6 +76,7 @@
 
 echo run_test $HOST
 
+mv -f $tm_dir/logs/old/test_mercury_$HOST.out $tm_dir/logs/old2 2>/dev/null
 mv -f $tm_dir/logs/test_mercury_$HOST.out $tm_dir/logs/old 2>/dev/null
 
 tmpfile=/tmp/run_test$$
@@ -83,7 +86,7 @@
 echo
 logfile=$tm_dir/logs/test_mercury_$HOST.out
 
-if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH \
+if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH $C_COMPILER \
 		> $logfile 2>&1
 then
 	echo test passed
Index: test_mercury
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/test_mercury,v
retrieving revision 1.135
diff -u -d -u -r1.135 test_mercury
--- test_mercury	2001/02/06 07:11:48	1.135
+++ test_mercury	2001/02/07 08:15:34
@@ -11,8 +11,8 @@
 echo "test_mercury starting at `date`" 1>&2
 
 case $# in
-	3)	HOST=$1; ARCH=$2; FULLARCH=$3 ;;
-	*)	echo "Usage: $0 host arch fullarch" 1>&2; exit 1 ;;
+	4)	HOST=$1; ARCH=$2; FULLARCH=$3; C_COMPILER=$4 ;;
+	*)	echo "Usage: $0 host arch fullarch c_compiler" 1>&2; exit 1 ;;
 esac
 
 PATH="$HOME/bin/$ARCH`awk '/^[^#]/{printf ":%s",$0;}' /home/pgrad/fjh/.path`"
@@ -120,7 +120,10 @@
 	roy) 		OPTIMIZE=-O4 ;;	# hlc
 	hydra)		OPTIMIZE=-O2 ;;
 	ender)		OPTIMIZE=-O3 ;;
-	venus) 		OPTIMIZE=-O5 ;;
+	venus) 		case $C_COMPILER in
+				gcc)	OPTIMIZE=-O5 ;;
+				*)	OPTIMIZE=-O2 ;;
+			esac ;;
 	kryten) 	OPTIMIZE=-O1 ;;	# currently not used
 	rimmer) 	OPTIMIZE=-O1 ;; # currently not used
 esac
@@ -165,11 +168,15 @@
 DIR=$TESTDIR/test_dirs/$HOST
 
 case $HOST in
-	hg|ender|roy|venus)
+	hg|ender|roy|venus) 	
 		INSTALL_DIR=/home/$HOST/public/$INSTALL_DIR_NAME/$FULLARCH ;;
 	*)		
 		INSTALL_DIR=/home/mercury/public/$INSTALL_DIR_NAME/$FULLARCH ;;
 esac
+case $C_COMPILER in
+	gcc)	;;
+	*)	INSTALL_DIR="$INSTALL_DIR-$C_COMPILER" ;;
+esac
 
 BETA_FTPHOST=ftp.mercury.cs.mu.oz.au
 BETA_FTPDIR=/home/ftp/pub/mercury/beta-releases
@@ -363,6 +370,8 @@
 
 autoconf || { false; exit 1; }
 rm -f config.cache
+CC=$C_COMPILER
+export CC
 ./configure --prefix=$INSTALL_DIR $CONFIG_OPTS || { false; exit 1; }
 mmake depend $PARALLEL || { false; exit 1; }
 mmake realclean MMAKEFLAGS=$PARALLEL || { false; exit 1; }
@@ -445,7 +454,10 @@
 		GRADES="asm_fast.gc.tr asm_fast.tr"
 		;;
 	hg|quicksilver|hydra|ender|kryten|taifun|venus)
-		GRADES="asm_fast.gc.tr"
+		case $C_COMPILER in
+			gcc)	GRADES="asm_fast.gc.tr" ;;
+			*)	GRADES="" ;;
+		esac
 		;;
 	roy)
 		GRADES="hlc.gc.tr hl.gc.tr"
@@ -570,10 +582,15 @@
 			asm_fast.par.gc hlc.gc"
 		;;
 	venus)
-		GRADES="asm_fast.gc asm_fast
-			asm_fast.gc.prof asm_fast.prof
-			asm_fast.gc.memprof asm_fast.gc.tr asm_fast.gc.tr.debug
-			hlc.gc"
+		case $C_COMPILER in
+			gcc)	GRADES="asm_fast.gc asm_fast
+				asm_fast.gc.prof asm_fast.prof
+				asm_fast.gc.memprof asm_fast.gc.tr asm_fast.gc.tr.debug
+				hlc.gc" ;;
+			*)	GRADES="none.gc none none.gc.prof
+				none.prof none.gc.memprof none.gc.tr
+				none.gc.debug.tr.debug hlc.gc" ;;
+		esac
 		;;
 	roy)
 		GRADES="hlc.gc hlc.gc.prof hlc.gc.memprof hlc.gc.tr hlc.par.gc
@@ -704,6 +721,11 @@
 		;;
 esac
 
+case $C_COMPILER in
+	gcc)	;;
+	*)	fullname="$fullname-$C_COMPILER" ;;
+esac
+
 # cvs does not allow `.' in tag names, so we use `_' instead
 fullname_tag=`echo $fullname | tr . _`
 
@@ -746,7 +768,10 @@
     0)
 	: if we get this far, then it worked.
 	[ -d $TESTDIR/logs ] || mkdir -p $TESTDIR/logs
-	date >> $TESTDIR/logs/successful_tests.$INSTALL_DIR_NAME.$HOST
+	case $C_COMPILER in
+		gcc) date >> $TESTDIR/logs/successful_tests.$INSTALL_DIR_NAME.$HOST ;;
+		*) date >> $TESTDIR/logs/successful_tests.$INSTALL_DIR_NAME.$HOST."$C_COMPILER" ;;
+	esac
 	case $HOST in murlibobo)
 	    cd $DIR &&
 		# Delete older stable versions that this one replaces

-- 
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