[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] tools/test-script/svntest: test ra_dav also and use conditionally ramdisk

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-11-04 02:14:28 CET

Jani Averbach wrote:

>tools/test-scripts/svntest/svntest.sh
> - check essential config variables
> - rebuilding of apr, apr-util and httpd
> - run ra_dav test
> - send out result emails of ra_dav also
>
>
(This is not correct log message format... :-)
[...]

>Index: tools/test-scripts/svntest/svntest.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest.sh (working copy)
>
>
Looks good. The variable checks are especially useful. I'm not too sure
about the portability of 'test -z', though.

>Index: tools/test-scripts/svntest/svntest-update.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest-update.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest-update.sh (working copy)
>
>
Looks good.

>Index: tools/test-scripts/svntest/svntest-run.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest-run.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest-run.sh (working copy)
>@@ -10,7 +10,7 @@
> # Compute local vars
> LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE.$RA_TYPE"
> TEST="`$GUESS` $BUILD_TYPE $RA_TYPE"
>-REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
>+REV="`$SVNBIN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
>
> # Prime and initialize the log file
> $CP_F "$LOG_FILE_PREFIX.$BUILD_TYPE" $LOG_FILE
>@@ -25,7 +25,7 @@
> static) OBJ="$OBJ_STATIC" ;;
> *) echo "$BUILD_TYPE: unknown build type"
> echo "$BUILD_TYPE: unknown build type" >> $LOG_FILE
>- FAIL ;;
>+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests";;
>
>
You've changed most FAILs to 'FAIL umount_ramdisk ...'. Why not just put
this logic into FAIL? After all, umount_ramdisk a) already checks if the
ramdisk was moutned and b) can extract the parameter from global state.
[...]

> # Check that the object directory exists, and that it contains the
> # necessary executable files
> START "check object directory" "Checking object directory..."
>-test -d $TEST_ROOT/$OBJ || FAIL; PASS
>+test -d $TEST_ROOT/$OBJ || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
>
>
Please please please please keep lines under 80 columns, please please ...
[...]

>Index: tools/test-scripts/svntest/svntest-config.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest-config.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest-config.sh (working copy)
>@@ -3,16 +3,42 @@
> #
> # Root of the test tree
> #
>-TEST_ROOT="/home/brane/svn"
>+TEST_ROOT="/data/svntest"
>
>
If you do this, please change the references in README, too.
[...]

>+SVN="svn"
>+SVN_REPO="$TEST_ROOT/$SVN"
>
>
I'd suggest using $SVN_NAME here instead of $SVN, and anologously for
apr, apr-util and httpd. It's confusing that $USRBIN and $LOCALBIN refer
to directories, but $SVNBIN refers to a file.
[...]

>@@ -21,7 +47,7 @@
> #
> # Configure script prefix and object directory names
> #
>-CONFIG_PREFIX="config.solaris"
>+CONFIG_PREFIX="config"
> OBJ_STATIC="obj-st"
> OBJ_SHARED="obj-sh"
>
>@@ -36,40 +62,47 @@
> #
> # Path to utilities
> #
>-BIN="/usr/bin"
>+BIN="/bin"
>+USRBIN="/usr/bin"
> LOCALBIN="/usr/local/bin"
>+OPTBIN="/opt/bin"
>
>
[etc]

> RM_F="$BIN/rm -f"
> RM_RF="$BIN/rm -rf"
>-SED="$BIN/sed"
>-TAIL="$BIN/tail"
>+SED="$USRBIN/sed"
>+TAIL_100="$USRBIN/tail -n 100"
>+TOUCH="$BIN/touch"
>+UMOUNT="$BIN/umount"
>
>
These changes are going to make life a living hell for me if/when I
migrate them to other OSes; but that's my problem, I guess...

> #
> # Helper functions
>@@ -85,7 +118,7 @@
> # Test failed
> FAIL() {
> echo "FAIL: $TST" >> $LOG_FILE
>- test -n "$1" && eval "$1" # Run cleanup code
>+ test -n "$1" && eval "$1" "$@" # Run cleanup code
>
>
See? Put the umount_ramdisk call here, and half your diffs go away.
[...]

>Index: tools/test-scripts/svntest/svntest-rebuild.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest-rebuild.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest-rebuild.sh (working copy)
>
>
Looks good, except for the comments above.

>Index: tools/test-scripts/svntest/svntest-sendmail.sh
>===================================================================
>--- tools/test-scripts/svntest/svntest-sendmail.sh (revision 7624)
>+++ tools/test-scripts/svntest/svntest-sendmail.sh (working copy)
>@@ -11,7 +11,7 @@
> # Compute local vars
> LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE"
> TEST="`$GUESS` $BUILD_TYPE"
>-REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
>+REV="`$SVNBIN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
> test -z "$RA_TYPE" || {
> LOG_FILE="$LOG_FILE.$RA_TYPE"
> TEST="$TEST $RA_TYPE"
>
>
There wouldn've been no changes here at all if you hadn't renamed $SVN
to $SVNBIN...

>Index: tools/test-scripts/svntest/README
>===================================================================
>--- tools/test-scripts/svntest/README (revision 7624)
>+++ tools/test-scripts/svntest/README (working copy)
>
>
[...]

>+ Also notice that this test script will wipe out following paths
>+ during rebuilding:
>+ $INST_DIR/<proj_name>, ie. with present configuration the paths are:
>+ /home/brane/svn/inst/{apr-0.9,apr-util-0.9,httpd-2.0,svn}
>
>
Not if your change to use /data/svntest stays in. And so on in the rest
of the file.
[...]

>+8) If you like force rebuilding of some component, you could do:
>+ echo "1" > $PROJ_REPO.rb, dependies are:
>+ apr-util depends of apr, and httpd depends of apr and apr-util.
>
>
Depends _on_, not depends _of_.

"B is a dependency of A, therefore A depends on B".

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 4 02:15:14 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.