Greg Ward avatar Greg Ward committed ead5e87

Add TESTPATH so it's possible to test multiple versions of Subversion.

Comments (0)

Files changed (4)

 
   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
 ============
 (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
 ============
 
     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.
 
 . ./common.sh
 
+set_path
 check_available "svn --version" "svn, version "
 set -ex
 cd `dirname $`
     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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.