summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qxp
Commit message (Collapse)AuthorAgeFilesLines
* Add copyright and licensing to build system files missing itLucie Gérard7 days1-0/+2
| | | | | | | Task-number: QTBUG-124453 Change-Id: Ibb6a0ab839a16ceef3c68861bac2f508ddb3d1ae Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change license for tests filesLucie Gérard2024-02-042-2/+2
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tst_qxp_function_ref: check that function_ref's are trivially copyableMarc Mutz2023-12-161-0/+2
| | | | | | | | | | | | | Mandated by P0792R9 already, but we never checked and P0792R14 has user-defaulted assignment operators showing up in the synopsis now, so make sure we don't accidentally break this going forward. Amends 29b65c98e720056e87334ce88a683969e57efd3d. Pick-to: 6.7 6.6 6.5 Change-Id: Ief9c5ff30895f8bfccec1c24d1777d3dab76c95a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qxp_is_virtual_base_of: disable all warnings for GCC < 10Marc Mutz2023-11-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -Winaccessible-base switch was added for GCC 10. Older GCCs had no way to suppress the warnings, and the existing suppression of -Winaccessible-base caused a warning of its own: qcompilerdetection.h:1125:49: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] 1125 | #define QT_DO_PRAGMA(text) _Pragma(#text) | ^~~~~~~ qcompilerdetection.h:1150:49: note: in expansion of macro ‘QT_DO_PRAGMA’ 1150 | # define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) | ^~~~~~~~~~~~ tst_is_virtual_base_of.cpp:53:1: note: in expansion of macro ‘QT_WARNING_DISABLE_GCC’ 53 | QT_WARNING_DISABLE_GCC("-Winaccessible-base") | ^~~~~~~~~~~~~~~~~~~~~~ Since GCC 8 and 9 are slowly fading away as supported compilers, the simplest fix to get a clean build is to suppress all warnings for the test on these compilers, by passing -w, as suggested by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90449. Short of moving the affected code into a separate header file and applying `#pragma GCC system_header` to it, there appears to be no other way to get rid of the warning. Amends a1bdee4697b7125bd0972284bfb33a56fcb441aa. Change-Id: I12eb1f8d486b1e2413675991659bf9ad3a7869ae Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* is_virtual_base_of: suppress warnings in the testGiuseppe D'Angelo2023-09-281-0/+4
| | | | | | | | | We want to test the traits even on nonsensical types. Change-Id: I63ed022c9529d9de9d336157e6f025937321ca16 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live qxp::is_virtual_base_ofGiuseppe D'Angelo2023-09-263-0/+115
| | | | | | | | To be used in QWeakPointer. Change-Id: I5ee9dd0862a0b23d316aaadf5d68bef1ce609e8b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Make corelib tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-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. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* function_ref test: Don't take reference of temporariesMårten Nordheim2022-06-201-5/+10
| | | | | | | | | | | | | When assigning the lambdas directly to a function_ref their lifetime is limited to that of the expression. Store them on the stack first to avoid the UB. Fixes: QTBUG-104419 Pick-to: 6.4 Change-Id: I3c85ac683b0bd7768b646dc9d0a1ed4dd173e6f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Revert "qxp::function_ref: drop use of q23::invoke_r"Marc Mutz2022-06-141-0/+40
| | | | | | | | | | | | | | | | | | | | This reverts commit b9cce12e76796962e5e5ad0d5408370af56af459, which broke function_ref<void(int)> f = [](int i) { return i; }; ie. swallowing of return types. We could maybe implement the same without invoke_r, with the same manual if-constexpr that invoke_r has, but it would be a pointless duplication across the two thunks we have, so just use invoke_r. Add tests. Pick-to: 6.4 Task-number: QTBUG-103739 Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Short live qxp::function_ref!Marc Mutz2022-06-023-0/+242
This is an implementation of function_ref, which has been proposed for inclusion into C++23, but has not been accepted, yet, which is why we place it in namespace qxp (for eXPerimental) instead of q23. The implementation is based on wg21.link/P0792r9, which, at the time of writing, is the latest revision of the paper. It will be used in both QTestLib and qmldom. Fixes: QTBUG-103739 Change-Id: I52723eca28f7ac02ce7ce51928361d81ae5c92b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>