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 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/global') 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 -- cgit v1.2.3 From d420987d54342e6933251e7db1012b8df8a83384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 5 Jun 2018 15:54:07 +0200 Subject: Android: fix tst_qlogging The "app" subfolder was already excluded in the .pro-file but Android supports QProcess, so lets include it in the build. Unfortunately it currently has trouble and crashes (the child process or both processes). So we skip those tests. Task-number: QTBUG-68596 Change-Id: I2e6d0869c408bf08b22c02145db8ce522c64c617 Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/corelib/global/qlogging/qlogging.pro | 2 +- tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/global') diff --git a/tests/auto/corelib/global/qlogging/qlogging.pro b/tests/auto/corelib/global/qlogging/qlogging.pro index 3f7c0a4074..bbe75297d5 100644 --- a/tests/auto/corelib/global/qlogging/qlogging.pro +++ b/tests/auto/corelib/global/qlogging/qlogging.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -!android:!winrt { +!winrt { test.depends = app SUBDIRS += app } diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 3465385ba7..e7a3748c30 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -101,7 +101,11 @@ tst_qmessagehandler::tst_qmessagehandler() void tst_qmessagehandler::initTestCase() { #if QT_CONFIG(process) +# ifdef Q_OS_ANDROID + m_appDir = QCoreApplication::applicationDirPath(); +# else // !android m_appDir = QFINDTESTDATA("app"); +# endif QVERIFY2(!m_appDir.isEmpty(), qPrintable( QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath()))); @@ -818,12 +822,19 @@ void tst_qmessagehandler::qMessagePattern() #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); #else +#ifdef Q_OS_ANDROID + QSKIP("This test crashes on Android"); +#endif QFETCH(QString, pattern); QFETCH(bool, valid); QFETCH(QList, expected); QProcess process; +#ifdef Q_OS_ANDROID + const QString appExe = m_appDir + "/libapp.so"; +#else // !android const QString appExe = m_appDir + "/app"; +#endif // // test QT_MESSAGE_PATTERN @@ -860,13 +871,20 @@ void tst_qmessagehandler::setMessagePattern() #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); #else +#ifdef Q_OS_ANDROID + QSKIP("This test crashes on Android"); +#endif // // test qSetMessagePattern // QProcess process; +#ifdef Q_OS_ANDROID + const QString appExe = m_appDir + "/libapp.so"; +#else // !android const QString appExe = m_appDir + "/app"; +#endif // make sure there is no QT_MESSAGE_PATTERN in the environment QStringList environment = m_baseEnvironment; -- cgit v1.2.3