--- MITgcm/verification/testscript 2001/08/15 17:17:01 1.14 +++ MITgcm/verification/testscript 2001/08/21 15:21:10 1.17 @@ -143,6 +143,7 @@ # makedependmodel directory ( cd $1; if [ $clean -gt 0 ]; then + rm -f output.txt printf 'make clean ... ' 2>&1 make CLEAN >> make.log 2>&1 if [ $? -ne 0 ]; then @@ -201,17 +202,25 @@ ( cd $1 if [ -x $2 ]; then - if [ ! -r output.txt -o $quick -eq 0 ]; then - echo runmodel: running... 1>&2 - ( ./$2 > output.txt 2>&1 ) && return 0 - return 1 - else - echo runmodel: output.txt is newer than executable 1>&2 - return 0 + if [ $quick -eq 0 ]; then + rm -f output.txt fi - else - echo runmodel: executable \"$1/$2\" is missing 1>&2 - return 1 + echo -n "runmodel: " 1>&2 + make output.txt && return 0 +# if [ ! -r output.txt -o $quick -eq 0 ]; then +# echo runmodel: running... 1>&2 +# ( ./$2 > output.txt 2>&1 ) && return 0 +# rm -f output.txt +# ( make output.txt ) && return 0 +# return 1 +# else +# echo runmodel: output.txt is newer than executable 1>&2 +# ( make output.txt ) && return 0 +# return 0 +# fi +# else +# echo runmodel: executable \"$1/$2\" is missing 1>&2 +# return 1 fi ) } @@ -335,6 +344,12 @@ esac done +if [ $clean -gt 0 -a $quick -gt 0 ]; then + echo You specified -quick and -clean together which conflict. + echo Please specify either -quick or -clean or neither but not both. + exit 1 +fi + #if [ ${#expts} -eq 0 ]; then # echo Scanning all directories # for arg in * @@ -385,7 +400,8 @@ && makedependmodel $dir/input && makedepend=Y \ && makemodel $dir/input && make=Y \ && runmodel $dir/input mitgcmuv && run=Y \ - && results=`testoutput $dir` + && results=`testoutput $dir` \ + && makeclean $dir/input echo formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results echo