summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-05-13 04:38:09 +0000
committerTim Potter <tpot@samba.org>2003-05-13 04:38:09 +0000
commit660e1a77dc9df89ee3ddefae7689552e42e6172b (patch)
tree7445af22d994a82a65cfc8f47850230667d30009 /source3
parent9b32fe9a2fb3a395a5f8ca6e3cb49d4e1659f2b6 (diff)
downloadsamba-660e1a77dc9df89ee3ddefae7689552e42e6172b.tar.gz
samba-660e1a77dc9df89ee3ddefae7689552e42e6172b.tar.bz2
samba-660e1a77dc9df89ee3ddefae7689552e42e6172b.zip
Add pythoncheck to make check target.
(This used to be commit 7149dc65c7e22d53110c5e8bbab8ba96963ade76)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in5
-rwxr-xr-xsource3/stf/pythoncheck.py48
2 files changed, 52 insertions, 1 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 7f9c2a8b93..2e5bf71923 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1375,7 +1375,10 @@ Makefile: $(srcdir)/Makefile.in config.status
check: check-programs
LD_LIBRARY_PATH="`pwd`/bin:$$LD_LIBRARY_PATH" \
PATH="`pwd`/bin:$$PATH" \
- python stf/standardcheck.py
+ python stf/standardcheck.py; \
+ if test -n "$(PYTHON)"; then \
+ python stf/pythoncheck.py; \
+ fi
# These are called by the test suite and need to be built before
# running it. For the time being we don't build all of BIN_PROGS,
diff --git a/source3/stf/pythoncheck.py b/source3/stf/pythoncheck.py
new file mode 100755
index 0000000000..398bb2c3d6
--- /dev/null
+++ b/source3/stf/pythoncheck.py
@@ -0,0 +1,48 @@
+#! /usr/bin/python
+
+# Comfychair test cases for Samba python extensions
+
+# Copyright (C) 2003 by Tim Potter <tpot@samba.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+"""These tests are run by Samba's "make check"."""
+
+import sys, comfychair
+
+class ImportTest(comfychair.TestCase):
+ """Check that all modules can be imported without error."""
+ def runtest(self):
+ python_modules = ['spoolss', 'lsa', 'samr', 'winbind', 'winreg',
+ 'srvsvc', 'tdb', 'smb', 'tdbpack']
+ for m in python_modules:
+ try:
+ __import__('samba.%s' % m)
+ except ImportError, msg:
+ self.log(str(msg))
+ self.fail('error importing %s module' % m)
+
+tests = [ImportTest]
+
+if __name__ == '__main__':
+ # Some magic to repend build directory to python path so we see the
+ # objects we have built and not previously installed stuff.
+ from distutils.util import get_platform
+ from os import getcwd
+ sys.path.insert(0, '%s/build/lib.%s-%s' %
+ (getcwd(), get_platform(), sys.version[0:3]))
+
+ comfychair.main(tests)