/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.7 by edhill, Wed Sep 10 04:02:39 2003 UTC revision 1.9.2.1 by edhill, Fri Oct 3 02:18:21 2003 UTC
# Line 20  usage() Line 20  usage()
20      echo "                             (DEF=\"\" for \"/bin/bash\")"      echo "                             (DEF=\"\" for \"/bin/bash\")"
21      echo "  (-c|-command)STRING      command to run"      echo "  (-c|-command)STRING      command to run"
22      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
23        echo "  (-m|-make)STRING         command to use for \"make\""
24        echo "                             (DEF=\"make\")"
25        echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
26        echo "  (-nogenmake|-ng)         skip the genmake stage"
27        echo "  (-noclean|-nc)           skip the \"make clean\" stage"
28        echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
29      echo      echo
30      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING follows a whitespace-delimited format"
31      echo "such as:"      echo "such as:"
# Line 41  build_mpack() Line 47  build_mpack()
47              exit 1              exit 1
48          fi          fi
49          echo -n "building mpack...  "          echo -n "building mpack...  "
50          ( cd $MPACKDIR && ./configure && make ) > build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1
51          RETVAL=$?          RETVAL=$?
52          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
53              echo              echo
# Line 172  testoutput() Line 178  testoutput()
178  genmakemodel()  genmakemodel()
179  {  {
180      # genmakemodel directory      # genmakemodel directory
181      GENMAKE2="$BASH ../../../tools/genmake2"      if test "x$NOGENMAKE" = xt ; then
182      (          echo "genmake skipped!"
183          cd $1;      else
184          printf 'genmake ... ' 1>&2          GENMAKE2="$BASH ../../../tools/genmake2"
185          # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1          (
186          $GENMAKE2  -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1              cd $1;
187          RETVAL=$?              printf 'genmake ... ' 1>&2
188          for i in gm_state gm_optfile gm_local Makefile ; do              # ../../../tools/genmake -ieee -mods=../code > make.log 2>&1
189              if test -r $i ; then              $GENMAKE2  -ds -m $MAKE --mods=../code "--optfile="$OPTFILE > make.log 2>&1
190                  cp $i $CDIR              RETVAL=$?
191                for i in gm_state gm_optfile gm_local Makefile ; do
192                    if test -r $i ; then
193                        cp $i $CDIR
194                    fi
195                done
196                if test "x$RETVAL" != x0 ; then
197                    tail make.log
198                    echo "genmakemodel: genmake failed" 1>&2
199                    cp make.log $CDIR
200                    return 1
201                else
202                    echo "succesful" 1>&2
203              fi              fi
204          done          )
205          if test "x$RETVAL" != x0 ; then      fi
             tail make.log  
             echo "genmakemodel: genmake failed" 1>&2  
             cp make.log $CDIR  
             return 1  
         else  
             echo "succesful" 1>&2  
         fi  
     )  
206  }  }
207    
208  makeclean()  makeclean()
209  {  {
210      # makeclean directory      # makeclean directory
211      (      if test "x$NOCLEAN" = xt ; then
212          cd $1;          echo "make CLEAN skipped!"
213          if test -e output.txt ; then      else
214              rm -f output.txt          (
215          fi              cd $1;
216          printf 'make CLEAN ... ' 2>&1              if test -e output.txt ; then
217          if test -r Makefile ; then                  rm -f output.txt
             make CLEAN >> make.log 2>&1  
             RETVAL=$?  
             if test "x$RETVAL" != x0 ; then  
                 tail make.log  
                 echo "makeclean: \"make CLEAN\" failed" 1>&2  
                 cp make.log $CDIR"/make.log"  
                 return 1  
218              fi              fi
219          fi              printf 'make CLEAN ... ' 2>&1
220          echo succesful 1>&2              if test -r Makefile ; then
221          exit 0                  $MAKE CLEAN >> make.log 2>&1
222      )                  RETVAL=$?
223                    if test "x$RETVAL" != x0 ; then
224                        tail make.log
225                        echo "makeclean: \"make CLEAN\" failed" 1>&2
226                        cp make.log $CDIR"/make.log"
227                        return 1
228                    fi
229                fi
230                echo succesful 1>&2
231                exit 0
232            )
233        fi
234  }  }
235    
236  makedependmodel()  makedependmodel()
237  {  {
238      # makedependmodel directory      # makedependmodel directory
239      (      if test "x$NODEPEND" = xt ; then
240          cd $1;          echo "make depend skipped!"
241          printf 'make depend ... ' 1>&2      else
242          make depend >> make.log 2>&1          (
243          RETVAL=$?              cd $1;
244          if test "x$RETVAL" != x0 ; then              printf 'make depend ... ' 1>&2
245              tail make.log              $MAKE depend >> make.log 2>&1
246              echo "makedependmodel: make depend failed" 1>&2              RETVAL=$?
247              cp make.log $CDIR"/make.log"              if test "x$RETVAL" != x0 ; then
248              return 1                  tail make.log
249          else                  echo "makedependmodel: make depend failed" 1>&2
250              echo succesful 1>&2                  cp make.log $CDIR"/make.log"
251          fi                  return 1
252      )              else
253                    echo succesful 1>&2
254                fi
255            )
256        fi
257  }  }
258    
259  makemodel()  makemodel()
# Line 245  makemodel() Line 263  makemodel()
263          cd $1;          cd $1;
264          if test -r Makefile ; then          if test -r Makefile ; then
265              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
266              make >> make.log 2>&1              $MAKE >> make.log 2>&1
267              RETVAL=$?              RETVAL=$?
268              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
269                  tail make.log                  tail make.log
# Line 358  show_help() Line 376  show_help()
376  {  {
377      cat - << EOF      cat - << EOF
378  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]
379   -help      Show this help message  
380   -quick     Skip "genmake" and "make depend" if the Makefile exists   -help|-h      Show this help message
381   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
382   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
383   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
# Line 397  verbose=1 Line 415  verbose=1
415  clean=0  clean=0
416  expts=''  expts=''
417  # ieee=1  # ieee=1
418  # quick=0  
419    QUICK=f
420    CLEANUP=f
421    NOGENMAKE=f
422    NOCLEAN=f
423    NODEPEND=f
424    
425  BASH=  BASH=
426  OPTFILES=  OPTFILES=
427  ADDRESSES=edhill@mitgcm.org  ADDRESSES=
428  TESTDIRS=  TESTDIRS=
429  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
430  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
431  COMMAND="make output.txt"  COMMAND="rm -f output.txt; make output.txt"
432    MAKE=make
433  MPI=f  MPI=f
434    
435  echo -n "parsing options...  "  echo -n "parsing options...  "
# Line 452  for ac_option ; do Line 476  for ac_option ; do
476          -command=* | --command=*)          -command=* | --command=*)
477              COMMAND=$ac_optarg ;;              COMMAND=$ac_optarg ;;
478    
479            -make | --make | -m | --m)
480                ac_prev=MAKE ;;
481            -make=* | --make=*)
482                MAKE=$ac_optarg ;;
483    
484            -quick | --quick | -q | --q)
485                QUICK=t ;;
486            -nogenmake | --nogenmake | -ng | --ng)
487                NOGENMAKE=t ;;
488            -noclean | --noclean | -nc | --nc)
489                NOCLEAN=t ;;
490            -nodepend | --nodepend | -nd | --nd)
491                NODEPEND=t ;;
492    
493          -mpi) MPI=t ;;          -mpi) MPI=t ;;
494          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
495          -debug) debug=1 ;;          -debug) debug=1 ;;
# Line 472  for ac_option ; do Line 510  for ac_option ; do
510            
511  done  done
512    
513    if test "x$QUICK" = xt ; then
514        NOGENMAKE=t
515        NOCLEAN=t
516        NODEPEND=t
517    fi
518    
519  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
520      TESTDIRS=`scandirs`      TESTDIRS=`scandirs`
521  fi  fi
522    
523    if test "x$OPTFILES" = x ; then
524        OPTFILES=$MITGCM_OF
525    fi
526    if test "x$OPTFILES" = x ; then
527        echo "Error: please specify an optfile using either the command-line or"
528        echo "  the MITGCM_OF environment variable.  Also, examples are located "
529        echo "  in \$ROOTDIR/tools/build_options"
530        exit 1
531    fi
532    
533  echo "OK"  echo "OK"
534    
535  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
# Line 570  for OPTFILE in $OPTFILES ; do Line 624  for OPTFILE in $OPTFILES ; do
624          echo          echo
625          unset genmake makedepend make run          unset genmake makedepend make run
626          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'          results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
627          ( cd $dir/input; rm -f *.{o,f,c,F} *.[f,F]90 work* output.txt Make* make.log; )  
628          if [ -r $dir/build ]; then          if [ -r $dir/build ]; then
629              seperatebuilddir=1              seperatebuilddir=1
630              builddir=build              builddir=build
# Line 582  for OPTFILE in $OPTFILES ; do Line 636  for OPTFILE in $OPTFILES ; do
636              rundir=input              rundir=input
637          fi          fi
638    
639          genmakemodel $dir/$builddir && genmake=Y \          if test "x$CLEANUP" = xt ; then
640              && makeclean $dir/$builddir \              makeclean $dir/$builddir
641              && makedependmodel $dir/$builddir && makedepend=Y \          else
642              && makemodel $dir/$builddir && make=Y \              genmakemodel $dir/$builddir && genmake=Y \
643              && linkdata $seperatebuilddir $dir/$rundir \                  && makeclean $dir/$builddir \
644              && runmodel $dir/$builddir && run=Y \                  && makedependmodel $dir/$builddir && makedepend=Y \
645              && results=`testoutput $dir $rundir`                  && makemodel $dir/$builddir && make=Y \
646                    && linkdata $seperatebuilddir $dir/$rundir \
647                    && runmodel $dir/$builddir && run=Y \
648                    && results=`testoutput $dir $rundir`
649            fi
650    
651          echo          echo
652          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \          formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \
653              ${run:-N} $results              ${run:-N} $results
# Line 610  for OPTFILE in $OPTFILES ; do Line 669  for OPTFILE in $OPTFILES ; do
669              gzip $NDIR".tar"              gzip $NDIR".tar"
670          )          )
671    
672          $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES          if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
673          RETVAL=$?              echo "No mail sent"
         if test "x$RETVAL" != x0 ; then  
             echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"  
674          else          else
675              rm -f $DRESULTS"/"$NDIR".tar*"              $MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES
676                RETVAL=$?
677                if test "x$RETVAL" != x0 ; then
678                    echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>"
679                else
680                    rm -f $DRESULTS"/"$NDIR".tar*"
681                fi
682          fi          fi
683    
684          NDIR=$(( $NDIR + 1 ))          NDIR=$(( $NDIR + 1 ))

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9.2.1

  ViewVC Help
Powered by ViewVC 1.1.22