summaryrefslogtreecommitdiffstats
path: root/tests/shared
Commit message (Collapse)AuthorAgeFilesLines
* Replace incorrect Metal config check in nativewindow.hTor Arne Vestbø3 days1-2/+2
| | | | | Change-Id: I6d3718d45e55864169cd41694b0cdf16e9bf8f44 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QWindow: Persist foreign winId to support destroy/create cyclesTor Arne Vestbø2024-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We used to set a private _q_foreignWinId property on QWindow when creating foreign windows, and this was the mechanism which we then passed the foreign winId to the platform plugin. With c585802e946d97e7d177ea334a162dc7bc286b84 this was removed, since we now were passing the winId through via explicit QPA APIs, and since 0c6911e5cde24c45d6f2c08b6e71064bdd1eccfa removed the ability to explicitly destroy() a foreign window. But when closing a QWindow, we destroy both the window itself, and all its children, including foreign windows. In this case we still want to support recreating the foreign window, for example when the parent window is shown again. To enable this we restore the _q_foreignWinId private property, but keep the limitation of not being able to explicitly destroy a foreign window. Pick-to: 6.7 6.5 Fixes: QTBUG-124160 Change-Id: Ia885ba9f043e64fb21eedd2b4c344679726f1b5c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add configure feature for MetalTor Arne Vestbø2024-03-191-1/+1
| | | | | | | Simplifies maintenance of code paths that rely on Metal. Change-Id: I1d1f705fffc14dbafde346eeb555b43be6d5be54 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove extra semi-colonsTasuku Suzuki2024-02-061-1/+1
| | | | | Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change license for tests filesLucie Gérard2024-02-044-4/+4
| | | | | | | | | | | | 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>
* Don't include windows.h in the public qopengl.h headerVolker Hilsheimer2024-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | All we need are the APIENTRY and WINGDIAPI macros, as those are used in the gl.h header. Define those locally for the time we need them. Use a QT_APIENTRY macro instead of hijacking APIENTRY for when we declare OpenGL functions with the stdcall calling convention. A few build fixes needed in tests that used Windows types without explicitly including windows.h first, or that (incorrectly) included one of the sub-headers of windows.h (like winuser.h). [ChangeLog][Potentially Source-Incompatible Changes][OpenGL] On Windows, the public qopengl.h header no longer includes windows.h. Pick-to: 6.7 Fixes: QTBUG-120687 Change-Id: I3770ac8eaeee5bcf4e7234e5a2539935a8aa5a7d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Android: Add preliminary support for child windowsTinja Paavoseppä2023-12-081-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the manual test case for embedded windows to have native window on Android. There are still some sharp corners, for example: * The windows are implemented with SurfaceViews, which makes z-ordering with multiple of them a bit tricky. The Surfaces they instantiate are basically z-ordered to either be below everything, with a hole punched in the window, or on top of everything, with the Surfaces created later on top of the ones created earlier. Also, with the foreign views it looks like the native view is on top of the Surface, because it is created later. And since the child windows create their Surfaces before the parent, they would be behind the parent window, currently circumventing this with letting the parent be z-ordered behind everything, and the children on top of everything. A follow up commit addresses this by changing the native view class to TextureView when multiple windows are present. * Parent window always gets the touch events - fixed in a follow up commit * If a child window has a text edit, it does not receive focus when clicking on it Task-number: QTBUG-116187 Change-Id: I32188ec5e3d3fce9fd8e3a931e317d1e081f691c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Prevent reparenting of foreign window embedding containerTor Arne Vestbø2023-11-151-7/+53
| | | | | | | | | | | A foreign window used to embed a Qt window into it should not end up with changes to its own parent, as its only job is to give the embedded Qt window a parent handle. Pick-to: 6.6 Change-Id: If1bc89658fedf449d266bc0cc750c90b6a841a68 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove remnants of Qt for Native Client (NACL)Tor Arne Vestbø2023-09-231-2/+1
| | | | | | | | | The project has been superseded by Qt for WebAssembly and was never supported in Qt 6. Pick-to: 6.6 6.5 Change-Id: I36682cfe3ce6adac76a307b0faba97dcb7c655cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* xcb: Implement native window helper for embeddedwindows/foreign window testTor Arne Vestbø2023-09-121-1/+77
| | | | | | Pick-to: 6.6 Change-Id: I73720f8f49a5d7e5df7c95bf4b17ef910180e01c Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add embeddedwindows manual testTor Arne Vestbø2023-08-071-0/+5
| | | | | | | | | | | | For the child windows we have to use showNormal() explicitly, as the default window state logic of platforms like iOS does not have access to the QWindow, only to its flags, and we can not use Qt::SubWindow as a proxy for being a child window, as that's a window flag meant to be used for MDI sub windows. Pick-to: 6.6 Change-Id: I2b5e669f6180ffdcb75479dece38ae5e5430aef6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tests: Add iOS support to nativewindow helperTor Arne Vestbø2023-08-071-4/+8
| | | | | | Pick-to: 6.6 Change-Id: I3e22423734d25acb2ef04d22a1647874c2d10420 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_foreignwindow: Add basic test of foreign window reparentingTor Arne Vestbø2023-08-071-0/+11
| | | | | | Pick-to: 6.6 Change-Id: I008fad0f6527503a13ded4818eec5cb280f65cf4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tests: Move NativeWindow helper class to shared headerTor Arne Vestbø2023-08-031-0/+112
| | | | | | | Pick-to: 6.6 Change-Id: Ia7dc54aa761fdfde42d49a41475a4fbc74036aeb Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Inline the resetSystemLocale functionMikolaj Boc2023-01-121-1/+1
| | | | | | | | | It's used from three different tests so it can only have one definition, but when batching it has three of them. Task-number: QTBUG-109954 Change-Id: Idfddd313a1fe447968066118529527e3d4214823 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tests: fix namespaced build on WindowsThiago Macieira2022-10-251-0/+2
| | | | | | | | | | | | Amends 371214dea7f92b3170d0239b3d9944275adf951a. tst_qfile.cpp:401:9: error: reference to ‘QTest’ is ambiguous qttestglobal.h:27:11: note: candidates are: ‘namespace TestNamespace::QTest { } filesystem.h:28:11: note: ‘namespace QTest { }’ Pick-to: 6.4 Change-Id: I07ec23f3cb174fb197c3fffd17215c1eeeadf7fd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove network dependency for tests with UNC pathsVolker Hilsheimer2022-08-171-0/+3
| | | | | | | | | | | | | | | | | | | Windows VMs are provisioned with shared folders that are available as \\${COMPUTERNAME}\testshare(writable) so we don't need to access a remote SMB server over network anymore just to test whether our string-parsing code handles UNC paths correctly. Add a QTest::uncServerName() helper function to the shared filesystem.h header and use that instead of QtNetworkSettings::winServerName. The latter is now only used in tst_NetworkSelfTest::smbServer(). Pick-to: 6.4 Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-163-81/+6
| | | | | | | | | | | | | 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: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_qstring: properly fix the build when LC_MEASUREMENTS is not definedThiago Macieira2022-02-241-1/+1
| | | | | | | | | | | Instead of proxy-testing for the OS, test for the thing you're going to use. Fixes the build on FreeBSD. Pick-to: 6.3 Change-Id: Ibf4acec0f166495998f7fffd16d693df09871492 Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtBase: replace windows.h with qt_windows.hYuhang Zhao2021-11-231-1/+1
| | | | | | | | | | We have some special handling in qt_windows.h, use it instead of the original windows.h Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale: INTEGRITY does not define LC_MEASUREMENTSTatiana Borisova2021-09-211-2/+2
| | | | | | | | | - It does however use the Unix backend for system locale, so don't entirely skip setting environment variable, only leave out LC_MEASUREMENTS. Pick-to: 6.2 Change-Id: If292f1077851b29da2a21af7c46f4db9c0e4ed19 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale: QNX does not define LC_MEASUREMENTSPasi Petäjäjärvi2021-09-211-1/+4
| | | | | | Pick-to: 6.2 Change-Id: I01ce03e578173f53639927e70f49e6d9b0d08d20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Compile autotests for IntegrityTatiana Borisova2021-09-201-1/+1
| | | | | | | | | - process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move locale-switching code in tests to a shared headerEdward Welbourne2021-09-141-0/+111
| | | | | | | | | | | | | | | | | | | | | | QLocale and QString tests had copies of a TransientLocale; we've recently improved the QLocale one. Rather than duplicating those rather complicated improvements, finally share a common version. In the process, I noticed that setlocale() only returns the prior value when passed nullptr as the new value; so rework the implementation to get that right, so that it now correctly restores the prior locale. That, in turn, means there's now a later call to setlocale(), when we actually set the changed setting, which may invalidate the earlier return; so copy it to a QByteArray before the second call. Included Ivan Solovev's improved version of how to reset the locale, since TransientLocale needs it. Pick-to: 6.2 Change-Id: I4cb1efbda42f0e2cdd934e04b3b3732ce0f45a06 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Include what you use ! filesystem.h uses QOperatingSystemVersionEdward Welbourne2021-08-271-4/+5
| | | | | | | | So include that; and sort the includes while I'm about it. Change-Id: I0f922f7883f1e32b8bbcf555617588fa9cfacaaa Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Refactor createSymbolicLink() and createNtfsJunction()Karsten Heimrich2021-06-021-17/+30
| | | | | | | | Both functions now return a result object. Eliminates the need to pass the errorMessage out-parameter. Adapt auto-tests. Change-Id: I110b68fedc67b01f76796c44fa55383b2cc03460 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move createSymbolicLink() to the shared headerKarsten Heimrich2021-06-021-0/+24
| | | | | Change-Id: I737f521791faf07d704e15d36d57444b3187ba9d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move QEMU emulation detector to QTestSamuli Piippo2021-02-131-123/+0
| | | | | | | | | The emulation detection has been usable only on qtbase tests, move it to QTest so that it can be used in other modules as well. Pick-to: 6.1 Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix a few compiler warnings in testsAllan Sandfeld Jensen2021-02-021-2/+2
| | | | | Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace Q_DECL_UNUSED with [[maybe_unused]]Allan Sandfeld Jensen2020-10-031-1/+1
| | | | | | | Use C++17 attribute directly Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use C++17 [[maybe_unused]]Allan Sandfeld Jensen2020-09-061-1/+1
| | | | | | | In some places needs to be ordered before const/constexpr though. Change-Id: I57a521ac0ad22b5a018761c4d52befbef69d64c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove winrtOliver Wolff2020-06-061-1/+1
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix isRunningArmOnX86 unused function warningTor Arne Vestbø2020-02-031-1/+1
| | | | | Change-Id: Ic51e85d2e6e24860f8e980a243a45ec4dc1253cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-231-1/+1
| | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* tst_qfileinfo: Refactor ntfsJunctionPointsAndSymlinks()Friedemann Kleint2018-09-301-8/+24
| | | | | | | | | | | | | | | | Move the creation of the symbolic link/junction from the _data() slot into the actual test function. The parameters are passed by a newly introduced struct. This ensures only the symbolic links/junctions that are actually needed are created. It can then no longer happen that filtering for one data row invokes recursive deletion of the mountpoint junction. Also use of the newly introduced convenience createSymbolicLink() in canonicalFilePath() Task-number: QTBUG-63989 Change-Id: Ia78fd4ad6097136934ab5a375f4c352713d0f115 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* tests: Include QFileInfo in emulationdetector.hKari Oikarinen2018-05-141-0/+2
| | | | | | | | | Otherwise using it later is a compile error on ARM if no header including it has been included before. Change-Id: I422eeb948da4a22bc3f649daff39740703039372 Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests: Include qglobal.h in EmulationDetectorKari Oikarinen2018-04-301-0/+2
| | | | | | | | | Checking for Q_OS_LINUX, Q_PROCESSOR_ARM and use of QT_CONFIG() checks should only happen after qglobal.h is included. Otherwise the header will be broken if included before something that uses qglobal.h Change-Id: I052e46784f7b174e74e8894e1b7c5b7528420f5d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Modernize the "regularexpression" featureUlf Hermann2018-03-201-2/+2
| | | | | | | | | | | | | Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix largefile tests on ARM and QEMU targetsSami Nurmenniemi2017-03-281-0/+119
| | | | | | | | | | - Test tst_LargeFile::mapFile fails on Qemu for files over 4Gb. Fixed by limiting maxSizeBits to 28 (must be n*4 and < 32). - Bug QTBUG-21175 is also effective on ARM targets. Fixed by expecting failure also on ARM. Change-Id: I9103727e618a17259b4785ec8c284f3bb60ebea7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows CE cleanup.Friedemann Kleint2016-04-141-1/+1
| | | | | | | Remove remaining CE-specific files and #ifdefs. Change-Id: I407e14cade64c9eaa414f333764b4f82a75befde Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-212-34/+24
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-112-14/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-242-38/+22
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Use a fake directory model instead of QDirModel in item view tests.Friedemann Kleint2014-01-271-0/+130
| | | | | | | | | | The tests then have a predictable, stable environment and do not depend on file system operations. Task-number: QTBUG-23697 Change-Id: Ibbd356f8bd7419ec4a3a88d2c0b5cd0830049790 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix MSVC 64bit warnings about int64 truncation in tests.Friedemann Kleint2014-01-241-1/+1
| | | | | Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* WinRT: Fix various test compilationsAndrew Knight2013-10-021-1/+1
| | | | | | | | | | | | | - Remove irrelevant test subdirs via .pro files - Follow WinCE codepaths where applicable - Replace unsupported Win32 APIs with WinRT equivalents This does not aim to fix any failures in the tests themselves; it only makes them compile. Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Base 'FileSystem' test helper class on QTemporaryDir.Friedemann Kleint2012-07-261-38/+42
| | | | | | | | | This avoids test instabilities and prevents test directories from being cluttered with temporary files. Change tests accordingly. Remove unused createLink() method. Change-Id: I843c28ab81c8a476c71c5211a7479b22d3d9fc93 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Fix MSVC warnings in tests.Friedemann Kleint2012-04-021-1/+1
| | | | | | | | | - Unused variables - conversion truncations - Overflow in expressions like '-1 + sizeof()' Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>