selftest: do not run doc tests if we don't build manpages
authorMatthieu Patou <mat@matws.net>
Sun, 5 May 2013 22:37:58 +0000 (15:37 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 May 2013 10:53:36 +0000 (12:53 +0200)
if XSLTPROC_MANPAGES is not set then manpages won't be built so there is
no sense trying to test it.
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May  6 12:53:37 CEST 2013 on sn-devel-104

selftest/tests.py

index 9a59e9d0db1c0a099d042683ad64b6070e8b872a..aebfc57630c3c3429007fce09bf01400f2211e33 100644 (file)
 
 from selftesthelpers import *
 
+try:
+    config_h = os.environ["CONFIG_H"]
+except KeyError:
+    config_h = os.path.join(samba4bindir, "default/include/config.h")
+
+# define here var to check what we support
+f = open(config_h, 'r')
+try:
+    have_man_pages_support = ("XSLTPROC_MANPAGES 1" in f.read())
+finally:
+    f.close()
+
 planpythontestsuite("none", "samba.tests.source")
-planpythontestsuite("none", "samba.tests.docs")
+if have_man_pages_support:
+    planpythontestsuite("none", "samba.tests.docs")
+
 planpythontestsuite("none", "selftest.tests.test_suite", extra_path=[srcdir()])
 planpythontestsuite("none", "subunit")
 planpythontestsuite("none", "samba.tests.blackbox.ndrdump")