source: molecuilder/tests/Tesselations/defs.in@ b61c30

Last change on this file since b61c30 was b61c30, checked in by Frederik Heber <heber@…>, 16 years ago

Forgot to add molecuilder/tests/Tesselations/defs.in

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# -*- shell-script -*-
2# @configure_input@
3# Set variables and functions to use in tests.
4# This is copied from the TREMOLO project, credits Ralf Wildenhues, modified Frederik Heber.
5#
6case $VERBOSE in
7 x*) set -x ;;
8esac
9
10pathname=$0
11# next two lines not portable
12basename=${pathname##*/}
13#testdir=${basename%.test}
14testdir=${basename%%.*}
15need_testdir="test -d @srcdir@/$testdir"
16testdir_exists="test -d $testdir"
17EXEEXT=@EXEEXT@
18# next 2 lines not portable
19MOLECUILDER=${MOLECUILDER-"@abs_top_builddir@/src/molecuilder$EXEEXT"}
20exec_prefix="@prefix@/bin"
21DEBUG=${DEBUG-false}
22CLEANUP='rm -f stderr stdout'
23
24if $need_testdir
25then
26 if $testdir_exists; then :; else
27 mkdir $testdir
28 CLEANUP="rmdir $testdir; $CLEANUP"
29 fi
30 cp @srcdir@/$testdir/* $testdir/
31 cd $testdir
32 CLEANUP="rm -f stderr stdout diffstderr diffstdout; cd ..; $CLEANUP"
33 CLEANUP="rm -f *.conf*; $CLEANUP"
34fi
35
36# debug runs should keep results
37if $DEBUG; then :; else
38 trap "eval \"$CLEANUP\"" 0 1 2 13 15
39fi
40
41# TREMOLO_run status [options...]
42# Run tremolo with OPTIONS, fail if it does not exit with STATUS.
43Tesselation_run ()
44{
45 # $1 is exit code
46 # $2 is RADIUS
47
48 expected_exitcode=$1
49 mol=$testdir
50 RADIUS=$2
51 FILENAME="NonConvexEnvelope"
52 exitcode=0
53 #echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -N $RADIUS $FILENAME."
54 if [ -e $mol.dbond ]; then
55 $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -A $mol.dbond -N $RADIUS $FILENAME 2>stderr >stdout || exitcode=$?
56 else
57 $MOLECUILDER $mol.conf -e $exec_prefix -p $mol.xyz -c 5. 5. 5. -N $RADIUS $FILENAME 2>stderr >stdout || exitcode=$?
58 fi
59 #cat stderr
60 #cat stdout
61 diff ${FILENAME}.dat @srcdir@/$mol/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$?
62 test $exitcode = $expected_exitcode || exit 1
63}
64
65# can use $LN_S
66
67# vim:set ft=sh:
Note: See TracBrowser for help on using the repository browser.