summaryrefslogtreecommitdiff
path: root/lib/zephyr_tests.py
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-08-01 19:55:14 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-08-01 19:55:14 +0000
commite4ca408b86f1c4846f46cb5de7af89dcc67fcc78 (patch)
tree404d3e28923a3c305acad677a7a6ae913e0eb54a /lib/zephyr_tests.py
parent58477d8b58231a3ffb594aeb19bb616378b0701f (diff)
Further refactor the library locater, and make the doctests use it
Diffstat (limited to 'lib/zephyr_tests.py')
-rwxr-xr-xlib/zephyr_tests.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py
index 371ab99..4685c87 100755
--- a/lib/zephyr_tests.py
+++ b/lib/zephyr_tests.py
@@ -62,20 +62,18 @@ def py_make_zcode(input):
"""reference ZMakeZcode expressed as python..."""
return "Z" + input.replace("\xff", "\xff\xf1").replace("\0", "\xff\xf0")
+def find_libzephyr(builddir='.'):
+ # find the library
+ libzephyr_paths = ['libzephyr.so', 'libzephyr.dylib']
+ libzephyr_paths += [os.path.join('.libs', i) for i in libzephyr_paths]
+ libzephyr_paths = [os.path.join(builddir, i) for i in libzephyr_paths]
+ libzephyr_paths = [i for i in libzephyr_paths if os.path.exists(i)]
+ return libzephyr_paths[0]
class ZephyrTestSuite(TestSuite):
"""Tests for libzephyr"""
def setup(self):
- # find the library
- libzephyr_paths = ['libzephyr.so', 'libzephyr.dylib']
- libzephyr_paths += [os.path.join('.libs', i) for i in libzephyr_paths]
- libzephyr_paths = [os.path.join(self.builddir, i) for i in libzephyr_paths]
- libzephyr_paths = [i for i in libzephyr_paths if os.path.exists(i)]
- libzephyr_path = libzephyr_paths[0]
- # check for libtool...
- if not os.path.exists(libzephyr_path):
- libzephyr_path = os.path.join(self.builddir, ".libs", "libzephyr.so.4.0.0")
- self._libzephyr = libZephyr(libzephyr_path)
+ self._libzephyr = libZephyr(find_libzephyr(self.builddir))
def cleanup(self):
# no cleanup needed yet