From abb6a9626b5e86409fa706db8ea3c937cf96ad64 Mon Sep 17 00:00:00 2001 From: Ger van Diepen <diepen@astron.nl> Date: Mon, 24 Jul 2006 11:36:51 +0000 Subject: [PATCH] BugID: 819 Added option -stdout --- autoconf_share/Makefile.common | 9 +++++++++ autoconf_share/assay | 21 ++++++++++----------- autoconf_share/runtest.sh | 29 +++++++++++++++++++++++------ autoconf_share/variants.lofar17 | 2 +- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/autoconf_share/Makefile.common b/autoconf_share/Makefile.common index 5b2c016384d..e62a9e73bec 100644 --- a/autoconf_share/Makefile.common +++ b/autoconf_share/Makefile.common @@ -260,3 +260,12 @@ help: @echo "dist make a distribution"; @echo "distcheck make and check a distribution"; @echo "rpm make an rpm"; + +# Define the default variables to export to the test scripts. +#TESTS_ENVIRONMENT = LOFARROOT="$(LOFARROOT)" \ +# lofar_sharedir="$(lofar_sharedir)" \ +# top_srcdir="$(top_srcdir)" \ +# srcdir="$(srcdir)" \ +# CHECKTOOLPROGS="$(CHECKTOOLPROGS)" \ +# MPIBIN="$(MPIBIN)" \ +# AIPSPP="$(AIPSPP)" diff --git a/autoconf_share/assay b/autoconf_share/assay index 6edb939d5a0..a45398e7c08 100755 --- a/autoconf_share/assay +++ b/autoconf_share/assay @@ -24,7 +24,7 @@ #----------------------------------------------------------------------------- -# Usage: assay <testexe> <max run-time(sec)> <precision> [<arguments>] +# Usage: assay <testexe> <max run-time(sec)> <precision> <needoutfil> [<arguments>] #----------------------------------------------------------------------------- # This script is an adapted version of the AIPS++ assay script. # @@ -139,6 +139,8 @@ shift PREC=$1 shift + NEEDOUTFIL=$1 + shift # Use LimitExec if available if [ -x $LOFARROOT/bin/LimitExec ] @@ -201,16 +203,12 @@ then CAT=cat else - echo "PASS (execution succeeded): $PROG" - exit - fi - ;; - 2) - if [ -f $PROG.stdout ] - then - CAT=cat - else - echo "FAIL (reference output file missing): $PROG" + if [ "$NEEDOUTFIL" = 1 ]; then + echo "FAIL (reference output file missing): $PROG" + STATUS=2 + else + echo "PASS (execution succeeded): $PROG" + fi exit fi ;; @@ -251,6 +249,7 @@ sed -e 's/[+-]\?\(\(\([0-9]\+\)\|\([0-9]*\.\?[0-9]*\)\)\(e[+-]\?[0-9]\+\)\?\)/x/g' ${PROG}_tmp.out > ${PROG}_tmp.out2 sed -e 's/[+-]\?\(\(\([0-9]\+\)\|\([0-9]*\.\?[0-9]*\)\)\(e[+-]\?[0-9]\+\)\?\)/x/g' ${PROG}_tmp_orig.out > ${PROG}_tmp_orig.out2 diff ${PROG}_tmp.out2 ${PROG}_tmp_orig.out2 > /dev/null 2>&1 + diff ${PROG}_tmp.out2 ${PROG}_tmp_orig.out2 > /dev/null 2>&1 if [ $? != 0 ] then echo "FAIL (output not verified): $PROG" diff --git a/autoconf_share/runtest.sh b/autoconf_share/runtest.sh index 8ca2bba4bf2..98d18812fc0 100755 --- a/autoconf_share/runtest.sh +++ b/autoconf_share/runtest.sh @@ -22,19 +22,36 @@ # # $Id$ +# Set default options. +NEEDOUTFIL=0; + +# Handle possible options. +while [ $# != 0 ] +do + # Special cvs command? + if [ "$1" = "-stdout" ]; then + NEEDOUTFIL=1 + shift + elif [ "$1" = "-nostdout" ]; then + NEEDOUTFIL=0 + shift + else + break + fi +done if test $# -lt 1 || test $# -gt 3; then - echo "usage: runtest.sh <testname> [<max run-time>] [<precision>]" - exit 0 + echo "usage: runtest.sh [-stdout] <testname> [<max run-time>] [<precision>]" + exit 1 fi -if test $# -ge 2; then +if [ "$2" != "" ]; then MAXTIME=$2 else MAXTIME=300 # 300 seconds == 5 minutes fi -if test $# -ge 3; then +if [ "$3" != "" ]; then PREC=$3 else PREC=1e-5 @@ -114,13 +131,13 @@ else sed -e "s/<LOGFILENAME>/$1_tmp.log/" $lfr_share_dir/default.log_prop > $1.log_prop fi fi - + # # Define source directory and run assay # LOFAR_PKGSRCDIR=$srcdir export LOFAR_PKGSRCDIR -$lfr_share_dir/assay $1 $MAXTIME $PREC +$lfr_share_dir/assay $1 $MAXTIME $PREC $NEEDOUTFIL STS=$? # Cleanup (mainly for make distcheck). diff --git a/autoconf_share/variants.lofar17 b/autoconf_share/variants.lofar17 index 6f954260659..c00563e273f 100644 --- a/autoconf_share/variants.lofar17 +++ b/autoconf_share/variants.lofar17 @@ -2,7 +2,7 @@ gnu3.compiler.conf: CXX="$CCACHE /usr/bin/g++" gnu3.compiler.aipspp.var: --with-aipspp=/lofarbuild/aips++/prod/linux_gnu gnu.compiler.conf: CXX="$CCACHE /usr/bin/g++" -gnu.compiler.aipspp.var: --with-aipspp=/lofarbuild/aips++/prod/linux_gnu +gnu.compiler.aipspp.var: --with-aipspp=/lofarbuild/aips++/dev/linux_gnu --with-lapack=/usr gnu34.compiler.conf: CXX="$CCACHE /usr/local/gcc343/bin/g++" --with-ldflags="-Wl,--rpath,/usr/local/gcc343/lib" gnu34.compiler.aipspp.var: --with-aipspp=/lofarbuild/aips++/prod/linux_gnunew -- GitLab