aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/QtUiTools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-12 09:44:04 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-28 15:06:47 +0100
commit4a8a2713433154aee21f1f83ef3e9e7dc9466275 (patch)
tree7d874494c9de67bb92377b9c1a8f6d2752a375c4 /sources/pyside2/tests/QtUiTools
parent6d1177b36d4fc89012377d3dbe19867737b80c2e (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/QtUiTools')
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_1060.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_360.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_376.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_392.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_426.py8
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_552.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_797.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_909.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_913.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_958.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_965.py7
-rw-r--r--sources/pyside2/tests/QtUiTools/ui_test.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/uiloader_test.py4
13 files changed, 45 insertions, 14 deletions
diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.py b/sources/pyside2/tests/QtUiTools/bug_1060.py
index 22da11a82..f60912780 100644
--- a/sources/pyside2/tests/QtUiTools/bug_1060.py
+++ b/sources/pyside2/tests/QtUiTools/bug_1060.py
@@ -31,7 +31,9 @@
import os
import sys
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.helper import adjust_filename
from PySide2.QtWidgets import QApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_360.py b/sources/pyside2/tests/QtUiTools/bug_360.py
index 6af5ff49d..8d15f2730 100644
--- a/sources/pyside2/tests/QtUiTools/bug_360.py
+++ b/sources/pyside2/tests/QtUiTools/bug_360.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_376.py b/sources/pyside2/tests/QtUiTools/bug_376.py
index 1da380fd3..264faad7f 100644
--- a/sources/pyside2/tests/QtUiTools/bug_376.py
+++ b/sources/pyside2/tests/QtUiTools/bug_376.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py
index 9b5782f2b..2439e7203 100644
--- a/sources/pyside2/tests/QtUiTools/bug_392.py
+++ b/sources/pyside2/tests/QtUiTools/bug_392.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py
index 5b055a45f..e84da0382 100644
--- a/sources/pyside2/tests/QtUiTools/bug_426.py
+++ b/sources/pyside2/tests/QtUiTools/bug_426.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import sys
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 import QtCore, QtWidgets
from PySide2.QtUiTools import QUiLoader
diff --git a/sources/pyside2/tests/QtUiTools/bug_552.py b/sources/pyside2/tests/QtUiTools/bug_552.py
index 7a0530897..be42789cf 100644
--- a/sources/pyside2/tests/QtUiTools/bug_552.py
+++ b/sources/pyside2/tests/QtUiTools/bug_552.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.helper import adjust_filename
from PySide2 import QtWidgets, QtCore
diff --git a/sources/pyside2/tests/QtUiTools/bug_797.py b/sources/pyside2/tests/QtUiTools/bug_797.py
index 0fb7ed435..454699196 100644
--- a/sources/pyside2/tests/QtUiTools/bug_797.py
+++ b/sources/pyside2/tests/QtUiTools/bug_797.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_909.py b/sources/pyside2/tests/QtUiTools/bug_909.py
index 5c9c12521..9831b6b0e 100644
--- a/sources/pyside2/tests/QtUiTools/bug_909.py
+++ b/sources/pyside2/tests/QtUiTools/bug_909.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 QFile
from PySide2.QtWidgets import QTabWidget
diff --git a/sources/pyside2/tests/QtUiTools/bug_913.py b/sources/pyside2/tests/QtUiTools/bug_913.py
index b0a871b8b..3e2ca818b 100644
--- a/sources/pyside2/tests/QtUiTools/bug_913.py
+++ b/sources/pyside2/tests/QtUiTools/bug_913.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_958.py b/sources/pyside2/tests/QtUiTools/bug_958.py
index f631d36e3..98ac16189 100644
--- a/sources/pyside2/tests/QtUiTools/bug_958.py
+++ b/sources/pyside2/tests/QtUiTools/bug_958.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 import QtWidgets, QtUiTools
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_965.py b/sources/pyside2/tests/QtUiTools/bug_965.py
index a8fabe727..217f948af 100644
--- a/sources/pyside2/tests/QtUiTools/bug_965.py
+++ b/sources/pyside2/tests/QtUiTools/bug_965.py
@@ -26,12 +26,15 @@
##
#############################################################################
-from PySide2.QtUiTools import QUiLoader
import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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.QtUiTools import QUiLoader
from helper.usesqapplication import UsesQApplication
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/ui_test.py b/sources/pyside2/tests/QtUiTools/ui_test.py
index 2fe78fba4..6705bb0be 100644
--- a/sources/pyside2/tests/QtUiTools/ui_test.py
+++ b/sources/pyside2/tests/QtUiTools/ui_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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.QtUiTools import QUiLoader
diff --git a/sources/pyside2/tests/QtUiTools/uiloader_test.py b/sources/pyside2/tests/QtUiTools/uiloader_test.py
index 4f5881719..48b401426 100644
--- a/sources/pyside2/tests/QtUiTools/uiloader_test.py
+++ b/sources/pyside2/tests/QtUiTools/uiloader_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+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 helper.usesqapplication import UsesQApplication