summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-04-14 00:11:01 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-04-14 00:11:01 +0000
commit57ce1838dd5f6c54ea340e08a8e62a16e0377689 (patch)
tree236817959066526ec0301d000cd0dd960c89b7f3
parent62a81ca8f4d116da03c788ebc42b5aa9f4d7c893 (diff)
run the tests from make
-rw-r--r--Makefile.in4
-rw-r--r--lib/Makefile.in2
-rwxr-xr-xlib/zephyr_tests.py8
-rw-r--r--lib/zephyr_tests.txt3
4 files changed, 13 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 5f19b05..8b68aee 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,6 +19,10 @@ INSTALL=@INSTALL@
SUBDIRS=lib libdyn clients server zhm zwgc
+build:
+ $(MAKE) all
+ $(MAKE) check
+
all:
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
diff --git a/lib/Makefile.in b/lib/Makefile.in
index f1b7a38..3b95ffa 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -59,6 +59,8 @@ zephyr_err.c ${BUILDTOP}/h/zephyr/zephyr_err.h: zephyr_err.et
${LIBTOOL} --mode=compile ${CC} -c -o $@ ${ALL_CFLAGS} $<
check:
+ python $(srcdir)/zephyr_tests.py --builddir=$(BUILDTOP)
+ $(srcdir)/zephyr_run_doctests --builddir=$(BUILDTOP)
install: libzephyr.la
${LIBTOOL} --mode=install ${INSTALL} -m 644 libzephyr.la \
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py
index dcc275d..04784c1 100755
--- a/lib/zephyr_tests.py
+++ b/lib/zephyr_tests.py
@@ -469,8 +469,7 @@ class ZephyrTestSuite(TestSuite):
assert self._libzephyr.ZExpandRealm("localhost") == ""
assert self._libzephyr.ZExpandRealm("bitsy.mit.edu") == "ATHENA.MIT.EDU"
-
-if __name__ == "__main__":
+def find_buildpath():
parser = optparse.OptionParser(usage=__doc__,
version = "%%prog %s" % __version__)
parser.add_option("--builddir", default="..",
@@ -478,7 +477,10 @@ if __name__ == "__main__":
opts, args = parser.parse_args()
assert not args, "no args yet"
- tester = ZephyrTestSuite(builddir=os.path.join(opts.builddir, "lib"))
+ return os.path.join(opts.builddir, "lib")
+
+if __name__ == "__main__":
+ tester = ZephyrTestSuite(builddir=find_buildpath())
tester.setup()
failures = tester.run()
tester.cleanup()
diff --git a/lib/zephyr_tests.txt b/lib/zephyr_tests.txt
index ddc6598..939a8f2 100644
--- a/lib/zephyr_tests.txt
+++ b/lib/zephyr_tests.txt
@@ -4,7 +4,8 @@ Generic library setup that should be moved into zephyr_tests.py:
>>> import os
>>> import zephyr_tests
- >>> libzephyr_path = os.path.join("../../../build/", "lib/.libs/", "libzephyr.so.4.0.0")
+ >>> buildpath = zephyr_tests.find_buildpath()
+ >>> libzephyr_path = os.path.join(buildpath, ".libs", "libzephyr.so.4.0.0")
>>> _z = zephyr_tests.libZephyr(libzephyr_path)
ZInit() got run by libZephyr, internally. Make sure other things