aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libminimal
Commit message (Collapse)AuthorAgeFilesLines
* shiboken tests: Fix special functions (simple cases)Friedemann Kleint2023-10-066-6/+39
| | | | | | | | | | | Introduce convenience macros similar to the Qt macros and specify the special functions where missing. Pick-to: 6.6 Task-number: PYSIDE-2479 Change-Id: I761a08e3e3c9393e1f2bb0514e2ad4de52cd99a0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix static analysis warnings about using = default in the shiboken testsFriedemann Kleint2023-10-022-2/+2
| | | | | | | | Pick-to: 6.6 6.5 Change-Id: Id72835771375fc2d6b5f1d81c36881cdca76cd15 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix some static analysis warnings in the shiboken testsFriedemann Kleint2023-09-272-3/+2
| | | | | | | | | | | | | | | | - else after return - Do not repeat return types - Use range-based for for std::map - Use constructor member initialization - Initialize variables - Use override instead of repeating virtual - Use noexcept for move special functions - Upper case integer literals - Various other small fixes Pick-to: 6.6 6.5 Change-Id: I06924c60fcd0d8bfcad9cc2cd6e79e72621cb766 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix default parameters for containers without indirectionsFriedemann Kleint2023-09-062-0/+13
| | | | | | | | | | | | e48b696ffab552785d38d72dff6c9dda796c9628 disabled default parameters for containers since indirections of the argument type can cause clashes. Enable it for the case of no indirections. Fixes: PYSIDE-2454 Pick-to: 6.5 Change-Id: Ie23b2e90244d7fe9e52e31c8314d51293fdbd8fa Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Test opaque container for spanFriedemann Kleint2023-03-202-0/+7
| | | | | | | Task-number: PYSIDE-2174 Change-Id: I812bef400ef2a006eb6aaca749d8961dc3aa7330 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Test non-fixed spansFriedemann Kleint2023-03-172-0/+14
| | | | | | | Task-number: PYSIDE-2174 Change-Id: I91756983c187e56168a9afa5931785fc8e8bf27b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Add support for std::spanFriedemann Kleint2023-03-073-0/+73
| | | | | | | | | | | | | Convert std::span to a Python list. For the conversion from Python to C++, make it a view on a vector. A special type is introduced since a different implementation is needed for opaque containers. Task-number: PYSIDE-2174 Change-Id: I17a7385282a7d373dc73d5ac63a5d3363d61d130 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMakeLists.txt: Add header filesFriedemann Kleint2023-03-011-4/+7
| | | | | | | | | Hoping this will help the Qt Creator code completion. Change-Id: I0777f5c38e37d560cfc1942b8acd5c76c8d64d25 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> 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>
* shiboken6/libminimal: Add std::array (C++ 11)Friedemann Kleint2023-01-112-1/+29
| | | | | | | | | [ChangeLog][shiboken6] Support for std::array has been added. Task-number: PYSIDE-1605 Task-number: PYSIDE-2174 Change-Id: I5192dfe1fa88d794856169638bb97abfc916bcf5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6/libminimal: Add a test for std::vectorFriedemann Kleint2023-01-113-0/+64
| | | | | | | Start a containeruser class and test for simple, sequential containers. Change-Id: I4a88787442c3c899523e9da51474916ca1312897 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix coding style of the shiboken testsFriedemann Kleint2022-12-224-25/+16
| | | | | | | | | | | | - Place star/reference correctly - Fix include order - Streamline code, wrap long lines - Use member initialization and default special methods Change-Id: I7b7e7d8e8c9562cd932bee8144bc44d6b2dda0a5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-279-243/+18
| | | | | | | | | | | 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>
* shiboken6: Handle pointers to containersFriedemann Kleint2022-03-102-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opaque containers were disabled for functions taking a pointer to a container since the number of indirections generated was incorrect. Functions taking a pointer to a container where no opaque container exists caused a crash since shiboken generated a value conversion to an uninitialized pointer. Change e4c2272dc60e1ff5e2d0933238fe4508af5f7f60 fixed the number of indirections used for arguments. With this, enable opaque containers also for functions taking a pointer. Use the same code path also for the case of a function taking a container by pointer since it provides a local variable to store the value. As a drive by, this also allows for a virtual function reimplemented in Python to return an opaque container. Change writePythonToCppTypeConversion() to return the number of indirections in case of return types. Remove flag CppGenerator::PythonToCppTypeConversionFlag. [ChangeLog][shiboken6] Code generation for functions taking a pointer to a container has been fixed. Pick-to: 6.2 Task-number: PYSIDE-1605 Task-number: PYSIDE-1790 Change-Id: Ifa0bafb1316d7edfe1efc2183459b1ee6924f5a1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Implement opaque containers for getters returning a const referenceFriedemann Kleint2021-10-212-0/+6
| | | | | | | | | | | | | Add a bool m_const member to the container helper template that indicates a const container. Error out of the modification functions if that is set. Create an additional creation function for the const case. A const opaque containers is then of same Python type as the non-const version, requiring no further type checks. Pick-to: 6.2 Task-number: PYSIDE-1605 Change-Id: I45faeb0d68e6144a9dfbe25497694b8acdd98c09 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Implement opaque containers for getters (non-const)Friedemann Kleint2021-10-212-0/+6
| | | | | | | | | | | | | | | Extract helpers from the opaque containers generation for fields and use them for function returns if the type is modified accordingly. [ChangeLog][shiboken6] Getters returning containers by reference can now be modified to return an opaque container by modifying the return type accordingly. Pick-to: 6.2 Task-number: PYSIDE-1605 Change-Id: Ieaf5eb92d248d3a23e511222e5f61823e85540c0 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add opaque containers for C++ sequence containersFriedemann Kleint2021-09-242-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a class that directly wraps a C++ sequence container, allow for modifying them. For all instantiated containers, generate a special (sequence) type that wraps the C++ container directly. For example, it will be accessible as a QList_int. This is achieved via providing a template for a type private that relies on a conversion traits template for conversion. Only the conversion traits specialization code needs to be generated. Use cases: - Allowing for modifying Fields of such container types (non-owning) - Pass it into functions taking such containers instead of converting back and forth from a PyList (constructed in Python, owning) [ChangeLog][shiboken6] Support for opaque C++ sequence scontainers has been added, allowing to pass a wrapped C++ container directly instead of converting it back and forth from Python sequences. Task-number: PYSIDE-1605 Change-Id: I49d378eb1a0151730d817d5bdd4b71a7c3b5cdda Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Brush up the test code with regards to iteratorsFriedemann Kleint2021-03-114-22/+17
| | | | | | | | Use algorithms, range-based for and auto to streamline some of the test code. Change-Id: I312ebc340ce0d02dd4ed3e0fca8e2cf6b645b69a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6 tests: Consolidate import/export macrcosFriedemann Kleint2020-11-021-12/+16
| | | | | | | | Following 430d02db24b95a56ae0acc6a9df6a0effe49da0d, base them on libminimal. Change-Id: I722a73e6f45344cbc91fb044bdf1f015bdff5ec2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-2810-0/+617
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>