File: test.sh

package info (click to toggle)
apbs 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 38,840 kB
  • ctags: 7,893
  • sloc: ansic: 44,537; xml: 21,399; sh: 20,613; fortran: 17,796; yacc: 2,922; python: 2,804; makefile: 567; lex: 294; sed: 205; java: 134; awk: 26
file content (90 lines) | stat: -rwxr-xr-x 2,021 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash

if [[ $1 = "" ]]; then
    echo "Please use \"make test\" to run the tests."
    exit
fi
 


logfile=TESTRESULTS.log
nettime=0
vsmall=0.000000001000

input=( apbs-mol apbs-smol )

# Initialize the results file

date=`date`
echo "Date     : ${date}" >> $logfile
echo "Directory: FKBP" >> $logfile
echo "Results  :" >> $logfile

# Do 1d7h-dmso first

cd 1d7h-dmso
results=( 1.500890142385E+01 1.624584726796E+01 )

# For each file in the directory, run APBS and get the value

for i in 0 1 
do
  echo "----------------------------------------"
  echo "Testing input file 1d7h-dmso/${input[i]}.in"
  echo ""

  starttime=`date +%s`
  $1 ${input[i]}.in > ${input[i]}.out 
  answer=( `grep "Global net ELEC" ${input[i]}.out | awk '{print $6}'` )

  echo "Global net energy: ${answer[3]}"
  sync

  ../../scripts/checkresults.sh ${answer[3]} ${results[i]} 1d7h-dmso/${input[i]}.in $logfile
  
  endtime=`date +%s`
  let elapsed=$endtime-$starttime
  let nettime=$nettime+$elapsed
  echo "Total elapsed time: $elapsed seconds"
  echo "----------------------------------------"

done

cat $logfile >> ../$logfile

# Now do 1d7i-dss

cd ../1d7i-dss
results=( 1.442544510653E+01 1.545171104995E+01 )

for i in 0 1 
do
  echo "----------------------------------------"
  echo "Testing input file 1d7i-dss/${input[i]}.in"
  echo ""

  starttime=`date +%s`
  $1 ${input[i]}.in > ${input[i]}.out 
  answer=( `grep "Global net ELEC" ${input[i]}.out | awk '{print $6}'` )

  echo "Global net energy: ${answer[3]}"
  sync
  
  ../../scripts/checkresults.sh ${answer[3]} ${results[i]} 1d7i-dss/${input[i]}.in $logfile
  
  endtime=`date +%s`
  let elapsed=$endtime-$starttime
  let nettime=$nettime+$elapsed
  echo "Total elapsed time: $elapsed seconds"
  echo "----------------------------------------"

done

cat $logfile >> ../$logfile
cd ..

echo "Test results have been logged to ${logfile}."
echo "Total time for this directory: ${nettime} seconds."

echo "Time     : ${nettime} seconds" >> $logfile
echo "" >> $logfile