Commit Graph

42 Commits

Author SHA1 Message Date
Thiago Macieira
d18d341341 Tests: fix namespaced build on Windows
Amends 371214dea7.

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>
2022-10-25 18:33:14 -07:00
Volker Hilsheimer
371214dea7 Remove network dependency for tests with UNC paths
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>
2022-08-17 23:48:00 +02:00
Lucie Gérard
05fc3aef53 Use SPDX license identifiers
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>
2022-05-16 16:37:38 +02:00
Thiago Macieira
c9f6678fb4 tst_qstring: properly fix the build when LC_MEASUREMENTS is not defined
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>
2022-02-24 15:45:53 -08:00
Yuhang Zhao
e01c25e859 QtBase: replace windows.h with qt_windows.h
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>
2021-11-23 12:53:46 +08:00
Tatiana Borisova
dbab926883 locale: INTEGRITY does not define LC_MEASUREMENTS
- 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>
2021-09-21 17:56:54 +00:00
Pasi Petäjäjärvi
3635acd27a locale: QNX does not define LC_MEASUREMENTS
Pick-to: 6.2
Change-Id: I01ce03e578173f53639927e70f49e6d9b0d08d20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-21 14:36:18 +03:00
Tatiana Borisova
766904bf5b Compile autotests for Integrity
- 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>
2021-09-20 17:29:04 +03:00
Edward Welbourne
458d53f572 Move locale-switching code in tests to a shared header
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>
2021-09-14 13:07:13 +02:00
Edward Welbourne
9810cbcd18 Include what you use ! filesystem.h uses QOperatingSystemVersion
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>
2021-08-27 20:31:18 +02:00
Karsten Heimrich
01f003f0aa Refactor createSymbolicLink() and createNtfsJunction()
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>
2021-06-02 23:02:45 +02:00
Karsten Heimrich
ebacf42561 Move createSymbolicLink() to the shared header
Change-Id: I737f521791faf07d704e15d36d57444b3187ba9d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-02 23:02:45 +02:00
Samuli Piippo
0ce443691f Move QEMU emulation detector to QTest
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>
2021-02-13 10:02:51 +02:00
Allan Sandfeld Jensen
bde773ec6a Fix a few compiler warnings in tests
Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-02 12:06:05 +01:00
Allan Sandfeld Jensen
c82f73666d Replace Q_DECL_UNUSED with [[maybe_unused]]
Use C++17 attribute directly

Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-03 11:58:08 +02:00
Allan Sandfeld Jensen
68198de4db Use C++17 [[maybe_unused]]
In some places needs to be ordered before const/constexpr though.

Change-Id: I57a521ac0ad22b5a018761c4d52befbef69d64c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-06 18:31:43 +02:00
Oliver Wolff
45b0f1be68 Remove winrt
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>
2020-06-06 20:25:49 +02:00
Tor Arne Vestbø
bf2216c32b Fix isRunningArmOnX86 unused function warning
Change-Id: Ic51e85d2e6e24860f8e980a243a45ec4dc1253cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-03 15:03:51 +01:00
Joerg Bornemann
c9b7cc349a Remove usages of Q_OS_WINCE
This platform is history.

Change-Id: Iddfab008a509f4828c321730414c8204055cf7af
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-05-23 13:51:05 +02:00
Friedemann Kleint
20a8a277ee tst_qfileinfo: Refactor ntfsJunctionPointsAndSymlinks()
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>
2018-09-30 09:59:09 +00:00
Kari Oikarinen
3909d37cb7 tests: Include QFileInfo in emulationdetector.h
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>
2018-05-14 12:36:28 +00:00
Kari Oikarinen
fe670fc0f0 tests: Include qglobal.h in EmulationDetector
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>
2018-04-30 06:18:06 +00:00
Ulf Hermann
5a4787dca0 Modernize the "regularexpression" feature
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>
2018-03-20 08:19:25 +00:00
Sami Nurmenniemi
514fff1e39 Fix largefile tests on ARM and QEMU targets
- 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>
2017-03-28 06:55:32 +00:00
Friedemann Kleint
ffde99d5a0 Windows CE cleanup.
Remove remaining CE-specific files and #ifdefs.

Change-Id: I407e14cade64c9eaa414f333764b4f82a75befde
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-14 12:45:56 +00:00
Jani Heikkinen
f776595cc1 Updated license headers
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>
2016-01-21 18:55:18 +00:00
Jani Heikkinen
83a5694dc2 Update copyright headers
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>
2015-02-11 06:49:51 +00:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Friedemann Kleint
b7de9e7353 Use a fake directory model instead of QDirModel in item view tests.
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>
2014-01-27 15:40:17 +01:00
Friedemann Kleint
cff2b83b10 Fix MSVC 64bit warnings about int64 truncation in tests.
Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 22:06:15 +01:00
Andrew Knight
c6af0a504f WinRT: Fix various test compilations
- 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>
2013-10-02 12:36:05 +02:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
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>
2012-09-22 19:20:11 +02:00
Friedemann Kleint
db83f2d73d Base 'FileSystem' test helper class on QTemporaryDir.
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>
2012-07-26 15:12:50 +02:00
Friedemann Kleint
8f2a088028 Fix MSVC warnings in tests.
- Unused variables
- conversion truncations
- Overflow in expressions like '-1 + sizeof()'

Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-02 16:56:48 +02:00
Jason McDonald
5635823e17 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I311e001373776812699d6efc045b5f742890c689
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 03:54:59 +01:00
Jason McDonald
629d6eda5c Update contact information in license headers.
Replace Nokia contact email address with Qt Project website.

Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-23 04:04:33 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Jason McDonald
27f9f136f7 Remove SkipMode parameter from QSKIP calls.
The previous commit removed SkipMode from the testlib APi.  This commit
removes the parameter from all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
ae1810658b Move QTRY_VERIFY/QTRY_COMPARE into testlib.
These functions have lived in tests/shared/util.h for a long time, but
they really belong in qtestlib.

Change-Id: I60d569d002dea220b51563931d8b7aa77a20b98b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:23:44 +02:00
Jyri Tahtela
f9f395c28b Update licenseheader text in source files for qtbase Qt module
Updated version of LGPL and FDL licenseheaders.
Apply release phase licenseheaders for all source files.

Reviewed-by: Trust Me
2011-05-24 12:34:08 +03:00
Qt by Nokia
38be0d1383 Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://qt.gitorious.org/qt/pages/GitIntroductionWithQt

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
2011-04-27 12:05:43 +02:00