subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1421594 - in /subversion/trunk/subversion/tests/cmdline: davautocheck.sh svnserveautocheck.sh
Date Thu, 13 Dec 2012 22:47:29 GMT
Author: breser
Date: Thu Dec 13 22:47:27 2012
New Revision: 1421594

URL: http://svn.apache.org/viewvc?rev=1421594&view=rev
Log:
Allow for time not to be available in (svnserve|dav)autocheck.

time is not installed on some platforms because it is built into the shell.
However, additionally /bin/sh may be a very limited POSIX compliant shell
like dash that doesn't have time.

* subversion/tests/cmdline/svnserveautocheck.sh,
  subversion/tests/cmdline/davautocheck.sh:
  Test for the availability of time and only use it if available. 

Modified:
    subversion/trunk/subversion/tests/cmdline/davautocheck.sh
    subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh

Modified: subversion/trunk/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/davautocheck.sh?rev=1421594&r1=1421593&r2=1421594&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/trunk/subversion/tests/cmdline/davautocheck.sh Thu Dec 13 22:47:27 2012
@@ -523,6 +523,12 @@ if [ $# -eq 1 ] && [ "x$1" = 'x--no-test
   exit
 fi
 
+if type time > /dev/null; then
+  TIME_CMD=time
+else
+  TIME_CMD=""
+fi
+
 say "starting the tests..."
 
 CLIENT_CMD="$ABS_BUILDDIR/subversion/svn/svn"
@@ -540,13 +546,13 @@ else
 fi
 
 if [ $# = 0 ]; then
-  time make check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
+  $TIME_CMD make check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
   r=$?
 else
   (cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $SSL_TEST_ARG
"$@")
+  $TIME_CMD "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $SSL_TEST_ARG
"$@")
   r=$?
 fi
 

Modified: subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh?rev=1421594&r1=1421593&r2=1421594&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/trunk/subversion/tests/cmdline/svnserveautocheck.sh Thu Dec 13 22:47:27 2012
@@ -92,6 +92,12 @@ random_port() {
   fi
 }
 
+if type time > /dev/null; then
+  TIME_CMD=time
+else
+  TIME_CMD=""
+fi
+
 SVNSERVE_PORT=$(random_port)
 while netstat -an | grep $SVNSERVE_PORT | grep 'LISTEN'; do
   SVNSERVE_PORT=$(random_port)
@@ -113,13 +119,13 @@ fi
 
 BASE_URL=svn://127.0.0.1:$SVNSERVE_PORT
 if [ $# = 0 ]; then
-  time make check "BASE_URL=$BASE_URL"
+  $TIME_CMD make check "BASE_URL=$BASE_URL"
   r=$?
 else
   cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  time "./${TEST}_tests.py" "--url=$BASE_URL" $*
+  $TIME_CMD "./${TEST}_tests.py" "--url=$BASE_URL" $*
   r=$?
   cd - > /dev/null
 fi



Mime
View raw message