summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Mark W. Eichin <eichin@thok.org>2009-04-07 05:14:11 +0000
committerGravatar Mark W. Eichin <eichin@thok.org>2009-04-07 05:14:11 +0000
commite8d282aaea77c41891aea7eb0f0dc6a0bf2b7163 (patch)
treea53654b4f4be826a39b6a6401bb2893587363fe3 /lib
parent25ba95710a0e04e657f01f7ffd298095fa8c295b (diff)
allow callers to specify the installed shared lib
Diffstat (limited to 'lib')
-rwxr-xr-xlib/zephyr_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py
index 91edf68..3a4352e 100755
--- a/lib/zephyr_tests.py
+++ b/lib/zephyr_tests.py
@@ -11,6 +11,7 @@
import optparse
import os
import ctypes
+import ctypes.util
from ctypes import c_int, c_uint, c_ushort, c_char, c_ubyte
from ctypes import c_uint16, c_uint32
from ctypes import POINTER, c_void_p, c_char_p
@@ -194,8 +195,10 @@ class libZephyr(object):
"ZParseNotice",
"ZFormatNotice",
]
- def __init__(self, library_path):
+ def __init__(self, library_path=None):
"""connect to the library and build the wrappers"""
+ if not library_path:
+ library_path = ctypes.util.find_library("zephyr")
self._lib = ctypes.cdll.LoadLibrary(library_path)
# generic bindings?
@@ -303,7 +306,6 @@ class ZephyrTestSuite(TestSuite):
print "ZParseNotice:", "retval", st
print "\tz_version", new_notice.z_version
-
if __name__ == "__main__":
parser = optparse.OptionParser(usage=__doc__,
version = "%%prog %s" % __version__)