[svn-r5058] Purpose:

Feature/bug fix
Description:
    The 'snapshot diff' command is run in all cases, even after the initial
    "snapshot diff" and hosts are polled to run the test.  It would not cause
    any harm except wasting time repeating diff'ing.  Also, the path is
    quite right to invoke snapshot by merely "bin/snapshot diff" since it
    has not "cd" to the right directory yet.
Solution:
    Added a new option of "-nodiff" to skip the special diff request.
    Then make "runtest" to call itself again with it to prevent
    any further unnecessary diff'ing.
Platforms tested:
    eirene
This commit is contained in:
Albert Cheng 2002-03-10 22:49:16 -05:00
parent 6531ce3b52
commit 235aa17446

View File

@ -422,7 +422,7 @@ FLUSH_FILES()
USAGE()
{
cat <<EOF
Usage: runtest [-h] [-debug] [-r<version>] [-all] [-nocvs] [<host> ...]
Usage: runtest [-h] [-debug] [-r<version>] [-all] [-nocvs] [-nodiff] [<host> ...]
-h
print this help page
-debug
@ -433,6 +433,8 @@ Usage: runtest [-h] [-debug] [-r<version>] [-all] [-nocvs] [<host> ...]
launch tests for all pre-defined testing hosts
-nocvs
do not do cvs commands
-nodiff
do not do diff commands
<host>
launch tests for <host>
@ -481,6 +483,10 @@ while [ $# -gt 0 ]; do
# do not do cvs commands
NOCVS=nocvs
;;
-nodiff)
# do not do diff commands
NODIFF=nodiff
;;
-*) # Unknow option
PRINT "Unknown option ($1)"
USAGE
@ -599,17 +605,20 @@ 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
if [ -z "$NODIFF" ]; then
$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
fi
# we can use the version of script in SNAPYARD/current now
PROGNAME="$SNAPYARD/current/$PROGNAME"
# Don't do the diff any more.
PROGNAME="$SNAPYARD/current/$PROGNAME -nodiff"
# Decide to do test for the local host or for remote hosts
if [ -n "$TESTHOST" -a $HOSTNAME != "$TESTHOST" ]; then