aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/otherbinding
Commit message (Collapse)AuthorAgeFilesLines
* shiboken6: Make multiple inheritance cast check less restrictiveFriedemann Kleint2024-05-061-6/+11
| | | | | | | | | | | | | | | | The old code would not allow to downcast if a special cast function exists somewhere in the class hierarchy (as is the case for example for QWidget inheriting QObject and QPaintDevice). Make the check more fine-grained by actually checking whether the base class is a direct, single line inheritance base class of the type passed in. This makes the mechanism work for widgets. The corresponding test can then be relaxed. Task-number: PYSIDE-868 Change-Id: Id81fd9c3080e42009fc84e06a9bab1c8856f2c0c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken tests/otherbinding: Add a test for star imports, amendedChristian Tismer2024-03-151-3/+6
| | | | | | | | This clarifies when Shiboken is actually loaded. Task-number: PYSIDE-2404 Change-Id: Iaef8d2f6757482c928c3489def70945cbe1c00af Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* shiboken tests/otherbinding: Add a test for star importsFriedemann Kleint2024-03-131-0/+96
| | | | | | | | | | | | | | This test tests also lazy init's interaction with star import as * first import as star * second import as star after normal import without other modules loaded before. Task-number: PYSIDE-2404 Change-Id: Ibe3d1132d36a4547c0a71857217bcb24219e2185 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken tests/otherbinding: Fix flake8 warningsFriedemann Kleint2024-03-1214-42/+73
| | | | | | | | - Remove * imports Pick-to: 6.6 6.5 Change-Id: Ife84bc03d89eb95c3ddc58394ddaae1c82a601a7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Clean up some unused suppression warningsFriedemann Kleint2023-08-011-4/+0
| | | | | | Pick-to: 6.5 Change-Id: I261ec7ec933e21658d357ad1ffbeb4de5b84d13f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add license headers to cmake filesFriedemann Kleint2023-02-161-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Add .pyproject files for the testsFriedemann Kleint2022-11-111-0/+17
| | | | | | | | Makes navigation with Qt Creator easier. Change-Id: I40c6bc641faddcdbd265d6e886c2f3bd3b271be5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* CMake: Execute shiboken with appropriate PATH on WindowsAlexandru Croitor2022-11-091-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously one had to add the Qt bin dir and libclang.dll dir to PATH manually to ensure shiboken successfully runs when building Qt for Python using CMake without setup.py. This should not be necessary though, because the build system knows where Qt is (usually via the --qtpaths option) and where libclang is (via LLVM_INSTALL_DIR and friends). Introduce a CMake function that generates a batch shell script wrapper for a given tool. The wrapper will have PATH set to the Qt bin dir and libclang dir. Generate such a wrapper for shiboken and use it everywhere we call shiboken to generate bindings. The wrapper is only created on Windows. All mentions of Shiboken6::shiboken in custom commands now need to be wrapped in $<TARGET_FILE> because automatic target path conversion only happens if the target appears as the first argument to a custom command, and that is not the case anymore with the wrapper script being at the front. As a drive-by, the indentation of custom commands is now adjusted for easier readability and to conform with the indentation used in the Qt build system. Pick-to: 6.4 Fixes: PYSIDE-1844 Change-Id: I287adeedf234d0272c2963e96ae2aa5c4c0f0c83 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add --lean-header optionFriedemann Kleint2022-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | Add an option that causes shiboken to generate forward declarations instead of includes where possible into the module header. This works since SbkType<> template specializations work with forward declarations. Includes are only required for certain classes (with enums, inner classes). [ChangeLog][shiboken6] An option --lean-header to generate forward declarations instead of includes into the module header has been added. This considerably reduces the dependencies but may require additional includes to be specified for injected code. Pick-to: 6.4 Fixes: PYSIDE-2099 Change-Id: I01f639e4ccce5ca25016dc2d52562abcc489a5ab Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Shiboken: Rewrite the signature initializationChristian Tismer2022-07-071-1/+0
| | | | | | | | | | | | | | | [ChangeLog][shiboken6] The initialization of the signature module was moved into Shiboken and rearranged. This was necessary for the new backward-compatible PyEnum module. This change makes even sense if the PyEnum forgiveness should not work in 3.11 because it is a real cleanup. Change-Id: I5de54584154fb43648617adcac823f42049be57b Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-2715-429/+30
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyEnum: Prepare Enum tests for both old and new enumsChristian Tismer2022-05-221-3/+6
| | | | | | | | | | | | | | | | | | These tests are now completely identical to the old tests and have an adapted Python Enum version if suitable. Both versions can be selected once at runtime. Having both test versions available as a runtime option is a nice feature that really helps understanding the consequences of the PyEnum move. [ChangeLog][PySide6] The QEnum tests are enabled for both the old Qt Enums and the new Python Enums. Change-Id: I78a7473f4a86f8d2115acc56e4ed11cf135eb000 Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: replace the __signature__ attribute by get_signature()Christian Tismer2021-11-191-1/+7
| | | | | | | | | | | | | In PyPy, types cannot simply be patched. It would be quite some effort to derive extra heap types for that. Instead, we use `get_signature()` for all tests, which has the same effect. Task-number: PYSIDE-535 Change-Id: I8d9e4adcfc33231d0cd96260feaf2b205bef9a18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* CMake: Use namespaced shiboken6 target in custom commandsAlexandru Croitor2021-10-271-2/+2
| | | | | | | | | | To ensure the tests can be built against an imported shiboken6 target (one found via find_package), and not only using a target which is built as part of the current project. Pick-to: 6.2 Change-Id: I20aa7b9e461370ea489a43b118330fe023e4b631 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: fix quite a few tests using del or __del__Christian Tismer2021-10-271-1/+4
| | | | | | | | | | | | | | | | | In PyPy, the __del__ method is only triggered reliably by calling gc.collect() Also, the del statement does a deletion from the namespace, but the real deletion happens when gc.collent() is called. This was applied to all tests which use del, regardless if it has a visible effect on PyPy or not. It turned out to save more 8 errors, which is great. Task-number: PYSIDE-535 Change-Id: I6a58d90629c9eafec7307c17f021251113b3c7f2 Pick-to: 6.2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Switch from os.path to pathlib.Path, all source changes but testsChristian Tismer2021-02-101-5/+5
| | | | | | | | | | | With this patch, os.path in Shiboken and Pyside will be completely removed from sources. The rest will be done later. Task-number: PYSIDE-1499 Change-Id: Id01782779487ceec62efdd1f32f65beee0234338 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Switch from os.path to pathlib.Path, systematic test changesChristian Tismer2021-02-0813-13/+26
| | | | | | | | | | | | | | | | | | This patch does the systematic changes on all tests. Note that there was a bug in principle: os.path was used without importing os.path This worked through the way how the os module initializes itself, but you always will find the explicit import in the python library. But the problem is going away anyway after the transition to pathlib.Path :) Change-Id: I95144d7f9bb07a38376c3aa428df663f2e64bcb7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* move "shiboken6/shiboken6" to "shiboken6/Shiboken"Christian Tismer2021-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | Modifying the paths to work in the new way is a quite ambitious task. But doing so improves the overall project structure and makes imports unambiguous. This patch should not be applied alone but with move "shiboken6/shiboken6" to "shiboken6/Shiboken" temp The reworked version of this patch no longer has different structures in `build` and `install`. Tested with Python 3.6, 3.7, 3.8, 3.9 debug build Python 3.6 debug install Python 3.9 release install Task-number: PYSIDE-1497 Change-Id: Id9d816dd825907f9359651e7e2f69f54e1ba46c9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-2818-0/+1056
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>