aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/tests
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: Improve const handlingFriedemann Kleint2018-07-111-0/+6
| | | | | | | | | | | | | | - Use new enum in code. - Rewrite the Clang type parsing to make use of it. - Adapt some typesystem files. This enables the distinction between "int *" and "int *const" and fixes the signatures from "int const &" to the more common "const int&". Task-number: PYSIDE-672 Change-Id: Ic1bff0015188c32f53d0e6f347b1523254cb7e4f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Add a test for typeinfo parsingFriedemann Kleint2018-07-112-0/+27
| | | | | | | Task-number: PYSIDE-672 Change-Id: I6fad16453f20f16e264eba33493c86160505812c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Use raw string literals in ApiExtractor test testtemplatesFriedemann Kleint2018-07-021-193/+195
| | | | | | | | This improves the readability. Task-number: PYSIDE-672 Change-Id: I936ef46fb30af6163b8337adbf9cf585e68f3424 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: No longer hard-code the C++ language levelFriedemann Kleint2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | The C++ language level was previously hard-coded in the default options. This is potentially problematic for projects using shiboken and also fell apart with Qt 5.12, where the experimental level "c++1z" used for MSVC2017/Clang 4 no longer works due to not being able to handle enumerator value deprecation attributes. Introduce an enumeration to represent the level and add functions to convert back to and forth to the respective Clang option. Add an option to shiboken. Add a function returning a default value for the emulated compiler, returning C++ 14 or C++1Z for the CMSVC2017/Clang 4 case. Task-number: PYSIDE-724 Change-Id: Ie7e19bf7f099a34e6cdaad4b462157a9a3ee8797 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Change license from all the filesCristian Maureira-Fredes2018-05-0371-71/+71
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-2771-71/+71
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Use enum values from ClangFriedemann Kleint2018-04-192-29/+44
| | | | | | | | | | | | | | Remove a lot of ugly value parsing code in favor of clang_getEnumConstantDeclValue() and clang_getEnumConstantDeclUnsignedValue() depending on the type. Introduce a class EnumValue containing a union of qint64 and quint64 values to represent signed/unsigned values correctly and use that in the code model and meta language classes. Change-Id: If2efb7cfd560237907678b8f6fdfb0bc689c0c93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* siboken/Typesystem: Replace double used for versions by QVersionNumberFriedemann Kleint2018-03-201-6/+6
| | | | | | | | | | | | | - Change TypeSystemEntry::m_version from double to QVersionNumber. - Determine version at the beginning of the start element processing of the parser and use that. - Remove AddedFunction::m_version which is not needed. - Remove unused parameter double vr from AbstractMetaBuilderPrivate::translateType(). Change-Id: I2941667ba565f8c11aa0c14446ec7d6934da99dc Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken/qtdocgenerator: Fall back to QtXmlPatterns when libxml/libxslt ↵Friedemann Kleint2018-03-072-20/+39
| | | | | | | | | | | | | | | | | cannot be found In PySide2, there is one XSL-based documentation modification which QXmlQuery can handle. However, due to QTBUG-66925, it is not a full replacement, since the issue (XPATH specifying the number of the element to match) might be useful for documentation modification. Add QtXmlPatterns as fallback and modify the test accordingly. Task-number: PYSIDE-363 Change-Id: I969fbe210725bb748d76028c6f542bae6b471a76 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Refactor finding of enumerationsFriedemann Kleint2018-02-232-9/+6
| | | | | | | | | | | | | | | - Add helper AbstractMetaEnum::findEnumValue() which finds unqualified as well as qualified enum values. - Remove unused function bstractMetaClass::findEnumForValue(QString). - Remove 2nd parameter from AbstractMetaClass::findEnumValue(QString, AbstractMetaEnum *). The comment claimed that it is excluded from the search, but the condition was the reverse. Just removing it apparently does not do harm. Task-number: PYSIDE-487 Change-Id: I32b036045ea335b805fba79df327cc42d787f18c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Documentation extraction: Add error handlingFriedemann Kleint2018-02-211-1/+1
| | | | | | | | | Trim the strings returned by the XPath queries and warn about failing queries. Task-number: PYSIDE-363 Change-Id: Ia0233d490497597cb78aa16b0908fe226270705c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Remove unused code in abstractmetalang.hFriedemann Kleint2017-12-211-9/+24
| | | | | | | | | | | | The AbstractMeta* classes had a lot of functions trying to determine whether wrapper functions/classes should be generated. Apparently at some stage, this functionality was moved to the generator classes (apparently in conjunction with the "protected hack"), leaving the functions unused. Change-Id: Ia3fef96fe86cc6a6f9c70c674635bccf510362bc Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken/MetaLang: Add information about override/finalFriedemann Kleint2017-12-021-18/+36
| | | | | | | Take over information from code model and test. Change-Id: Ibed2973e09b117966ed241798125f60ba337b0e9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* FunctionModification: Make it possible to specify a regular expressionFriedemann Kleint2017-08-292-3/+16
| | | | | | | | | It should make it easier to specify the <array> modifications for GL functions. Task-number: PYSIDE-516 Change-Id: Ieb2e540f61785d13ee46a196a18d03b311d308e1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix the chain of issues regarding QSslConfigurationAlexandru Croitor2017-08-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | The failure was seen on Windows CI build, but was actually present on all platforms if the QSsl checks were properly fixed, or if certain CMake versions randomly decided to force C++11 usage. The first issue was that QSsl wrappers were not generated on all platforms because the C++11 standard was not forced for the compilation tests done in the check_qt_class macro. This is a bug in CMake, and the official way of fixing this is introduced in the yet unreleased CMake 3.9 version. The current fix is a workaround to explicitly pass the C++11 standard switch to the try_compile invocation. The next issue concerns handling of const char[] C++ types. There are three such members in QSslConfiguration, which caused build failures due to incorrectly generated code. The solution is to treat "const char[]" types as "const char*" types, which generates correct conversion code. Tests were also added to check for such cases. Change-Id: I874a3591dfc5f385338de7e3aff2a2c0dd2f5719 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Shiboken: No longer change arrays[] to pointer typesFriedemann Kleint2017-08-031-0/+3
| | | | | | | | | | In AbstractMetaBuilder, no longer change array types like "int[]" to "int*". Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: Ia9e15ae3fca895bf179275eb31a94323d91f4941 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Shiboken: Improve Handling of array typesFriedemann Kleint2017-08-032-0/+37
| | | | | | | | | | | Change the AbstractMetaType::signature() functions to work with the nested AbstractMetaType types instead of TypeEntry so that the correct array signatures appear in the signature of AbstractMetaFunction. Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: I90aa11891c95ccdcbae81fb70db4bec0e62f5923 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* move everying into sources/shiboken2 (5.9 edition)Oswald Buddenhagen2017-05-2274-0/+7015
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.