tests: Test against source man pages.
authorMike Kelly <pioto@pioto.org>
Wed, 30 May 2012 07:02:00 +0000 (03:02 -0400)
committerDavid Bremner <bremner@debian.org>
Sun, 2 Sep 2012 02:16:39 +0000 (23:16 -0300)
Without this, help-test tests against the installed man pages, rather
than the default ones.

test/test-lib.sh

index 663b18e69d05558fc624aef1cd4c5166977c240a..f34b1fb86af15eb89b91c328e2558d0f0eb8207b 100644 (file)
@@ -1070,6 +1070,7 @@ find_notmuch_path ()
 # Test the binaries we have just built.  The tests are kept in
 # test/ subdirectory and are run in 'trash directory' subdirectory.
 TEST_DIRECTORY=$(pwd)
+notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
 if test -n "$valgrind"
 then
        make_symlink () {
@@ -1130,11 +1131,15 @@ then
        PATH=$GIT_VALGRIND/bin:$PATH
        GIT_EXEC_PATH=$GIT_VALGRIND/bin
        export GIT_VALGRIND
+       test -n "$notmuch_path" && MANPATH="$notmuch_path/man:$MANPATH"
 else # normal case
-       notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
-       test -n "$notmuch_path" && PATH="$notmuch_path:$PATH"
+       if test -n "$notmuch_path"
+               then
+                       PATH="$notmuch_path:$PATH"
+                       MANPATH="$notmuch_path/man:$MANPATH"
+               fi
 fi
-export PATH
+export PATH MANPATH
 
 # Test repository
 test="tmp.$(basename "$0" .sh)"