aboutsummaryrefslogtreecommitdiff
path: root/unittest/conftest.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-09-20 12:55:16 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-09-20 12:55:16 +0200
commiteb447c7ff965abe92bf49dbf404447b1808322c0 (patch)
tree9309e6614f23cc5cda6042e685b24eaa0a6b5522 /unittest/conftest.py
parent7a04ee7dd3fad10e30581d22956234aeff2b2f3a (diff)
parenta57ed65f90c2ffda245c93aaa4aa710b605550d7 (diff)
downloadlibnitrokey-eb447c7ff965abe92bf49dbf404447b1808322c0.tar.gz
libnitrokey-eb447c7ff965abe92bf49dbf404447b1808322c0.tar.bz2
Merge branch 'windows_MSVC2017' into OSX_merge_cleaned
Diffstat (limited to 'unittest/conftest.py')
-rw-r--r--unittest/conftest.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py
index 67b45aa..04e85ff 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -22,9 +22,9 @@ def C(request):
a = iter(declarations)
for declaration in a:
- if declaration.startswith('NK_C_API'):
+ if declaration.strip().startswith('NK_C_API'):
declaration = declaration.replace('NK_C_API', '').strip()
- while not ';' in declaration:
+ while ';' not in declaration:
declaration += (next(a)).strip()
print(declaration)
ffi.cdef(declaration, override=True)
@@ -32,11 +32,19 @@ def C(request):
C = None
import os, sys
path_build = os.path.join("..", "build")
- paths = [ os.path.join(path_build,"libnitrokey-log.so"),
- os.path.join(path_build,"libnitrokey.so")]
+ paths = [
+ os.path.join(path_build,"libnitrokey-log.so"),
+ os.path.join(path_build,"libnitrokey.so"),
+ os.path.join(path_build,"libnitrokey-log.dll"),
+ os.path.join(path_build,"libnitrokey.dll"),
+ os.path.join(path_build,"nitrokey-log.dll"),
+ os.path.join(path_build,"nitrokey.dll"),
+ ]
for p in paths:
- print p
+ print(p)
+ p = os.path.abspath(p)
if os.path.exists(p):
+ print("Found: "+p)
C = ffi.dlopen(p)
break
else: