[BACK]Return to bsd.regress.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

Diff for /src/share/mk/bsd.regress.mk between version 1.9 and 1.10

version 1.9, 2002/02/17 01:10:15 version 1.10, 2002/09/02 19:56:55
Line 1 
Line 1 
 #       $OpenBSD$  # $OpenBSD$
   # Documented in bsd.regress.mk(5)
   
 # No man pages for regression tests.  # No man pages for regression tests.
 NOMAN=  NOMAN=
   
 # No installation.  # No installation.
 install:  install:
   
 # If REGRESSTARGETS is defined and PROG is not defined, set NOPROG  # If REGRESS_TARGETS is defined and PROG is not defined, set NOPROG
 .if defined(REGRESSTARGETS) && !defined(PROG)  .if defined(REGRESS_TARGETS) && !defined(PROG)
 NOPROG=  NOPROG=
 .endif  .endif
   
Line 15 
Line 17 
 .MAIN: all  .MAIN: all
 all: regress  all: regress
   
 # XXX - Need full path to REGRESSLOG, otherwise there will be much pain.  # Check for deprecated REGRESS* variables and assign them to the
   # new versions if the new version is not already defined.
   _REGRESS_DEPRECATED=LOG:LOG SKIPTARGETS:SKIP_TARGETS SKIPSLOW:SKIP_SLOW \
           SKIP:SKIP TARGETS:TARGETS MAXTIME:MAXTIME ROOTTARGETS:ROOT_TARGETS
   
 REGRESSLOG?=/dev/null  .for _I in ${_REGRESS_DEPRECATED}
 REGRESSNAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///}  _REGRESS_OLD=REGRESS${_I:C/\:.*//}
   _REGRESS_NEW=REGRESS_${_I:C/.*\://}
   .  if defined(${_REGRESS_OLD})
   ERRORS:= ${ERRORS} "Warning: ${_REGRESS_OLD} is deprecated, use ${_REGRESS_NEW} instead."
   .    if !defined(${_REGRESS_NEW})
   ${_REGRESS_NEW}:=${${_REGRESS_OLD}}
   .    endif
   .  endif
   .endfor
   
   # XXX - Need full path to REGRESS_LOG, otherwise there will be much pain.
   REGRESS_LOG?=/dev/null
   REGRESS_SKIP_TARGETS?=
   REGRESS_SKIP_SLOW?=no
   
   _REGRESS_NAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///}
   _REGRESS_TMP?=/dev/null
   _REGRESS_OUT= | tee -a ${REGRESS_LOG} ${_REGRESS_TMP} 2>&1 > /dev/null
   
 .if defined(PROG) && !empty(PROG)  .if defined(PROG) && !empty(PROG)
 run-regress-${PROG}: ${PROG}  run-regress-${PROG}: ${PROG}
         ./${PROG}          ./${PROG}
 .endif  .endif
   
 .if !defined(REGRESSTARGETS)  .if !defined(REGRESS_TARGETS)
 REGRESSTARGETS=run-regress-${PROG}  REGRESS_TARGETS=run-regress-${PROG}
 .  if defined(REGRESSSKIP)  .  if defined(REGRESS_SKIP)
 REGRESSSKIPTARGETS=run-regress-${PROG}  REGRESS_SKIP_TARGETS=run-regress-${PROG}
 .  endif  .  endif
 .endif  .endif
   
 REGRESSSKIPSLOW?=no  .if defined(REGRESS_SLOW_TARGETS) && !empty(REGRESS_SKIP_SLOW)
   REGRESS_SKIP_TARGETS+=${REGRESS_SLOW_TARGETS}
 .if (${REGRESSSKIPSLOW:L} == "yes") && defined(REGRESSSLOWTARGETS)  
 REGRESSSKIPTARGETS+=${REGRESSSLOWTARGETS}  
 .endif  .endif
   
 .if defined(REGRESSROOTTARGETS)  .if defined(REGRESS_ROOT_TARGETS)
 ROOTUSER!=id -g  _ROOTUSER!=id -g
 SUDO?=  SUDO?=
 . if (${ROOTUSER} != 0) && empty(SUDO)  .  if (${_ROOTUSER} != 0) && empty(SUDO)
 REGRESSSKIPTARGETS+=${REGRESSROOTTARGETS}  REGRESS_SKIP_TARGETS+=${REGRESS_ROOT_TARGETS}
 . endif  .  endif
 .endif  .endif
   
 REGRESSSKIPTARGETS?=  .if defined(ERRORS)
   .BEGIN:
   .  for _m in ${ERRORS}
           @echo 1>&2 ${_m}
   .  endfor
   .  if !empty(ERRORS:M"Fatal\:*") || !empty(ERRORS:M'Fatal\:*')
           @exit 1
   .  endif
   .endif
   
 regress:  regress: .SILENT
 .for RT in ${REGRESSTARGETS}  .if ! ${REGRESS_LOG:M/*}
 .  if ${REGRESSSKIPTARGETS:M${RT}}          echo =========================================================
         @echo -n "SKIP " >> ${REGRESSLOG}          echo REGRESS_LOG must contain an absolute path to the log-file.
           echo It currently points to: ${REGRESS_LOG}
           echo =========================================================
           exit 1
   .endif
   .for RT in ${REGRESS_TARGETS}
   .  if ${REGRESS_SKIP_TARGETS:M${RT}}
           @echo -n "SKIP " ${_REGRESS_OUT}
 .  else  .  else
 # XXX - we need a better method to see if a test fails due to timeout or just  # XXX - we need a better method to see if a test fails due to timeout or just
 #       normal failure.  #       normal failure.
 .   if !defined(REGRESSMAXTIME)  .   if !defined(REGRESS_MAXTIME)
         @if cd ${.CURDIR} && ${MAKE} ${RT}; then \          -if cd ${.CURDIR} && ${MAKE} ${RT}; then \
             echo -n "SUCCESS " >> ${REGRESSLOG} ; \              echo -n "SUCCESS " ${_REGRESS_OUT} ; \
         else \          else \
             echo -n "FAIL " >> ${REGRESSLOG} ; \              echo -n "FAIL " ${_REGRESS_OUT} ; \
             echo FAILED ; \              echo FAILED ; \
         fi          fi
 .   else  .   else
         @if cd ${.CURDIR} && (ulimit -t ${REGRESSMAXTIME} ; ${MAKE} ${RT}); then \          -if cd ${.CURDIR} && (ulimit -t ${REGRESS_MAXTIME} ; ${MAKE} ${RT}); then \
             echo -n "SUCCESS " >> ${REGRESSLOG} ; \              echo -n "SUCCESS " ${_REGRESS_OUT} ; \
         else \          else \
             echo -n "FAIL (possible timeout) " >> ${REGRESSLOG} ; \              echo -n "FAIL (possible timeout) " ${_REGRESS_OUT} ; \
             echo FAILED ; \              echo FAILED ; \
         fi          fi
 .   endif  .   endif
 .  endif  .  endif
         @echo ${REGRESSNAME}/${RT:S/^run-regress-//} >> ${REGRESSLOG}          @echo ${_REGRESS_NAME}/${RT:S/^run-regress-//} ${_REGRESS_OUT}
 .endfor  .endfor
   
 .PHONY: regress  .PHONY: regress

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10