diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-12 09:44:04 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-28 15:06:47 +0100 |
commit | 4a8a2713433154aee21f1f83ef3e9e7dc9466275 (patch) | |
tree | 7d874494c9de67bb92377b9c1a8f6d2752a375c4 /sources/pyside2/tests/QtCore/bug_826.py | |
parent | 6d1177b36d4fc89012377d3dbe19867737b80c2e (diff) |
Fix running the PySide2 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 the environment
variables BUILD_DIR and QT_DIR pointing to the build
directory and Qt directory, respectively, 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 and QT_DIR instead
of a complex manipulation of PATH/LD_LIBRARY_PATH.
Change-Id: I7d518ccab19ca184c3112a126c779d4a6d7c6c5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/tests/QtCore/bug_826.py')
-rw-r--r-- | sources/pyside2/tests/QtCore/bug_826.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtCore/bug_826.py b/sources/pyside2/tests/QtCore/bug_826.py index b5701fc5a..cb72e011e 100644 --- a/sources/pyside2/tests/QtCore/bug_826.py +++ b/sources/pyside2/tests/QtCore/bug_826.py @@ -26,10 +26,17 @@ ## ############################################################################# +import os +import sys +import unittest + +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from init_paths import init_test_paths +init_test_paths(False) + from PySide2.QtCore import QEvent, Qt import PySide2 -import unittest TEST_EVENT_TYPE = QEvent.Type(QEvent.registerEventType()) |