Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/xcvs/dist/src From Garo Taft:



details:   https://anonhg.NetBSD.org/src/rev/5226866a97ea
branches:  trunk
changeset: 778345:5226866a97ea
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 22 20:49:53 2012 +0000

description:
>From Garo Taft:
- Add a -w flag which will make the sanity script sleep for a second before
  and after checkouts, commits, and updates.
- Fix expected output to look for the right default action on empty log
  message. It's now "abort".
- Add new requests "Checkin-prog" and "Update-prog" to expectation values.
- Add new "access"?and "group" files to CVSROOT admin database expectation
  values.
- All tests pass except client-20, which hangs.

diffstat:

 external/gpl2/xcvs/dist/src/sanity.sh |  126 +++++++++++++++++++++++++++------
 1 files changed, 101 insertions(+), 25 deletions(-)

diffs (truncated from 574 to 300 lines):

diff -r 0e862098b094 -r 5226866a97ea external/gpl2/xcvs/dist/src/sanity.sh
--- a/external/gpl2/xcvs/dist/src/sanity.sh     Thu Mar 22 20:34:37 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/sanity.sh     Thu Mar 22 20:49:53 2012 +0000
@@ -22,7 +22,7 @@
 usage ()
 {
     echo "Usage: `basename $0` --help"
-    echo "Usage: `basename $0` [--eklr] [-c CONFIG-FILE] [-f FROM-TEST] \\"
+    echo "Usage: `basename $0` [--eklrw] [-c CONFIG-FILE] [-f FROM-TEST] \\"
     echo "                 [-h HOSTNAME] [-s CVS-FOR-CVS-SERVER] CVS-TO-TEST \\"
     echo "                 [TESTS-TO-RUN...]"
 }
@@ -69,6 +69,11 @@
     echo "-p|--proxy   test a secondary/primary CVS server (writeproxy)"
     echo "              configuration (implies --remote)."
     echo "-r|--remote  test client/server, as opposed to local, CVS"
+    echo "-w|--wait    automatically sleep for a second before and after"
+    echo "             checkouts, commits, and updates.  Use this option"
+    echo "             if you have fast cores and a slow disk.  (For example,"
+    echo "             you may need this flag if you see tests fail because"
+    echo "             they think they have nothing to commit.)"
     echo "-s CVS-FOR-CVS-SERVER"
     echo "--server=CVS-FOR-CVS-SERVER"
     echo "             use CVS-FOR-CVS-SERVER as the path to the CVS SERVER"
@@ -132,7 +137,8 @@
 remote=false
 servercvs=false
 skipfail=false
-while getopts Hc:ef:h:klnprs:-: option ; do
+waitforslowdisk=false
+while getopts Hc:ef:h:klnprs:w-: option ; do
     # convert the long opts to short opts
     if test x$option = x-;  then
        # remove any argument
@@ -198,6 +204,10 @@
                option=e
                OPTARG=
                ;;
+           w|wa|wai|wait)
+               option=w
+               OPTARG=
+               ;;
            *)
                option=\?
                OPTARG=
@@ -250,6 +260,9 @@
            servercvs="$OPTARG"
            remote=:
            ;;
+       w)
+           waitforslowdisk=:
+           ;;
        \?)
            exit_usage
            ;;
@@ -1488,6 +1501,17 @@
   fi
 }
 
+maybe_sleep_if_ci_co_or_up ()
+{
+  if $waitforslowdisk; then
+    case "$@" in
+    *" ci "*|*" ci"|*" commit "*|*" commit") sleep 1;;
+    *" co "*|*" co"|*" checkout "*|*" checkout") sleep 1;;
+    *" up "*|*" up"|*" update "*|*" update") sleep 1;;
+    esac
+  fi
+}
+
 # Usage:
 #  dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
 # TESTNAME is the name used in the log to identify the test.
