Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/charisee/ertest/scripts/run.sh
ViewVC logotype

Annotation of /branches/charisee/ertest/scripts/run.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3444 - (view) (download) (as text)

1 : cchiw 2859 #!/bin/ksh
2 :     #
3 :     # A script for running the Diderot regression tests.
4 :     #
5 :     # usage:
6 :     # scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags]
7 :     #
8 :     # rtest/scripts/run.sh. Generated from run_sh.in by configure.
9 :     #
10 :    
11 :     # set up the path so that we can find unu
12 :     #
13 :     PATH=/bin:/usr/bin:/usr/local/teem-build/bin
14 :    
15 :     function usage {
16 :     echo "usage:"
17 :     echo " scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags]"
18 :     exit $1
19 :     }
20 :    
21 :     # 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 :     # process command-line arguments
30 :     #
31 : cchiw 3444 DIDEROTC="/Users/chariseechiw/diderot/charisee_dev/bin/diderotc"
32 : cchiw 2859 DIDEROTC_FLAGS=""
33 :     RUNTIME_FLAGS=""
34 :     if [ $# -ne 0 ] ; then
35 :     # first we check for the diderotc command
36 :     case $1 in
37 :     -*) ;; # no diderot command
38 :     /*) DIDEROTC=$1; shift ;; # absolute path
39 :     *) DIDEROTC=$HERE/$1; shift ;; #relative path
40 :     esac
41 :     # 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 :    
64 :     #
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 :     # 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 :     LOG=$HERE/log.$DATE
78 :     REPORT=$HERE/report.$DATE
79 :    
80 :     echo "testing $DIDEROTC $DIDEROTC_FLAGS" > $REPORT
81 :     for t in $TESTS ; do
82 :     ( cd tests/$t;
83 :     echo "********** $t **********" >> $LOG
84 :     echo -n "checking $t ... " >> $REPORT
85 :     echo "$DIDEROTC $DIDEROTC_FLAGS $t.diderot" >> $LOG
86 :     $DIDEROTC $DIDEROTC_FLAGS $t.diderot 2>> $LOG 1>> $LOG
87 :     if [ "$?" -eq "0" ] ; then
88 :     echo -n "compile succeeded ... " >> $REPORT
89 :     echo "./$t $RUNTIME_FLAGS" >> $LOG
90 :     ./$t $RUNTIME_FLAGS 2>> $LOG 1>> $LOG
91 :     if [ "$?" -eq "0" ] ; then
92 :     echo -n "execution succeeded ... " >> $REPORT
93 :     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 :     rm -f $t.c $t.cl $t.o $t $t.log $t.txt
99 :     else
100 :     echo "result is bad ($result)" >> $REPORT
101 :     echo "$t failed"
102 :     fi
103 :     else
104 :     echo "execution failed" >> $REPORT
105 :     echo "$t failed"
106 :     fi
107 :     else
108 :     echo "compile failed" >> $REPORT
109 :     echo "$t failed"
110 :     fi
111 :     echo "**********" >> $LOG
112 :     )
113 :     done
114 :     echo "complete report at $REPORT"

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0