diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-11 15:35:19 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-10-11 18:01:32 +0200 |
commit | 1a446933032beca0b1c5764acf23940ceb7a43ab (patch) | |
tree | 40c5819c29bd7ec047819c5d7eac0acb68be1ada /unittest/conftest.py | |
parent | 97f965ebad4e15912e401ecb8bf2b259e093d91b (diff) | |
download | libnitrokey-1a446933032beca0b1c5764acf23940ceb7a43ab.tar.gz libnitrokey-1a446933032beca0b1c5764acf23940ceb7a43ab.tar.bz2 |
Allow to use library path in tests from environment variable
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/conftest.py')
-rw-r--r-- | unittest/conftest.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py index ef4539c..a53b005 100644 --- a/unittest/conftest.py +++ b/unittest/conftest.py @@ -36,13 +36,15 @@ def C(request): import os, sys path_build = os.path.join("..", "build") paths = [ + os.environ.get('LIBNK_PATH', None), os.path.join(path_build,"libnitrokey.so"), os.path.join(path_build,"libnitrokey.dylib"), os.path.join(path_build,"libnitrokey.dll"), os.path.join(path_build,"nitrokey.dll"), ] for p in paths: - print(p) + if not p: continue + print("Trying " +p) p = os.path.abspath(p) if os.path.exists(p): print("Found: "+p) @@ -50,7 +52,6 @@ def C(request): break else: print("File does not exist: " + p) - print("Trying another") if not C: print("No library file found") sys.exit(1) |