diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-11 08:35:50 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-12 11:42:57 +0100 |
commit | 21b8ce263ad8990daed8ad2d4d79e6e0cf9e3c10 (patch) | |
tree | 624f40aa78f54d0856b6bf293a40d2b246006eec /sources/shiboken2/tests/samplebinding/hashabletype_test.py | |
parent | 125c35014aeb4ae6944f8d2b3cdc673dce7bee3e (diff) |
Fix running the shiboken tests for Python 3.8/Windows
On Windows, DLL directories can no longer be specified
via the PATH environment variable. They need to be added
via os.add_dll_directory().
In order to fix this, move the entire environment setup
from CMake to a python helper and set a single
environment variable BUILD_DIR pointing to the build
directory from CMake.
In addition, this has a huge advantage: The tests can
also be executed much more easily without ctest from the
command line by just setting BUILD_DIR instead of a
complex manipulation of PATH/LD_LIBRARY_PATH.
Change-Id: I7dceafd2c38fed5320a534322f265489657b95d3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/tests/samplebinding/hashabletype_test.py')
-rw-r--r-- | sources/shiboken2/tests/samplebinding/hashabletype_test.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/samplebinding/hashabletype_test.py b/sources/shiboken2/tests/samplebinding/hashabletype_test.py index c628c1751..b985abaad 100644 --- a/sources/shiboken2/tests/samplebinding/hashabletype_test.py +++ b/sources/shiboken2/tests/samplebinding/hashabletype_test.py @@ -31,8 +31,14 @@ '''Test cases for __hash__''' +import os +import sys import unittest +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from shiboken_paths import init_paths +init_paths() + from sample import * class HashableTest(unittest.TestCase): |