/[MITgcm]/MITgcm/verification/testscript
ViewVC logotype

Diff of /MITgcm/verification/testscript

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

revision 1.14 by adcroft, Wed Aug 15 17:17:01 2001 UTC revision 1.19.2.1 by adcroft, Tue Feb 26 16:04:50 2002 UTC
# Line 138  genmakemodel() Line 138  genmakemodel()
138   )   )
139  }  }
140    
141  makeclean()  makecleancompile()
142  {  {
143  # makedependmodel directory  # makecleancompile directory
144     ( cd $1;
145       if [ $force -gt 0 ]; then
146        rm -f output.txt
147        printf 'make clean ... ' 2>&1
148        make CLEAN >> make.log 2>&1
149        if [ $? -ne 0 ]; then
150          tail make.log
151          echo makecleancompile: make clean failed 1>&2
152          return 1
153        else
154          echo succesful 1>&2
155        fi
156       fi
157     )
158    }
159    
160    makecleanupafter()
161    {
162    # makeupafter directory
163   ( cd $1;   ( cd $1;
164     if [ $clean -gt 0 ]; then     if [ $clean -gt 0 ]; then
165        rm -f output.txt
166      printf 'make clean ... ' 2>&1      printf 'make clean ... ' 2>&1
167      make CLEAN >> make.log 2>&1      make CLEAN >> make.log 2>&1
168      if [ $? -ne 0 ]; then      if [ $? -ne 0 ]; then
169        tail make.log        tail make.log
170        echo makeclean: make clean failed 1>&2        echo makeupafter: make clean failed 1>&2
171        return 1        return 1
172      else      else
173        echo succesful 1>&2        echo succesful 1>&2
# Line 201  runmodel() Line 221  runmodel()
221    
222   ( cd $1   ( cd $1
223     if [ -x $2 ]; then     if [ -x $2 ]; then
224      if [ ! -r output.txt -o $quick -eq 0 ]; then      if [ $quick -eq 0 ]; then
225       echo runmodel: running... 1>&2       rm -f output.txt
      ( ./$2 > output.txt 2>&1 ) && return 0  
      return 1  
     else  
      echo runmodel: output.txt is newer than executable 1>&2  
      return 0  
226      fi      fi
227     else      printf 'runmodel: ' 1>&2
228      echo runmodel: executable \"$1/$2\" is missing 1>&2      make output.txt && return 0
229      return 1  #   if [ ! -r output.txt -o $quick -eq 0 ]; then
230    #    echo runmodel: running... 1>&2
231    #    ( ./$2 > output.txt 2>&1 ) && return 0
232    #    rm -f output.txt
233    #    ( make output.txt ) && return 0
234    #    return 1
235    #   else
236    #    echo runmodel: output.txt is newer than executable 1>&2
237    #    ( make output.txt ) && return 0
238    #    return 0
239    #   fi
240    #  else
241    #   echo runmodel: executable \"$1/$2\" is missing 1>&2
242    #   return 1
243     fi     fi
244   )   )
245  }  }
# Line 284  $0 [-help] [-quick] [-verbose] dir1 [dir Line 312  $0 [-help] [-quick] [-verbose] dir1 [dir
312   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
313   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
314   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
315   -clean     Do "make CLEAN" before compiling. This forces a complete rebuild.   -force     Do "make CLEAN" before compiling. This forces a complete rebuild.
316   -longtest  Compare numeric output for mean and s.d. of variables.   -clean     Do "make CLEAN" after compiling and testing.
317     -shorttest Don't compare numeric output for mean and s.d. of variables.
318   -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.   -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.
319    
320  Normal usage:  Normal usage:
# Line 313  fi Line 342  fi
342  debug=0  debug=0
343  verbose=1  verbose=1
344  quick=0  quick=0
345    force=0
346  clean=0  clean=0
347  ieee=1  ieee=1
348  longtest=0  longtest=1
349  expts=''  expts=''
350    
351  # Process arguments  # Process arguments
# Line 325  do Line 355  do
355     -quick) quick=1;;     -quick) quick=1;;
356     -verbose) verbose=2;;     -verbose) verbose=2;;
357     -debug) debug=1;;     -debug) debug=1;;
358       -force) force=1;;
359     -clean) clean=1;;     -clean) clean=1;;
360     -noieee) ieee=0;;     -noieee) ieee=0;;
361     -longtest) longtest=1;;     -shorttest) longtest=0;;
362     -quiet) verbose=0;;     -quiet) verbose=0;;
363     -help) show_help; exit 0;;     -help) show_help; exit 0;;
364     -*) echo Unrecognized option:$arg; exit 9;;     -*) echo Unrecognized option:$arg; exit 9;;
# Line 335  do Line 366  do
366   esac   esac
367  done  done
368    
369    if [ $force -gt 0 -a $quick -gt 0 ]; then
370     echo You specified -quick and -force together which conflict.
371     echo Please specify either -quick or -force or neither but not both.
372     exit 1
373    fi
374    
375  #if [ ${#expts} -eq 0 ]; then  #if [ ${#expts} -eq 0 ]; then
376  # echo Scanning all directories  # echo Scanning all directories
377  # for arg in *  # for arg in *
# Line 381  do Line 418  do
418    results='-- -- -- -- -- -- -- -- --'    results='-- -- -- -- -- -- -- -- --'
419   fi   fi
420   genmakemodel $dir/input && genmake=Y \   genmakemodel $dir/input && genmake=Y \
421   && makeclean $dir/input \   && makecleancompile $dir/input \
422   && makedependmodel $dir/input && makedepend=Y \   && makedependmodel $dir/input && makedepend=Y \
423   && makemodel $dir/input && make=Y \   && makemodel $dir/input && make=Y \
424   && runmodel $dir/input mitgcmuv && run=Y \   && runmodel $dir/input mitgcmuv && run=Y \
425   && results=`testoutput $dir`   && results=`testoutput $dir` \
426     && makecleanupafter $dir/input
427   echo   echo
428   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results
429   echo   echo

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.19.2.1

  ViewVC Help
Powered by ViewVC 1.1.22