@@ -1503,6 +1527,7 @@
 # lack \|).
 dotest ()
 {
+  maybe_sleep_if_ci_co_or_up "$2"
   rm -f $TESTDIR/dotest.ex? 2>&1
   eval "$2" >$TESTDIR/dotest.tmp 2>&1
   status=$?
@@ -1512,12 +1537,14 @@
     echo "exit status was $status" >>${LOGFILE}
     fail "$1"
   fi
+  maybe_sleep_if_ci_co_or_up "$2"
   dotest_internal "$@"
 }
 
 # Like dotest except only 2 args and result must exactly match stdin
 dotest_lit ()
 {
+  maybe_sleep_if_ci_co_or_up "$2"
   rm -f $TESTDIR/dotest.ex? 2>&1
   eval "$2" >$TESTDIR/dotest.tmp 2>&1
   status=$?
@@ -1527,6 +1554,7 @@
     echo "exit status was $status" >>$LOGFILE
     fail "$1"
   fi
+  maybe_sleep_if_ci_co_or_up "$2"
   cat >$TESTDIR/dotest.exp
   if cmp $TESTDIR/dotest.exp $TESTDIR/dotest.tmp >/dev/null 2>&1; then
     pass "$1"
@@ -1543,6 +1571,7 @@
 # Like dotest except exitstatus should be nonzero.
 dotest_fail ()
 {
+  maybe_sleep_if_ci_co_or_up "$2"
   rm -f $TESTDIR/dotest.ex? 2>&1
   eval "$2" >$TESTDIR/dotest.tmp 2>&1
   status=$?
@@ -1552,12 +1581,14 @@
     echo "exit status was $status" >>$LOGFILE
     fail "$1"
   fi
+  maybe_sleep_if_ci_co_or_up "$2"
   dotest_internal "$@"
 }
 
 # Like dotest except output is sorted.
 dotest_sort ()
 {
+  maybe_sleep_if_ci_co_or_up "$2"
   rm -f $TESTDIR/dotest.ex? 2>&1
   eval "$2" >$TESTDIR/dotest.tmp1 2>&1
   status=$?
@@ -1568,12 +1599,14 @@
     fail "$1"
   fi
   $TR '        ' ' ' < $TESTDIR/dotest.tmp1 | sort > $TESTDIR/dotest.tmp
+  maybe_sleep_if_ci_co_or_up "$2"
   dotest_internal "$@"
 }
 
 # Like dotest_fail except output is sorted.
 dotest_fail_sort ()
 {
+  maybe_sleep_if_ci_co_or_up "$2"
   rm -f $TESTDIR/dotest.ex? 2>&1
   eval "$2" >$TESTDIR/dotest.tmp1 2>&1
   status=$?
@@ -1584,6 +1617,7 @@
     fail "$1"
   fi
   $TR '        ' ' ' < $TESTDIR/dotest.tmp1 | sort > $TESTDIR/dotest.tmp
+  maybe_sleep_if_ci_co_or_up "$2"
   dotest_internal "$@"
 }
 
@@ -4698,11 +4732,13 @@
          dotest ls-init-1 "$testcvs -Q co -dtop ."
          cd top
          dotest ls-1 "$testcvs ls CVSROOT" \
-"aclconfig
+"access
+aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -4719,11 +4755,13 @@
 CVSROOT
 
 CVSROOT:
+access
 aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -4743,11 +4781,13 @@
 notcheckedout
 
 CVSROOT:
+access
 aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -4770,11 +4810,13 @@
 notcheckedout
 
 CVSROOT:
+access
 aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -7519,11 +7561,13 @@
 first-dir
 
 CVSROOT:
+access
 aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -7551,11 +7595,13 @@
 d--- $ISO8601DATE            first-dir
 
 CVSROOT:
+---- $ISO8601DATE 1\.[0-9][0-9]*        access
 ---- $ISO8601DATE 1\.[0-9][0-9]*        aclconfig
 ---- $ISO8601DATE 1\.[0-9][0-9]*        checkoutlist
 ---- $ISO8601DATE 1\.[0-9][0-9]*        commitinfo
 ---- $ISO8601DATE 1\.[0-9][0-9]*        config
 ---- $ISO8601DATE 1\.[0-9][0-9]*        cvswrappers
+---- $ISO8601DATE 1\.[0-9][0-9]*        group
 ---- $ISO8601DATE 1\.[0-9][0-9]*        loginfo
 ---- $ISO8601DATE 1\.[0-9][0-9]*        modules
 ---- $ISO8601DATE 1\.[0-9][0-9]*        notify
@@ -7583,11 +7629,13 @@
 D/first-dir////
 
 CVSROOT:
+/access/1\.[0-9][0-9]*/$DATE//
 /aclconfig/1\.[0-9][0-9]*/$DATE//
 /checkoutlist/1\.[0-9][0-9]*/$DATE//
 /commitinfo/1\.[0-9][0-9]*/$DATE//
 /config/1\.[0-9][0-9]*/$DATE//
 /cvswrappers/1\.[0-9][0-9]*/$DATE//
+/group/1\.[0-9][0-9]*/$DATE//
 /loginfo/1\.[0-9][0-9]*/$DATE//
 /modules/1\.[0-9][0-9]*/$DATE//
 /notify/1\.[0-9][0-9]*/$DATE//
@@ -7614,11 +7662,13 @@
 first-dir
 
 CVSROOT:
+access
 aclconfig
 checkoutlist
 commitinfo
 config
 cvswrappers
+group
 loginfo
 modules
 notify
@@ -12215,11 +12265,13 @@
          mkdir keywordexpand; cd keywordexpand
 
          dotest keywordexpand-1 "${testcvs} -q co CVSROOT" \
-'U CVSROOT/aclconfig
+'U CVSROOT/access
+U CVSROOT/aclconfig
 U CVSROOT/checkoutlist
 U CVSROOT/commitinfo
 U CVSROOT/config
 U CVSROOT/cvswrappers
+U CVSROOT/group
 U CVSROOT/loginfo
 U CVSROOT/modules
 U CVSROOT/notify
@@ -12359,11 +12411,13 @@
          ############################################################
          # Check out the whole repository
          mkdir 1; cd 1
-         dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/aclconfig
+         dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/access
+U CVSROOT/aclconfig
 U CVSROOT/checkoutlist
 U CVSROOT/commitinfo
 U CVSROOT/config
 U CVSROOT/cvswrappers
+U CVSROOT/group
 U CVSROOT/loginfo
 U CVSROOT/modules
 U CVSROOT/notify
@@ -12386,11 +12440,13 @@
          ############################################################
          # Check out CVSROOT
          mkdir 1; cd 1
-         dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/aclconfig
+         dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/access
+U CVSROOT/aclconfig



Home | Main Index | Thread Index | Old Index