aboutsummaryrefslogtreecommitdiff
path: root/unittest/conftest.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-06-30 18:45:40 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-07-03 12:56:39 +0200
commit7549606cf781c0b1966c5fab7a45e7573bc083b5 (patch)
treeeeb2b16fe1f6efd27eb7d4f853d1bd21bf1d64b2 /unittest/conftest.py
parent3b37f0ea417b58e932b3261f64faff7bc3f4da75 (diff)
downloadlibnitrokey-7549606cf781c0b1966c5fab7a45e7573bc083b5.tar.gz
libnitrokey-7549606cf781c0b1966c5fab7a45e7573bc083b5.tar.bz2
Search for Windows DLLs
Diffstat (limited to 'unittest/conftest.py')
-rw-r--r--unittest/conftest.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py
index 67b45aa..c8d51af 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -24,7 +24,7 @@ def C(request):
for declaration in a:
if declaration.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: