# -*- shell-script -*- # @configure_input@ # Set variables and functions to use in tests. # This is copied from the TREMOLO project, credits Ralf Wildenhues, modified Frederik Heber. # case $VERBOSE in x*) set -x ;; esac pathname=$0 # next two lines not portable basename=${pathname##*/} #testdir=${basename%.test} testdir=${basename%%.*} need_testdir="test -d @srcdir@/$testdir" testdir_exists="test -d $testdir" EXEEXT=@EXEEXT@ # next 2 lines not portable MOLECUILDER=${MOLECUILDER-"@abs_top_builddir@/src/molecuilder$EXEEXT"} exec_prefix="@prefix@/bin" DEBUG=${DEBUG-false} CLEANUP='rm -f stderr stdout' if $need_testdir then if $testdir_exists; then :; else mkdir $testdir CLEANUP="rm -rf $testdir; $CLEANUP" fi cp @srcdir@/$testdir/* $testdir/ cd $testdir CLEANUP="rm -f stderr stdout diffstderr diffstdout; cd ..; $CLEANUP" CLEANUP="rm -f *.conf*; $CLEANUP" fi # debug runs should keep results if $DEBUG; then :; else trap "eval \"$CLEANUP\"" 0 1 2 13 15 fi # TREMOLO_run status [options...] # Run tremolo with OPTIONS, fail if it does not exit with STATUS. Tesselation_run () { # $1 is exit code # $2 is RADIUS expected_exitcode=$1 mol=$testdir RADIUS=$2 FILENAME="NonConvexEnvelope" exitcode=0 #echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -N $RADIUS $FILENAME." if [ -e $mol.dbond ]; then $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -A $mol.dbond -N $RADIUS $FILENAME 2>stderr >stdout || exitcode=$? else $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -N $RADIUS $FILENAME 2>stderr >stdout || exitcode=$? fi #cat stderr #cat stdout #diff ${FILENAME}.dat @srcdir@/$mol/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$? test $exitcode = $expected_exitcode || exit 1 } # can use $LN_S # vim:set ft=sh: