summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/zephyr_tests.py18
-rw-r--r--lib/zephyr_tests.txt2
2 files changed, 9 insertions, 11 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
diff --git a/lib/zephyr_tests.txt b/lib/zephyr_tests.txt
index 6b3e0c6..31a5da5 100644
--- a/lib/zephyr_tests.txt
+++ b/lib/zephyr_tests.txt
@@ -17,7 +17,7 @@ Generic library setup that should be moved into zephyr_tests.py:
>>> import os
>>> import zephyr_tests
>>> buildpath = zephyr_tests.find_buildpath()
- >>> libzephyr_path = os.path.join(buildpath, ".libs", "libzephyr.so.4.0.0")
+ >>> libzephyr_path = zephyr_tests.find_libzephyr()
>>> _z = zephyr_tests.libZephyr(libzephyr_path)
ZInit() got run by libZephyr, internally. Make sure other things