From 6531ce3b5249be34c30cdf6b6ee7dec49aa20d9c Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 8 Mar 2002 18:36:59 -0500 Subject: [svn-r5055] Purpose: New feature Description: "snapshot diff" will just run the diff and exit 0 is no significant differences found between current and previous versions. Runtest will try a "snapshot diff" and will skip test if no significant differences are found. Platforms tested: eirene --- bin/runtest | 13 +++++++++++++ bin/snapshot | 19 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/bin/runtest b/bin/runtest index 3447b10..d4aca93 100755 --- a/bin/runtest +++ b/bin/runtest @@ -31,6 +31,7 @@ H5VER= # default to current CVS version H5VERSION= # default to current CVS version # Default to do checkout (only once) and test, no release. +# Will run test only if there is significant differences from previous version. # If srcdir is not used, don't launched multiple tests SNAPSHOT="${DEBUGMODE:+echo }bin/snapshot" SRCDIR="srcdir" @@ -518,6 +519,7 @@ PASSEDLOG=${SNAPYARD}/log/PASSED_LOG_${TODAY} FAILEDLOG=${SNAPYARD}/log/FAILED_LOG_${TODAY} CVSLOG=${SNAPYARD}/log/CVS_LOG_${TODAY} CVSLOG_LOCK=${SNAPYARD}/log/CVS_LOG_LOCK_${TODAY} +DIFFLOG=${SNAPYARD}/log/DIFF_LOG_${TODAY} # Snap Test Configuration file SNAPTESTCFG=${SNAPYARD}/snaptest.cfg @@ -595,6 +597,17 @@ else fi fi +# run a snapshot diff to see if any significant differences between +# the current and previous versions +($SNAPSHOT diff ) >> $DIFFLOG 2>&1 +errcode=$? +if [ $errcode -eq 0 ]; then + # no need to run test + PRINT "NO TEST: no significant differences between current and previous versions" | + tee -a $PASSEDLOG + exit 0 +fi + # we can use the version of script in SNAPYARD/current now PROGNAME="$SNAPYARD/current/$PROGNAME" diff --git a/bin/snapshot b/bin/snapshot index a0b5fff..91a863f 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -52,6 +52,10 @@ while [ $# -gt 0 ] ; do cmdcheckout="checkout" cmd="" ;; + diff) + cmddiff="diff" + cmd="" + ;; test) cmdtest="test" cmd="" @@ -134,6 +138,8 @@ Usage: $0 [all] [checkout] [test] [srcdir] [release] [help] all: Run all commands (checkout, test & release) [Default is all] checkout: Run cvs checkout + diff: Run diff on current and previous versions. Exit 0 if + no significant differences are found. Otherwise, non-zero. test: Run test release: Run release clean: Run make clean @@ -223,7 +229,7 @@ fi # Do CVS checkout #============================= # Run Test the HDF5 library #============================= -if [ "$cmd" = "all" -o -n "$cmdtest" ]; then +if [ "$cmd" = "all" -o -n "$cmdtest" -o -n "$cmddiff" ]; then # setup if srcdir is used. if [ -z "$srcdir" ]; then TESTDIR=${CURRENT} @@ -264,13 +270,22 @@ if [ "$cmd" = "all" -o -n "$cmdtest" ]; then : #continue else snapshot=yes - # Don't break because we want to see all the diffs. break fi done fi fi + # if diff is choosen, exit 0 if no significant differences are found. + # otherwise, exit 1. This includes cases of other failures. + if [ -n "$cmddiff" ]; then + if [ $snapshot = no ]; then + exit 0 + else + exit 1 + fi + fi + # Build, run tests and install procedures if [ "$snapshot" = "yes" ]; then if (cd ${TESTDIR} && \ -- cgit v0.12