--- MITgcm/verification/testreport 2003/09/01 16:50:27 1.2 +++ MITgcm/verification/testreport 2003/09/06 02:45:07 1.5 @@ -1,6 +1,6 @@ #!/bin/bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.2 2003/09/01 16:50:27 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.5 2003/09/06 02:45:07 edhill Exp $ # usage() @@ -13,6 +13,8 @@ echo " (-optfile=|-of=)STRING list of genmake2 \"optfiles\"" echo " (-a|-addr)STRING list of email recipients" echo " (-t|-tdir)STRING list of \"test\" dirs" + echo " (-b|-bash)STRING the \"bash\" executable" + echo " (-m|-make)STRING the \"make\" executable" echo exit 1 } @@ -29,7 +31,7 @@ exit 1 fi echo -n "building mpack... " - ( cd $MPACKDIR && ./configure && make ) > build_mpack.out 2>&1 + ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then echo @@ -160,12 +162,12 @@ genmakemodel() { # genmakemodel directory - GENMAKE2="../../../tools/genmake2" + GENMAKE2="$BASH ../../../tools/genmake2" ( cd $1; printf 'genmake ... ' 1>&2 # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 - $GENMAKE2 -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 + $GENMAKE2 -make $MAKE -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 RETVAL=$? for i in gm_state gm_optfile gm_local Makefile ; do if test -r $i ; then @@ -191,7 +193,7 @@ rm -f output.txt printf 'make CLEAN ... ' 2>&1 if test -r Makefile ; then - make CLEAN >> make.log 2>&1 + $MAKE CLEAN >> make.log 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then tail make.log @@ -211,7 +213,7 @@ ( cd $1; printf 'make depend ... ' 1>&2 - make depend >> make.log 2>&1 + $MAKE depend >> make.log 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then tail make.log @@ -231,7 +233,7 @@ cd $1; if test -r Makefile ; then printf 'make ... ' 1>&2 - make >> make.log 2>&1 + $MAKE >> make.log 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then tail make.log @@ -267,7 +269,7 @@ rm -f output.txt fi printf 'runmodel: ' 1>&2 - make output.txt + $MAKE output.txt RETVAL=$? if test "x$RETVAL" = x0 ; then cp output.txt $CDIR"/output.txt" @@ -315,7 +317,7 @@ return 0 else echo - echo "createcodelet: failed to compile codelet" | tee + echo "createcodelet: failed to compile codelet" exit 1 fi } @@ -388,11 +390,13 @@ ieee=1 expts='' +BASH= OPTFILES= ADDRESSES=edhill@mitgcm.org TESTDIRS= MPACKDIR="../tools/mpack-1.6" MPACK="$MPACKDIR/mpack" +MAKE=make echo -n "parsing options... " @@ -428,6 +432,16 @@ -tdir=* | --tdir=*) TESTDIRS=$ac_optarg ;; + -bash | --bash | -b | --b) + ac_prev=BASH ;; + -bash=* | --bash=*) + BASH=$ac_optarg ;; + + -make | --make | -m | --m) + ac_prev=MAKE ;; + -make=* | --make=*) + MAKE=$ac_optarg ;; + -quick) quick=1 ;; -verbose) verbose=2 ;; -debug) debug=1 ;; @@ -505,6 +519,15 @@ # ...and each test directory... for dir in $TESTDIRS ; do + + # Verify that the testdir exists and contains previous + # results in the correct location--or skip this directory! + if test ! -r $dir"/results/output.txt" ; then + echo | tee -a $SUMMARY + echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \ + | tee -a $SUMMARY + continue + fi # Create an output dir for each OPTFILE/tdir combination CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR @@ -530,15 +553,6 @@ rundir=input fi - # Verify that the testdir exists and contains previous - # results in the correct location--or skip this directory! - if test ! -r $dir"/results/output.txt" ; then - echo | tee $SUMMARY - echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \ - | tee $SUMMARY - continue - fi - genmakemodel $dir/$builddir && genmake=Y \ && makeclean $dir/$builddir \ && makedependmodel $dir/$builddir && makedepend=Y \