You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2019/01/22 13:55:55 UTC
svn commit: r1851815 - in /subversion/trunk: Makefile.in
subversion/tests/cmdline/svnserveautocheck.sh
Author: brane
Date: Tue Jan 22 13:55:54 2019
New Revision: 1851815
URL: http://svn.apache.org/viewvc?rev=1851815&view=rev
Log:
Add logging to the svnserveautocheck configuration.
* Makefile.in (check-clean): Clean up the svnserveautocheck and davautocheck
configuration/log directories.
* subversion/tests/cmdline/svnserveautocheck.sh
(query): New function, copied unchanged from davautocheck.sh.
(SVNSERVE_ROOT): Temporary directory for svnserve.pid and svnserve.log.
- Run sevnserve with logging enabled;
- Offer to browse the log file before ending the script.
Modified:
subversion/trunk/Makefile.in
subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh
Modified: subversion/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1851815&r1=1851814&r2=1851815&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Tue Jan 22 13:55:54 2019
@@ -706,7 +706,8 @@ check-clean: gcov-clean
subversion/tests/libsvn_diff/T1 \
subversion/tests/libsvn_diff/T2 \
subversion/tests/libsvn_diff/T3 \
- subversion/tests/svnserveautocheck.pid \
+ subversion/tests/cmdline/httpd-* \
+ subversion/tests/cmdline/svnserve-* \
tests.log fails.log
mkdir-init:
Modified: subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh?rev=1851815&r1=1851814&r2=1851815&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh Tue Jan 22 13:55:54 2019
@@ -74,6 +74,28 @@ fail() {
exit 1
}
+query() {
+ printf "%s" "$SCRIPT: $1 (y/n)? [$2] "
+ if [ -n "$BASH_VERSION" ]; then
+ read -n 1 -t 32
+ else
+ #
+ prog="
+import select as s
+import sys
+import tty, termios
+tty.setcbreak(sys.stdin.fileno(), termios.TCSANOW)
+if s.select([sys.stdin.fileno()], [], [], 32)[0]:
+ sys.stdout.write(sys.stdin.read(1))
+"
+ stty_state=`stty -g`
+ REPLY=`$PYTHON -u -c "$prog" "$@"`
+ stty $stty_state
+ fi
+ echo
+ [ "${REPLY:-$2}" = 'y' ]
+}
+
# Compute ABS_BUILDDIR and ABS_SRCDIR.
if [ -x subversion/svn/svn ]; then
# cwd is build tree root
@@ -92,13 +114,21 @@ if [ ! -e $ABS_SRCDIR/subversion/include
fail "Run this script from the root of Subversion's build tree!"
fi
+# Create a directory for the PID and log files. If you change this, also make
+# sure to change the svn:ignore entry for it and "make check-clean".
+SVNSERVE_ROOT="$ABS_BUILDDIR/subversion/tests/cmdline/svnserve-$(date '+%Y%m%d-%H%M%S')"
+mkdir "$SVNSERVE_ROOT" \
+ || fail "couldn't create temporary directory '$SVNSERVE_ROOT'"
+
# If you change this, also make sure to change the svn:ignore entry
# for it and "make check-clean".
-SVNSERVE_PID=$ABS_BUILDDIR/subversion/tests/svnserveautocheck.pid
+SVNSERVE_PID=$SVNSERVE_ROOT/svnserve.pid
+SVNSERVE_LOG=$SVNSERVE_ROOT/svnserve.log
SERVER_CMD="$ABS_BUILDDIR/subversion/svnserve/svnserve"
rm -f $SVNSERVE_PID
+rm -f $SVNSERVE_LOG
random_port() {
if [ -n "$BASH_VERSION" ]; then
@@ -140,6 +170,7 @@ fi
--listen-host 127.0.0.1 \
--listen-port $SVNSERVE_PORT \
--pid-file $SVNSERVE_PID \
+ --log-file $SVNSERVE_LOG \
$SVNSERVE_ARGS &
BASE_URL=svn://127.0.0.1:$SVNSERVE_PORT
@@ -155,5 +186,11 @@ else
cd - > /dev/null
fi
+query 'Browse server log' n \
+ && less "$SVNSERVE_LOG"
+
+query 'Delete svnserve root directory' y \
+ && rm -fr "$SVNSERVE_ROOT/"
+
really_cleanup
exit $r