]> git.notmuchmail.org Git - notmuch/commitdiff
test: conditionally test help system depending on configured support
authorJani Nikula <jani@nikula.org>
Wed, 26 Mar 2014 08:48:12 +0000 (09:48 +0100)
committerDavid Bremner <david@tethera.net>
Wed, 26 Mar 2014 10:43:36 +0000 (07:43 -0300)
If neither sphinx nor rst2man is available, the notmuch man pages will
not be available. Take this into account in the help system test.

test/Makefile.local
test/T010-help-test.sh

index 2b18bdb92af1b43bcbe25dc15fd6f1e66fc935a2..987441f04f1d689758e6825272d8b9c9210a2841 100644 (file)
@@ -42,10 +42,18 @@ else
        ln -sf /bin/false $@
 endif
 
+$(dir)/have-man: Makefile.config
+ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
+       ln -sf /bin/false $@
+else
+       ln -sf /bin/true $@
+endif
+
 .PHONY: test check
 
 TEST_BINARIES=$(dir)/arg-test \
              $(dir)/have-compact \
+             $(dir)/have-man \
              $(dir)/hex-xcode \
              $(dir)/random-corpus \
              $(dir)/parse-time \
index f7df725eea611797c333ba7a5a759cf31b9171f0..77410bc54e66253b57fccef0013f0d4c3034acf4 100755 (executable)
@@ -4,9 +4,17 @@ test_description="online help"
 . ./test-lib.sh
 
 test_expect_success 'notmuch --help' 'notmuch --help'
-test_expect_success 'notmuch --help tag' 'notmuch --help tag'
 test_expect_success 'notmuch help' 'notmuch help'
-test_expect_success 'notmuch help tag' 'notmuch help tag'
 test_expect_success 'notmuch --version' 'notmuch --version'
 
+if ${TEST_DIRECTORY}/have-man; then
+    test_expect_success 'notmuch --help tag' 'notmuch --help tag'
+    test_expect_success 'notmuch help tag' 'notmuch help tag'
+else
+    test_expect_success 'notmuch --help tag (man pages not available)' \
+       'test_must_fail notmuch --help tag'
+    test_expect_success 'notmuch help tag (man pages not available)' \
+       'test_must_fail notmuch help tag'
+fi
+
 test_done