diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-03 18:09:49 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-03 18:09:49 +0200 |
commit | 7f7cfeb45b579204e0bc94bea37e2c810d2e5ec9 (patch) | |
tree | 4058c41e2460fad253ec0290a56166e46a28bc78 /unittest/conftest.py | |
parent | 8f7435e4553916e6cc431e4b5316cc5861fd9063 (diff) | |
parent | 7d0d03428f90d3f65452eb7035bb715efec87ac8 (diff) | |
download | libnitrokey-7f7cfeb45b579204e0bc94bea37e2c810d2e5ec9.tar.gz libnitrokey-7f7cfeb45b579204e0bc94bea37e2c810d2e5ec9.tar.bz2 |
Merge branch 'OSX_merge_cleaned'
This merge:
- fixes issues with invalid mutex
- moves tests to Python 3
- allows to compile the code natively under Visual Studio with CMake
- allows to compile under QtCreator under MS Windows
- fixes some issues with test suite
- allows to run tests under Windows
- allows to compile using QMake (and easy adding to Qt projects)
- decreases delays between sending commands thus increasing 2x
communication speed
Diffstat (limited to 'unittest/conftest.py')
-rw-r--r-- | unittest/conftest.py | 18 |
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: |