# -*- 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"} DEBUG=${DEBUG-false} CLEANUP='rm -f stdout' FRAGMENTPREFIX='BondFragment' if $need_testdir then if $testdir_exists; then rm -rf $testdir fi mkdir $testdir CLEANUP="$CLEANUP; rm -rf $testdir" cp -r @srcdir@/$testdir/* $testdir/ CLEANUP="rm -f stdout; $CLEANUP" CLEANUP="rm -f *.conf*; rm -f ${testdir}.xyz; rm -f ${testdir}.dbond; $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. Fragmentation_run () { # $1 is exit code # $2 is ORDER # $3 is DISTANCE expected_exitcode=$1 mol=$testdir ORDER=$2 DISTANCE=$3 FILENAME="${FRAGMENTPREFIX}" exitcode=0 mkdir -p $testdir/$order cd $testdir/$order echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE." if [ -e $mol.dbond ]; then $MOLECUILDER -i ../$mol.xyz -A $mol.dbond -I --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE &>stdout || exitcode=$? else $MOLECUILDER -i ../$mol.xyz -I --select-molecule-by-id 0 -f $FILENAME --order $ORDER --distance $DISTANCE $>stdout || exitcode=$? fi cat