SCM Repository
Annotation of /branches/cuda/rtest/scripts/run_sh.in
Parent Directory
|
Revision Log
Revision 1675 - (view) (download)
1 : | jhr | 1180 | #!/bin/ksh |
2 : | jhr | 1178 | # |
3 : | # A script for running the Diderot regression tests. | ||
4 : | # | ||
5 : | jhr | 1416 | # usage: |
6 : | # scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags] | ||
7 : | # | ||
8 : | jhr | 1178 | # @configure_input@ |
9 : | # | ||
10 : | |||
11 : | jhr | 1199 | # set up the path so that we can find unu |
12 : | jhr | 1179 | # |
13 : | jhr | 1199 | PATH=/bin:/usr/bin:@TEEM_DIR@/bin |
14 : | jhr | 1178 | |
15 : | jhr | 1416 | function usage { |
16 : | echo "usage:" | ||
17 : | echo " scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags]" | ||
18 : | exit $1 | ||
19 : | } | ||
20 : | |||
21 : | jhr | 1178 | # this script should be run from the rtest directory |
22 : | # | ||
23 : | HERE=$(pwd) | ||
24 : | if [ ! -d $HERE/tests ] ; then | ||
25 : | echo "run script from rtest directory" | ||
26 : | exit 1 | ||
27 : | fi | ||
28 : | |||
29 : | jhr | 1185 | # process command-line arguments |
30 : | # | ||
31 : | DIDEROTC="@DIDEROT_BINDIR@/diderotc" | ||
32 : | DIDEROTC_FLAGS="" | ||
33 : | jhr | 1416 | RUNTIME_FLAGS="" |
34 : | if [ $# -ne 0 ] ; then | ||
35 : | # first we check for the diderotc command | ||
36 : | jhr | 1185 | case $1 in |
37 : | jhr | 1416 | -*) ;; # no diderot command |
38 : | /*) DIDEROTC=$1; shift ;; # absolute path | ||
39 : | *) DIDEROTC=$HERE/$1; shift ;; #relative path | ||
40 : | jhr | 1185 | esac |
41 : | jhr | 1416 | # get diderotc flags |
42 : | while [ $# -ne 0 ] ; do | ||
43 : | case $1 in | ||
44 : | --) shift; break ;; # switch modes | ||
45 : | -*) DIDEROTC_FLAGS="$DIDEROTC_FLAGS $1" ;; | ||
46 : | *) echo "unrecognized argument" | ||
47 : | usage 1 | ||
48 : | ;; | ||
49 : | esac | ||
50 : | shift | ||
51 : | done | ||
52 : | # get runtime flags | ||
53 : | while [ $# -ne 0 ] ; do | ||
54 : | case $1 in | ||
55 : | -*) RUNTIME_FLAGS="$RUNTIME_FLAGS $1" ;; | ||
56 : | *) echo "unrecognized argument" | ||
57 : | usage 1 | ||
58 : | ;; | ||
59 : | esac | ||
60 : | shift | ||
61 : | done | ||
62 : | fi | ||
63 : | jhr | 1185 | |
64 : | jhr | 1416 | # |
65 : | # check that the diderotc path is valid | ||
66 : | # | ||
67 : | if [ ! -x $DIDEROTC ] ; then | ||
68 : | echo "$DIDEROTC is not executable or does not exist" | ||
69 : | exit 1 | ||
70 : | fi | ||
71 : | |||
72 : | jhr | 1178 | # get a list of all of the tests (one per directory) |
73 : | # | ||
74 : | TESTS=$(cd tests; ls) | ||
75 : | |||
76 : | DATE=$( date +"%F-%H-%M-%S" ) | ||
77 : | jhr | 1180 | LOG=$HERE/log.$DATE |
78 : | REPORT=$HERE/report.$DATE | ||
79 : | jhr | 1178 | |
80 : | jhr | 1416 | echo "testing $DIDEROTC $DIDEROTC_FLAGS" > $REPORT |
81 : | jhr | 1178 | for t in $TESTS ; do |
82 : | jhr | 1180 | ( cd tests/$t; |
83 : | echo "********** $t **********" >> $LOG | ||
84 : | jhr | 1182 | echo -n "checking $t ... " >> $REPORT |
85 : | jhr | 1185 | echo "$DIDEROTC $DIDEROTC_FLAGS $t.diderot" >> $LOG |
86 : | $DIDEROTC $DIDEROTC_FLAGS $t.diderot 2>> $LOG 1>> $LOG | ||
87 : | jhr | 1178 | if [ "$?" -eq "0" ] ; then |
88 : | jhr | 1182 | echo -n "compile succeeded ... " >> $REPORT |
89 : | jhr | 1416 | echo "./$t $RUNTIME_FLAGS" >> $LOG |
90 : | ./$t $RUNTIME_FLAGS 2>> $LOG 1>> $LOG | ||
91 : | jhr | 1178 | if [ "$?" -eq "0" ] ; then |
92 : | jhr | 1182 | echo -n "execution succeeded ... " >> $REPORT |
93 : | jhr | 1180 | result=$(./assess.sh) |
94 : | if (($result < 1.0)) ; then | ||
95 : | echo "result is good ($result)" >> $REPORT | ||
96 : | echo "ok" >> $LOG | ||
97 : | echo "$t is okay" | ||
98 : | jhr | 1424 | rm -f $t.c $t.cl $t.o $t $t.log $t.txt |
99 : | jhr | 1180 | else |
100 : | jhr | 1182 | echo "result is bad ($result)" >> $REPORT |
101 : | jhr | 1180 | echo "$t failed" |
102 : | fi | ||
103 : | jhr | 1178 | else |
104 : | jhr | 1182 | echo "execution failed" >> $REPORT |
105 : | jhr | 1180 | echo "$t failed" |
106 : | jhr | 1178 | fi |
107 : | else | ||
108 : | jhr | 1182 | echo "compile failed" >> $REPORT |
109 : | jhr | 1180 | echo "$t failed" |
110 : | jhr | 1178 | fi |
111 : | jhr | 1180 | echo "**********" >> $LOG |
112 : | ) | ||
113 : | jhr | 1178 | done |
114 : | jhr | 1180 | echo "complete report at $REPORT" |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |