diff options
Diffstat (limited to 'sources/pyside2/tests')
| -rw-r--r-- | sources/pyside2/tests/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | sources/pyside2/tests/pysidetest/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | sources/pyside2/tests/registry/init_platform.py | 8 |
3 files changed, 16 insertions, 12 deletions
diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt index 4289012a8..08585252c 100644 --- a/sources/pyside2/tests/CMakeLists.txt +++ b/sources/pyside2/tests/CMakeLists.txt @@ -8,8 +8,8 @@ else() # tests/QtWidgets/qstandarditemmodel_test.py needs shiboken2 # tests/QtWidgets/qlabel_test.py needs shiboken2 if(WIN32) - set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${CMAKE_BINARY_DIR}/tests/pysidetest;${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule;$ENV{PYTHONPATH}") - set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_INCLUDE_DIR}/../../bin;$ENV{PATH}") + set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${CMAKE_BINARY_DIR}/tests/pysidetest;${SHIBOKEN_PYTHON_MODULE_DIR};$ENV{PYTHONPATH}") + set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_SHARED_LIBRARY_DIR};$ENV{PATH}") set(LIBRARY_PATH_VAR "PATH") string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}") string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}") diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index 119553fad..1b1baf39a 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -68,8 +68,8 @@ make_path(testbinding_typesystem_path ${pyside2_SOURCE_DIR} add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mjb_rejected_classes.log" -BYPRODUCTS ${testbinding_SRC} -COMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS} + BYPRODUCTS ${testbinding_SRC} + COMMAND Shiboken2::shiboken2 ${GENERATOR_EXTRA_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/pysidetest_global.h --include-paths=${testbinding_include_dirs} ${shiboken_framework_include_dirs_option} @@ -86,16 +86,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} - ${SHIBOKEN_INCLUDE_DIR} ${pyside2_SOURCE_DIR} ${QtCore_GEN_DIR} ${QtGui_GEN_DIR} ${QtWidgets_GEN_DIR} - ${libpyside_SOURCE_DIR} - ${SHIBOKEN_PYTHON_INCLUDE_DIR}) + ${libpyside_SOURCE_DIR}) add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC}) target_link_libraries(pysidetest + Shiboken2::libshiboken ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} @@ -103,7 +102,7 @@ target_link_libraries(pysidetest add_library(testbinding MODULE ${testbinding_SRC}) set_property(TARGET testbinding PROPERTY PREFIX "") -set_property(TARGET testbinding PROPERTY OUTPUT_NAME "testbinding${PYTHON_EXTENSION_SUFFIX}") +set_property(TARGET testbinding PROPERTY OUTPUT_NAME "testbinding${SHIBOKEN_PYTHON_EXTENSION_SUFFIX}") if(WIN32) set_property(TARGET testbinding PROPERTY SUFFIX ".pyd") endif() @@ -111,11 +110,10 @@ target_link_libraries(testbinding pysidetest pyside2 ${PYTHON_LIBRARIES} - ${SHIBOKEN_LIBRARY} + Shiboken2::libshiboken ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} - ${Qt5Widgets_LIBRARIES} - ${SBK_PYTHON_LIBRARIES}) + ${Qt5Widgets_LIBRARIES}) add_dependencies(testbinding pyside2 QtCore QtGui QtWidgets pysidetest) create_generator_target(testbinding) diff --git a/sources/pyside2/tests/registry/init_platform.py b/sources/pyside2/tests/registry/init_platform.py index ca2b2cb68..a324c36a2 100644 --- a/sources/pyside2/tests/registry/init_platform.py +++ b/sources/pyside2/tests/registry/init_platform.py @@ -73,7 +73,13 @@ elif os.path.exists(history_dir): fpath = os.path.join(history_dir, last_build, "build_dir.txt") if os.path.exists(fpath): with open(fpath) as f: - all_build_dir = f.read().strip() + f_contents = f.read().strip() + f_contents_split = f_contents.splitlines() + try: + all_build_dir = f_contents_split[0] + except IndexError: + print("Error: can't find the build dir in the given file '{}'".format(fpath)) + sys.exit(1) else: print(dedent(""" Can't find the build dir in the history. |
