From c3059391fea326b7115cf038ecdad8e820a0c2d5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 9 May 2018 13:38:34 +0200 Subject: Make tests compile for Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This only enables compilation, it doesn't fix any test. Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also acdd57cb for winrt. android-ndk-r10e is used to compile, see http://doc-snapshots.qt.io/qt5-5.11/androidgs.html . corelib/io/{qdir,qresourceengine} need to be fixed later. Done-with: Frederik Gladhorn Done-with: MÃ¥rten Nordheim Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b Reviewed-by: Thiago Macieira Reviewed-by: Frederik Gladhorn --- tests/auto/corelib/global/qlogging/qlogging.pro | 2 +- tests/auto/corelib/global/qlogging/test/test.pro | 2 +- tests/auto/corelib/io/io.pro | 5 +++++ tests/auto/corelib/io/qfile/tst_qfile.cpp | 6 ++++++ tests/auto/corelib/kernel/kernel.pro | 2 +- tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro | 2 +- tests/auto/corelib/thread/qthreadstorage/test/test.pro | 2 +- tests/auto/corelib/tools/qlocale/test/test.pro | 2 +- tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp | 2 +- 9 files changed, 18 insertions(+), 7 deletions(-) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/global/qlogging/qlogging.pro b/tests/auto/corelib/global/qlogging/qlogging.pro index bbe75297d5..3f7c0a4074 100644 --- a/tests/auto/corelib/global/qlogging/qlogging.pro +++ b/tests/auto/corelib/global/qlogging/qlogging.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -!winrt { +!android:!winrt { test.depends = app SUBDIRS += app } diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro index 7c46ae9d16..b48bf82cf9 100644 --- a/tests/auto/corelib/global/qlogging/test/test.pro +++ b/tests/auto/corelib/global/qlogging/test/test.pro @@ -7,5 +7,5 @@ QT = core testlib SOURCES = ../tst_qlogging.cpp DEFINES += QT_MESSAGELOGCONTEXT -!winrt: TEST_HELPER_INSTALLS = ../app/app +!android:!winrt: TEST_HELPER_INSTALLS = ../app/app DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro index 5618a42203..5eab944fe4 100644 --- a/tests/auto/corelib/io/io.pro +++ b/tests/auto/corelib/io/io.pro @@ -64,3 +64,8 @@ win32:!qtConfig(private_tests): SUBDIRS -= \ winrt: SUBDIRS -= \ qstorageinfo + +android: SUBDIRS -= \ + qprocess \ + qdir \ + qresourceengine diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index ad00e25e7d..c202923898 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -85,6 +85,12 @@ QT_END_NAMESPACE #include #include +#ifdef Q_OS_ANDROID +// Android introduces a braindamaged fileno macro that isn't +// compatible with the POSIX fileno or its own FILE type. +# undef fileno +#endif + #if defined(Q_OS_WIN) #include "../../../network-settings.h" #endif diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index b5b64973d3..09074a9e8a 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -40,7 +40,7 @@ SUBDIRS=\ # This test is only applicable on Windows !win32*|winrt: SUBDIRS -= qwineventnotifier -android|uikit: SUBDIRS -= qclipboard qobject qsharedmemory qsystemsemaphore +android|uikit: SUBDIRS -= qobject qsharedmemory qsystemsemaphore !qtConfig(systemsemaphore): SUBDIRS -= \ qsystemsemaphore diff --git a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro index 75898f6add..432c564ba1 100644 --- a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro +++ b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -!winrt { +!android:!winrt { test.depends = crashonexit SUBDIRS += crashonexit } diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro index 1a1fede186..d7190f7e7b 100644 --- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro +++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro @@ -5,5 +5,5 @@ CONFIG += console QT = core testlib SOURCES = ../tst_qthreadstorage.cpp -!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit +!android:!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index c87e29e764..f7243e99a7 100644 --- a/tests/auto/corelib/tools/qlocale/test/test.pro +++ b/tests/auto/corelib/tools/qlocale/test/test.pro @@ -16,4 +16,4 @@ win32 { } } -!winrt: TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp +!android:!winrt: TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp index cb963ceeb6..29efd8fb4a 100644 --- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp @@ -882,7 +882,7 @@ void tst_QTimeZone::icuTest() void tst_QTimeZone::tzTest() { -#if defined QT_BUILD_INTERNAL && defined Q_OS_UNIX && !defined Q_OS_DARWIN +#if defined QT_BUILD_INTERNAL && defined Q_OS_UNIX && !defined Q_OS_DARWIN && !defined Q_OS_ANDROID // Known datetimes qint64 std = QDateTime(QDate(2012, 1, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch(); qint64 dst = QDateTime(QDate(2012, 6, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch(); -- cgit v1.2.3