changeset 166:ead5e87b1579

Add TESTPATH so it's possible to test multiple versions of Subversion.
author Greg Ward <greg@gerg.ca>
date Sun, 03 Nov 2013 18:04:21 -0500
parents bdf57a502324
children e46f03970944
files README.txt tests/common.sh tests/setup-svn tests/test-svn
diffstat 4 files changed, 60 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/README.txt
+++ b/README.txt
@@ -37,6 +37,12 @@
 
   make install DESTDIR=/tmp/packageroot PREFIX=/usr
 
+Please report build failures to the development mailing list,
+vcprompt-devel@googlegroups.com.
+
+vcprompt includes a fairly comprehensive test suite. If you want to
+run it, see "Testing" below.
+
 
 Dependencies
 ============
@@ -106,6 +112,46 @@
 (For more details, see the man page.)
 
 
+Testing
+=======
+
+To run vcprompt's test suite:
+
+  make check
+
+If it fails, it should be loud and obvious. Please report any test
+failures to the development mailing list:
+vcprompt-devel@googlegroups.com.
+
+To check for memory errors, you can run vcprompt's test suite under
+valgrind:
+
+  make grind
+
+Obviously, this requires that you have valgrind installed.
+
+Testing different Subversion versions
+-------------------------------------
+
+Subversion changes its working copy format every couple of years, so
+vcprompt supports three formats: the pre-1.4 XML format, the 1.4..1.6
+plain-text format, and the post-1.7 SQLite format. Actually testing
+these requires that you have different versions of Subversion on hand,
+each installed in a separate prefix.
+
+For example, I keep multiple versions in /usr/local/subversion-1.x, so
+I can test them like this:
+
+  rm -f tests/svn-repo.tar && make check-svn TOOLPATH=/usr/local/subversion-1.6/bin
+  rm -f tests/svn-repo.tar && make check-svn TOOLPATH=/usr/local/subversion-1.7/bin
+
+Actually *building* multiple versions of Subversion is harder than you
+would believe. (In fact, I've been unable to build anything older than
+1.5, so vcprompt's support for pre-1.4 working copies is currently
+untested.)
+
+
+
 Contributing
 ============
 
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -12,6 +12,16 @@
     exit 1
 }
 
+# Prepend $TOOLPATH to $PATH (if $TOOLPATH set), so caller can
+# influence where external tools (e.g. svn, hg) are found. Must be
+# called before check_available if it's to be of any use.
+set_path()
+{
+    if [ -s "$TOOLPATH" ]; then
+        PATH=$TOOLPATH:$PATH
+    fi
+}
+
 # Check if some external command is available by running it
 # and ensuring that it prints an expected string.  If not,
 # exit with optional message.
--- a/tests/setup-svn
+++ b/tests/setup-svn
@@ -6,6 +6,7 @@
 
 . ./common.sh
 
+set_path
 check_available "svn --version" "svn, version "
 set -ex
 cd `dirname $`
--- a/tests/test-svn
+++ b/tests/test-svn
@@ -53,8 +53,11 @@
     svn -q switch $repourl/branches/stable
     assert_vcprompt "no branch name on branch" "" "%b"
     assert_vcprompt "rev num on branch" "4" "%r"
+
+    posttest
 }
 
+set_path
 find_vcprompt
 check_svn
 find_svnrepo