summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/corelib/io/io.pro6
-rw-r--r--tests/auto/corelib/io/qfile/test/test.pro2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp20
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp16
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp6
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp8
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp4
-rw-r--r--tests/auto/corelib/kernel/kernel.pro2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/qeventloop.pro2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/qmetatype.pro4
-rw-r--r--tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp2
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp4
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp5
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp6
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp6
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp3
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_databases.h7
-rw-r--r--tests/auto/testlib/selftests/crashes/tst_crashes.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp7
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp4
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp24
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp2
-rw-r--r--tests/baselineserver/shared/baselineprotocol.cpp6
-rw-r--r--tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qfile/main.cpp26
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp4
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp4
-rw-r--r--tests/shared/filesystem.h2
46 files changed, 165 insertions, 68 deletions
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index 41d7e7e08b..d70737a53f 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -52,3 +52,9 @@ SUBDIRS=\
win32:!contains(QT_CONFIG, private_tests): SUBDIRS -= \
qfilesystementry
+
+winrt: SUBDIRS -= \
+ qprocess \
+ qprocess-noapplication \
+ qprocessenvironment \
+ qwinoverlappedionotifier
diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro
index bc6922b4e9..e282bd091c 100644
--- a/tests/auto/corelib/io/qfile/test/test.pro
+++ b/tests/auto/corelib/io/qfile/test/test.pro
@@ -13,5 +13,5 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \
../Makefile ../forCopying.txt ../forRenaming.txt \
../resources/file1.ext1
-win32: LIBS+=-lole32 -luuid
+win32:!winrt: LIBS+=-lole32 -luuid
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 2b029203e9..78cb27ee30 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -527,7 +527,7 @@ void tst_QFile::open_data()
<< false << QFile::OpenError;
QTest::newRow("noreadfile") << QString::fromLatin1(noReadFile) << int(QIODevice::ReadOnly)
<< false << QFile::OpenError;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
//opening devices requires administrative privileges (and elevation).
HANDLE hTest = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hTest != INVALID_HANDLE_VALUE) {
@@ -1057,7 +1057,7 @@ void tst_QFile::ungetChar()
QCOMPARE(buf[2], '4');
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QString driveLetters()
{
wchar_t volumeName[MAX_PATH];
@@ -1094,7 +1094,7 @@ void tst_QFile::invalidFile_data()
#if !defined(Q_OS_WIN)
QTest::newRow( "x11" ) << QString( "qwe//" );
#else
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid");
#endif
QTest::newRow( "colon3" ) << QString( ":failinvalid" );
@@ -1338,10 +1338,12 @@ void tst_QFile::copyFallback()
#ifdef Q_OS_WIN
#include <objbase.h>
+#ifndef Q_OS_WINPHONE
#include <shlobj.h>
#endif
+#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
static QString getWorkingDirectoryForLink(const QString &linkFileName)
{
bool neededCoInit = false;
@@ -1400,7 +1402,7 @@ void tst_QFile::link()
QCOMPARE(QFile::symLinkTarget("myLink.lnk"), referenceTarget);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QString wd = getWorkingDirectoryForLink(info2.absoluteFilePath());
QCOMPARE(QDir::fromNativeSeparators(wd), QDir::cleanPath(info1.absolutePath()));
#endif
@@ -2690,8 +2692,12 @@ void tst_QFile::nativeHandleLeaks()
}
#ifdef Q_OS_WIN
+# ifndef Q_OS_WINRT
handle1 = ::CreateFileA("qt_file.tmp", GENERIC_READ, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+# else
+ handle1 = ::CreateFile2(L"qt_file.tmp", GENERIC_READ, 0, OPEN_ALWAYS, NULL);
+# endif
QVERIFY( INVALID_HANDLE_VALUE != handle1 );
QVERIFY( ::CloseHandle(handle1) );
#endif
@@ -2705,8 +2711,12 @@ void tst_QFile::nativeHandleLeaks()
}
#ifdef Q_OS_WIN
+# ifndef Q_OS_WINRT
handle2 = ::CreateFileA("qt_file.tmp", GENERIC_READ, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+# else
+ handle2 = ::CreateFile2(L"qt_file.tmp", GENERIC_READ, 0, OPEN_ALWAYS, NULL);
+# endif
QVERIFY( INVALID_HANDLE_VALUE != handle2 );
QVERIFY( ::CloseHandle(handle2) );
#endif
diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
index c4b37a8847..64d289bc3c 100644
--- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
@@ -6,5 +6,5 @@ RESOURCES += qfileinfo.qrc
TESTDATA += qfileinfo.qrc qfileinfo.pro tst_qfileinfo.cpp resources/file1 resources/file1.ext1 resources/file1.ext1.ext2
-win32*:!wince*:LIBS += -ladvapi32 -lnetapi32
+win32*:!wince*:!winrt:LIBS += -ladvapi32 -lnetapi32
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index d2171cc64a..74667a951f 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -62,7 +62,7 @@
#ifdef Q_OS_WIN
#include <qt_windows.h>
#include <qlibrary.h>
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#include <lm.h>
#endif
#endif
@@ -176,7 +176,7 @@ private slots:
void refresh();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void ntfsJunctionPointsAndSymlinks_data();
void ntfsJunctionPointsAndSymlinks();
void brokenShortcut();
@@ -193,7 +193,7 @@ private slots:
void detachingOperations();
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void owner();
#endif
void group();
@@ -1058,7 +1058,7 @@ void tst_QFileInfo::fileTimes()
//In Vista the last-access timestamp is not updated when the file is accessed/touched (by default).
//To enable this the HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate
//is set to 0, in the test machine.
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
HKEY key;
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\FileSystem",
0, KEY_READ, &key)) {
@@ -1085,8 +1085,8 @@ void tst_QFileInfo::fileTimes()
void tst_QFileInfo::fileTimes_oldFile()
{
- // This is not supported on WinCE
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ // This is not supported on WinCE or WinRT
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
// All files are opened in share mode (both read and write).
DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
@@ -1329,7 +1329,7 @@ void tst_QFileInfo::refresh()
QCOMPARE(info2.size(), info.size());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
{
QTest::addColumn<QString>("path");
@@ -1680,7 +1680,7 @@ void tst_QFileInfo::detachingOperations()
QVERIFY(!info1.caching());
}
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#if defined (Q_OS_WIN)
BOOL IsUserAdmin()
{
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 20ef7b5a76..b5115972d7 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -55,6 +55,7 @@ class tst_QFileSystemWatcher : public QObject
public:
tst_QFileSystemWatcher();
+#ifndef QT_NO_FILESYSTEMWATCHER
private slots:
void basicTest_data();
void basicTest();
@@ -83,16 +84,20 @@ private slots:
private:
QString m_tempDirPattern;
+#endif // QT_NO_FILESYSTEMWATCHER
};
tst_QFileSystemWatcher::tst_QFileSystemWatcher()
{
+#ifndef QT_NO_FILESYSTEMWATCHER
m_tempDirPattern = QDir::tempPath();
if (!m_tempDirPattern.endsWith(QLatin1Char('/')))
m_tempDirPattern += QLatin1Char('/');
m_tempDirPattern += QStringLiteral("tst_qfilesystemwatcherXXXXXX");
+#endif // QT_NO_FILESYSTEMWATCHER
}
+#ifndef QT_NO_FILESYSTEMWATCHER
void tst_QFileSystemWatcher::basicTest_data()
{
QTest::addColumn<QString>("backend");
@@ -676,6 +681,7 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved()
QTRY_COMPARE(changedSpy.count(), 10);
}
+#endif // QT_NO_FILESYSTEMWATCHER
QTEST_MAIN(tst_QFileSystemWatcher)
#include "tst_qfilesystemwatcher.moc"
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index 290d4ac240..186e7b1a3f 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -118,7 +118,7 @@ private slots:
#if !defined(Q_OS_WIN) && !defined(QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER)
void dontReorderIniKeysNeedlessly();
#endif
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void consistentRegistryStorage();
#endif
@@ -273,7 +273,7 @@ void tst_QSettings::init()
QSettings::setSystemIniPath(settingsPath("__system__"));
QSettings::setUserIniPath(settingsPath("__user__"));
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QSettings("HKEY_CURRENT_USER\\Software\\software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_LOCAL_MACHINE\\Software\\software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_CURRENT_USER\\Software\\other.software.org", QSettings::NativeFormat).clear();
@@ -1501,7 +1501,7 @@ void tst_QSettings::sync()
// Now "some other app" will change other.software.org.ini
QString userConfDir = settingsPath("__user__") + QDir::separator();
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
unlink((userConfDir + "other.software.org.ini").toLatin1());
rename((userConfDir + "software.org.ini").toLatin1(),
(userConfDir + "other.software.org.ini").toLatin1());
@@ -3189,7 +3189,7 @@ void tst_QSettings::recursionBug()
}
}
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
static DWORD readKeyType(HKEY handle, const QString &rSubKey)
{
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index 713d0c5c17..a6cc083d9c 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -257,7 +257,7 @@ void tst_QTemporaryDir::nonWritableCurrentDir()
void tst_QTemporaryDir::openOnRootDrives()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
// If it's possible to create a file in the root directory, it
@@ -271,7 +271,7 @@ void tst_QTemporaryDir::openOnRootDrives()
QVERIFY(dir.isValid());
}
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
SetErrorMode(lastErrorMode);
#endif
}
diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
index 6eb6f83d2a..5ad798ae1f 100644
--- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -371,7 +371,7 @@ void tst_QTemporaryFile::resize()
void tst_QTemporaryFile::openOnRootDrives()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
unsigned int lastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
// If it's possible to create a file in the root directory, it
@@ -385,7 +385,7 @@ void tst_QTemporaryFile::openOnRootDrives()
QVERIFY(file.open());
}
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
SetErrorMode(lastErrorMode);
#endif
}
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro
index a283f5343d..2f3c02332d 100644
--- a/tests/auto/corelib/kernel/kernel.pro
+++ b/tests/auto/corelib/kernel/kernel.pro
@@ -31,6 +31,6 @@ SUBDIRS=\
qsharedmemory
# This test is only applicable on Windows
-!win32*:SUBDIRS -= qwineventnotifier
+!win32*|winrt: SUBDIRS -= qwineventnotifier
android|qnx: SUBDIRS -= qsharedmemory qsystemsemaphore
diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
index e5bcc31e6a..5593aa2430 100644
--- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
+++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
@@ -4,7 +4,7 @@ TARGET = tst_qeventloop
QT = core network testlib core-private
SOURCES = $$PWD/tst_qeventloop.cpp
-win32:!wince*:LIBS += -luser32
+win32:!wince*:!winrt:LIBS += -luser32
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
contains(QT_CONFIG, glib): DEFINES += HAVE_GLIB
diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
index 23a8e6d23a..d19ec23760 100644
--- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
+++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
@@ -6,11 +6,11 @@ SOURCES = tst_qmetatype.cpp
TESTDATA=./typeFlags.bin
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-win32-msvc*|wince {
+win32-msvc*|wince|winrt {
# Prevents "fatal error C1128: number of sections exceeded object file format limit".
QMAKE_CXXFLAGS += /bigobj
# Reduce compile time
- win32-msvc2012|wince {
+ win32-msvc2012|wince|winrt {
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE -= -O2
}
diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index 7d041e69cb..0d51f69559 100644
--- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -52,6 +52,8 @@
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
#include <windows.h>
#define sleep(X) Sleep(X)
+#elif defined(Q_OS_WINRT)
+#define sleep(X) WaitForSingleObjectEx(GetCurrentThread(), X, FALSE);
#endif
//on solaris, threads that loop on the release bool variable
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 2072034f5f..c96de29b98 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -232,7 +232,7 @@ void tst_QThreadStorage::adoptedThreads()
const int state = pthread_create(&thread, 0, testAdoptedThreadStorageUnix, &pointers);
QCOMPARE(state, 0);
pthread_join(thread, 0);
-#elif defined Q_OS_WIN
+#elif defined Q_OS_WIN && !defined(Q_OS_WINRT)
HANDLE thread;
#if defined(Q_OS_WINCE)
thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)testAdoptedThreadStorageWin, &pointers, 0, NULL);
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index d8965dee5d..1ee6cacd97 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -546,6 +546,9 @@ void tst_QCommandLineParser::testHelpOption()
void tst_QCommandLineParser::testQuoteEscaping()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("This test requires QProcess support");
+#else
QCoreApplication app(empty_argc, empty_argv);
QProcess process;
process.start("testhelper/qcommandlineparser_test_helper", QStringList() <<
@@ -561,6 +564,7 @@ void tst_QCommandLineParser::testQuoteEscaping()
QVERIFY2(output.contains("KEY2=\\\"VALUE2\\\""), qPrintable(output));
QVERIFY2(output.contains("QTBUG-15379=C:\\path\\'file.ext"), qPrintable(output));
QVERIFY2(output.contains("QTBUG-30628=C:\\temp\\'file'.ext"), qPrintable(output));
+#endif // !QT_NO_PROCESS
}
QTEST_APPLESS_MAIN(tst_QCommandLineParser)
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index a282fcabd3..039f5cbc44 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -49,6 +49,9 @@
#ifdef Q_OS_WIN
# include <windows.h>
+# if defined(Q_OS_WINRT)
+# define tzset()
+# endif
#endif
class tst_QDateTime : public QObject
@@ -173,7 +176,7 @@ void tst_QDateTime::init()
{
#if defined(Q_OS_WINCE)
SetUserDefaultLCID(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
-#elif defined(Q_OS_WIN)
+#elif defined(Q_OS_WIN32)
SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
#endif
}
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index d6dea05755..f11e632b2e 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -133,7 +133,7 @@ public:
private slots:
void initTestCase();
void cleanupTestCase();
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void windowsDefaultLocale();
#endif
#ifdef Q_OS_MAC
@@ -1472,7 +1472,7 @@ void tst_QLocale::macDefaultLocale()
}
#endif // Q_OS_MAC
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
#include <qt_windows.h>
static QString getWinLocaleInfo(LCTYPE type)
@@ -1526,7 +1526,7 @@ public:
#endif // Q_OS_WIN
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void tst_QLocale::windowsDefaultLocale()
{
RestoreLocaleHelper systemLocale;
diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro
index bdd0c15788..33c301a500 100644
--- a/tests/auto/gui/image/qpixmap/qpixmap.pro
+++ b/tests/auto/gui/image/qpixmap/qpixmap.pro
@@ -5,7 +5,7 @@ QT += core-private gui-private testlib
qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpixmap.cpp
-!wince* {
+!wince*:!winrt {
win32:LIBS += -lgdi32 -luser32
}
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index cb5d836291..79dc3f311a 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -116,7 +116,7 @@ private slots:
void convertFromImageDetach();
void convertFromImageCacheKey();
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void toWinHBITMAP_data();
void toWinHBITMAP();
void fromWinHBITMAP_data();
@@ -805,7 +805,7 @@ void tst_QPixmap::convertFromImageCacheKey()
QCOMPARE(copy.cacheKey(), pix.cacheKey());
}
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap);
@@ -1024,7 +1024,7 @@ void tst_QPixmap::fromWinHICON()
#endif // Q_OS_WINCE
}
-#endif // Q_OS_WIN
+#endif // Q_OS_WIN && !Q_OS_WINRT
void tst_QPixmap::onlyNullPixmapsOutsideGuiThread()
{
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index dd9202c748..acb921b34a 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -50,6 +50,9 @@
#include <qdatastream.h>
#ifdef Q_OS_WIN
# include <qt_windows.h>
+# if defined(Q_OS_WINRT)
+# include <winsock2.h>
+# endif
#endif
class tst_QHostAddress : public QObject
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index e81c7f71db..e3156ceb3f 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -67,7 +67,7 @@
#include <time.h>
#include <qlibrary.h>
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
#include <windows.h>
#else
#include <unistd.h>
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
index f87493205f..69ecbcb019 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
@@ -55,11 +55,14 @@
#include <QtSql/private/qsqldriver_p.h>
#include <QtTest/QtTest>
-#if defined (Q_OS_WIN) || defined (Q_OS_WIN32)
+#if defined(Q_OS_WIN)
# include <qt_windows.h>
-# if defined (Q_OS_WINCE)
+# if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
# include <winsock2.h>
# endif
+# if defined(Q_OS_WINRT) && !defined(Q_OS_WINPHONE)
+static inline int gethostname(char *name, int len) { qstrcpy(name, "localhost"); return 9; }
+# endif
#else
#include <unistd.h>
#endif
diff --git a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
index 067c2a9f4f..3b73d87876 100644
--- a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
+++ b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
@@ -57,7 +57,7 @@ private slots:
void tst_Crashes::crash()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
//we avoid the error dialogbox to appear on windows
SetErrorMode( SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
#endif
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 0b9fb5c168..e24a1dfc96 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -416,7 +416,14 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
wchar_t nativeHiddenFile[MAX_PATH];
memset(nativeHiddenFile, 0, sizeof(nativeHiddenFile));
hiddenFile.toWCharArray(nativeHiddenFile);
+#ifndef Q_OS_WINRT
DWORD currentAttributes = ::GetFileAttributes(nativeHiddenFile);
+#else // !Q_OS_WINRT
+ WIN32_FILE_ATTRIBUTE_DATA attributeData;
+ if (!::GetFileAttributesEx(nativeHiddenFile, GetFileExInfoStandard, &attributeData))
+ attributeData.dwFileAttributes = 0xFFFFFFFF;
+ DWORD currentAttributes = attributeData.dwFileAttributes;
+#endif // Q_OS_WINRT
if (currentAttributes == 0xFFFFFFFF) {
qErrnoWarning("failed to get file attributes: %s", qPrintable(hiddenFile));
return false;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
index 0c3b46c5d5..527f62b22d 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
@@ -5,5 +5,5 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsitem.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-win32:!wince*: LIBS += -luser32
+win32:!wince*:!winrt: LIBS += -luser32
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 2c03850181..70cfbc8856 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -71,7 +71,7 @@ Q_DECLARE_METATYPE(QPainterPath)
#include "../../../qtest-config.h"
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
index 8d00931ef1..a6022e0d7d 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
@@ -4,7 +4,7 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicsscene.cpp
RESOURCES += images.qrc
-win32:!wince*: LIBS += -luser32
+win32:!wince*:!winrt: LIBS += -luser32
!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index fe1df6c8f0..b3fba29f81 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -54,7 +54,7 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
index cb935fd2fd..313cadd6a1 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
+++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
@@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate
QT += widgets testlib
SOURCES += tst_qitemdelegate.cpp
-win32:!wince*: LIBS += -luser32
+win32:!wince*:!winrt: LIBS += -luser32
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 439725b257..addb226101 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -66,7 +66,7 @@
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index 413304bdcf..1ea8beb8df 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib
SOURCES += tst_qlistview.cpp
-win32:!wince*: LIBS += -luser32
+win32:!wince*:!winrt: LIBS += -luser32
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 268276bd4a..9f5484983d 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -1484,7 +1484,7 @@ void tst_QListView::wordWrap()
QTRY_COMPARE(lv.verticalScrollBar()->isVisible(), true);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
class SetCurrentIndexAfterAppendRowCrashDialog : public QDialog
{
Q_OBJECT
@@ -1525,7 +1525,7 @@ private:
};
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && WINVER >= 0x0500
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && WINVER >= 0x0500
// This test only makes sense on windows 2000 and higher.
void tst_QListView::setCurrentIndexAfterAppendRowCrash()
{
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 8d75298673..fee8b6aee5 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -1891,7 +1891,7 @@ void tst_QApplication::windowsCommandLine_data()
void tst_QApplication::windowsCommandLine()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QFETCH(QString, args);
QFETCH(QString, expected);
diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro
index a4fcde8a34..3eedfa1d3a 100644
--- a/tests/auto/widgets/kernel/qwidget/qwidget.pro
+++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro
@@ -20,7 +20,7 @@ x11 {
LIBS += $$QMAKE_LIBS_X11
}
-!wince*:win32: LIBS += -luser32 -lgdi32
+!wince*:win32:!winrt: LIBS += -luser32 -lgdi32
mac:CONFIG+=insignificant_test # QTBUG-25300, QTBUG-23695
linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC # QTBUG-30566 \ No newline at end of file
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 227f61b0a3..2da8df6116 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -116,11 +116,13 @@ static bool qt_wince_is_platform(const QString &platformString) {
}
static inline bool qt_wince_is_smartphone() { return qt_wince_is_platform(QString::fromLatin1("Smartphone")); }
# endif // Q_OS_WINCE_WM
-# else // Q_OS_WINCE
+# elif !defined(Q_OS_WINRT) // Q_OS_WINCE
# define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
QSKIP("desktop is not visible, this test would fail");
-# endif // !Q_OS_WINCE
+# else // !Q_OS_WINCE && !Q_OS_WINRT
+# define Q_CHECK_PAINTEVENTS
+# endif // Q_OS_WINRT
#else // Q_OS_WIN
# define Q_CHECK_PAINTEVENTS
#endif // else Q_OS_WIN
@@ -285,7 +287,7 @@ private slots:
void subtractOpaqueSiblings();
#endif
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void setGeometry_win();
#endif
@@ -355,7 +357,7 @@ private slots:
void quitOnCloseAttribute();
void moveRect();
-#if defined (Q_OS_WIN)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
void gdiPainting();
void paintOnScreenPossible();
#endif
@@ -572,7 +574,7 @@ void tst_QWidget::getSetCheck()
QCOMPARE(true, obj1.autoFillBackground());
var1.reset();
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
obj1.setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
const HWND handle = reinterpret_cast<HWND>(obj1.winId()); // explicitly create window handle
QVERIFY(GetWindowLong(handle, GWL_STYLE) & WS_POPUP);
@@ -1257,7 +1259,7 @@ void tst_QWidget::visible_setWindowOpacity()
testWidget->hide();
QVERIFY( !testWidget->isVisible() );
testWidget->setWindowOpacity(0.5);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QVERIFY(!::IsWindowVisible(winHandleOf(testWidget)));
#endif
testWidget->setWindowOpacity(1.0);
@@ -3597,7 +3599,7 @@ void tst_QWidget::optimizedResize_topLevel()
topLevel.partial = false;
topLevel.paintedRegion = QRegion();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)
topLevel.resize(topLevel.size() + QSize(10, 10));
#else
// Static contents does not work when programmatically resizing
@@ -4529,7 +4531,7 @@ void tst_QWidget::setWindowGeometry()
}
}
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void tst_QWidget::setGeometry_win()
{
QWidget widget;
@@ -4548,7 +4550,7 @@ void tst_QWidget::setGeometry_win()
QEXPECT_FAIL("", "QTBUG-26424", Continue);
QVERIFY(rt.top <= 0);
}
-#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
// Since X11 WindowManager operation are all async, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable on X11.
@@ -8047,7 +8049,7 @@ void tst_QWidget::moveRect()
child.move(10, 10); // Don't crash.
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
class GDIWidget : public QDialog
{
Q_OBJECT
@@ -8114,7 +8116,7 @@ void tst_QWidget::paintOnScreenPossible()
w2.setAttribute(Qt::WA_PaintOnScreen);
QVERIFY(w2.testAttribute(Qt::WA_PaintOnScreen));
}
-#endif // Q_OS_WIN
+#endif // Q_OS_WIN && !Q_OS_WINRT
void tst_QWidget::reparentStaticWidget()
{
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index bfffa357a8..ded3e55283 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -346,7 +346,7 @@ void tst_QDateTimeEdit::cleanupTestCase()
void tst_QDateTimeEdit::init()
{
QLocale::setDefault(QLocale(QLocale::C));
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
#endif
testWidget->setDisplayFormat("dd/MM/yyyy"); // Nice default to have
diff --git a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
index 72956a6867..c367959cbc 100644
--- a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
+++ b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
@@ -8,4 +8,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtabwidget.cpp
-win32:!wince*:LIBS += -luser32
+win32:!wince*:!winrt:LIBS += -luser32
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index fa518e6afd..e55438f3d3 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -48,7 +48,7 @@
#include <qlabel.h>
#include <QtWidgets/qboxlayout.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
# include <qt_windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp
index cbe3ec8798..f6190f20c4 100644
--- a/tests/baselineserver/shared/baselineprotocol.cpp
+++ b/tests/baselineserver/shared/baselineprotocol.cpp
@@ -76,7 +76,11 @@ const QString PI_PulseTestrBranch(QLS("PulseTestrBranch"));
void BaselineProtocol::sysSleep(int ms)
{
#if defined(Q_OS_WIN)
+# ifndef Q_OS_WINRT
Sleep(DWORD(ms));
+# else
+ WaitForSingleObjectEx(GetCurrentThread(), ms, false);
+# endif
#else
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
nanosleep(&ts, NULL);
@@ -116,6 +120,7 @@ PlatformInfo PlatformInfo::localHostInfo()
pi.insert(PI_OSName, QLS("Other"));
#endif
+#ifndef QT_NO_PROCESS
QProcess git;
QString cmd;
QStringList args;
@@ -151,6 +156,7 @@ PlatformInfo PlatformInfo::localHostInfo()
pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb));
}
}
+#endif // !QT_NO_PROCESS
return pi;
}
diff --git a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
index 49672a90bf..b2380b0e58 100644
--- a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
+++ b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
@@ -176,7 +176,12 @@ private slots:
wcscat(appendedPath, L"\\*");
WIN32_FIND_DATA fd;
+#ifndef Q_OS_WINRT
HANDLE hSearch = FindFirstFileW(appendedPath, &fd);
+#else
+ HANDLE hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd,
+ FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH);
+#endif
QVERIFY(hSearch != INVALID_HANDLE_VALUE);
QBENCHMARK {
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index 5188658bdb..691e822379 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -106,7 +106,12 @@ static int posix_helper(const wchar_t *dirpath)
wchar_t appendedPath[MAX_PATH];
wcscpy(appendedPath, dirpath);
wcscat(appendedPath, L"\\*");
+#ifndef Q_OS_WINRT
hSearch = FindFirstFile(appendedPath, &fd);
+#else
+ hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd,
+ FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH);
+#endif
appendedPath[origDirPathLength] = 0;
if (hSearch == INVALID_HANDLE_VALUE) {
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
index bb4a921fc7..82bca1541d 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
@@ -230,7 +230,12 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path)
wchar_t szSearchPath[MAX_PATH];
QString::fromLatin1(path).toWCharArray(szSearchPath);
wcscat(szSearchPath, L"\\*");
+#ifndef Q_OS_WINRT
HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult);
+#else
+ HANDLE dir = FindFirstFileEx(szSearchPath, FindExInfoStandard, &m_fileSearchResult,
+ FindExSearchLimitToDirectories, NULL, FIND_FIRST_EX_LARGE_FETCH);
+#endif
m_bFirstSearchResult = true;
#else
DIR *dir = ::opendir(path.constData());
diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp
index 0beffebfb7..e0ae29fbee 100644
--- a/tests/benchmarks/corelib/io/qfile/main.cpp
+++ b/tests/benchmarks/corelib/io/qfile/main.cpp
@@ -310,7 +310,11 @@ void tst_qfile::readBigFile()
// ensure we don't account string conversion
wchar_t* cfilename = (wchar_t*)filename.utf16();
+#ifndef Q_OS_WINRT
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
+#else
+ hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0);
+#endif
Q_ASSERT(hndl);
wchar_t* nativeBuffer = new wchar_t[BUFSIZE];
DWORD numberOfBytesRead;
@@ -319,7 +323,12 @@ void tst_qfile::readBigFile()
do {
ReadFile(hndl, nativeBuffer, blockSize, &numberOfBytesRead, NULL);
} while(numberOfBytesRead != 0);
+#ifndef Q_OS_WINRT
SetFilePointer(hndl, 0, NULL, FILE_BEGIN);
+#else
+ LARGE_INTEGER offset = { 0 };
+ SetFilePointerEx(hndl, offset, NULL, FILE_BEGIN);
+#endif
}
delete[] nativeBuffer;
CloseHandle(hndl);
@@ -400,11 +409,20 @@ void tst_qfile::seek()
// ensure we don't account string conversion
wchar_t* cfilename = (wchar_t*)filename.utf16();
+#ifndef Q_OS_WINRT
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
+#else
+ hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0);
+#endif
Q_ASSERT(hndl);
QBENCHMARK {
i=(i+1)%sp_size;
+#ifndef Q_OS_WINRT
SetFilePointer(hndl, seekpos[i], NULL, 0);
+#else
+ LARGE_INTEGER offset = { seekpos[i] };
+ SetFilePointerEx(hndl, offset, NULL, FILE_BEGIN);
+#endif
}
CloseHandle(hndl);
#else
@@ -489,7 +507,11 @@ void tst_qfile::open()
wchar_t* cfilename = (wchar_t*)filename.utf16();
QBENCHMARK {
+#ifndef Q_OS_WINRT
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
+#else
+ hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0);
+#endif
Q_ASSERT(hndl);
CloseHandle(hndl);
}
@@ -698,7 +720,11 @@ void tst_qfile::readSmallFiles()
// ensure we don't account string conversion
wchar_t* cfilename = (wchar_t*)filename.utf16();
+#ifndef Q_OS_WINRT
hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
+#else
+ hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0);
+#endif
Q_ASSERT(hndl);
wchar_t* nativeBuffer = new wchar_t[BUFSIZE];
DWORD numberOfBytesRead;
diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
index 594e5b7478..de1aaea177 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp
+++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
@@ -54,7 +54,7 @@ class qfileinfo : public QObject
private slots:
void existsTemporary();
void existsStatic();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void symLinkTargetPerformanceLNK();
void symLinkTargetPerformanceMounpoint();
#endif
@@ -84,7 +84,7 @@ void qfileinfo::existsStatic()
QBENCHMARK { QFileInfo::exists(appPath); }
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
void qfileinfo::symLinkTargetPerformanceLNK()
{
QVERIFY(QFile::link("file","link.lnk"));
diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
index a7480e6afe..37fa571f8c 100644
--- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
@@ -93,7 +93,11 @@ void NativeMutexUnlock(NativeMutexType *mutex)
typedef CRITICAL_SECTION NativeMutexType;
void NativeMutexInitialize(NativeMutexType *mutex)
{
+#ifndef Q_OS_WINRT
InitializeCriticalSection(mutex);
+#else
+ InitializeCriticalSectionEx(mutex, 0, 0);
+#endif
}
void NativeMutexDestroy(NativeMutexType *mutex)
{
diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h
index 7aa72cc28e..a68130a324 100644
--- a/tests/shared/filesystem.h
+++ b/tests/shared/filesystem.h
@@ -92,7 +92,7 @@ public:
return file.isNull() ? qint64(-1) : file->write(relativeFileName.toUtf8());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
static void createNtfsJunction(QString target, QString linkName)
{
typedef struct {