From 7a4b586f4b8d1b73d1af3d24ff5112e4dc231ea6 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 9 Sep 2021 13:07:26 +0200 Subject: [PATCH] Remove conditioning on Android embedded It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia --- .../android/android_deployment_settings.prf | 2 +- src/corelib/CMakeLists.txt | 16 ++++++------- src/corelib/global/qglobal.cpp | 6 ++--- src/corelib/global/qlogging.cpp | 6 ++--- .../global/qoperatingsystemversion.cpp | 4 ++-- src/corelib/kernel/qcoreapplication.cpp | 13 +++++----- .../kernel/qcoreapplication_platform.h | 4 ++-- src/corelib/kernel/qjnienvironment.h | 2 +- src/corelib/kernel/qjniobject.h | 2 +- src/corelib/time/qtimezone.cpp | 12 +++++----- src/corelib/time/qtimezoneprivate.cpp | 4 ++-- src/corelib/time/qtimezoneprivate_p.h | 6 ++--- src/gui/kernel/qguiapplication.cpp | 6 ++--- .../platform/egl/qeglplatformcontext.cpp | 4 ++-- src/gui/opengl/qopenglfunctions.cpp | 4 ++-- src/plugins/platforms/CMakeLists.txt | 2 +- .../platforms/eglfs/api/qeglfswindow.cpp | 6 ++--- src/plugins/tls/openssl/CMakeLists.txt | 2 +- .../tls/openssl/qtlsbackend_openssl.cpp | 2 +- tests/auto/corelib/io/qdir/CMakeLists.txt | 2 +- tests/auto/corelib/io/qdir/tst_qdir.cpp | 11 +++++---- .../io/qdiriterator/tst_qdiriterator.cpp | 9 +++---- .../corelib/io/qfileinfo/tst_qfileinfo.cpp | 6 ++--- .../tst_qfilesystemwatcher.cpp | 6 ++--- .../auto/corelib/io/qiodevice/CMakeLists.txt | 2 +- .../corelib/io/qiodevice/tst_qiodevice.cpp | 4 ++-- .../corelib/io/qlockfile/tst_qlockfile.cpp | 3 ++- .../io/qloggingregistry/CMakeLists.txt | 2 +- .../corelib/io/qresourceengine/CMakeLists.txt | 2 +- .../qresourceengine/tst_qresourceengine.cpp | 15 +++++++----- .../io/qtemporarydir/tst_qtemporarydir.cpp | 4 ++-- .../corelib/io/qtemporaryfile/CMakeLists.txt | 2 +- .../io/qtemporaryfile/tst_qtemporaryfile.cpp | 17 +++++++------ tests/auto/corelib/kernel/CMakeLists.txt | 2 +- .../corelib/kernel/qtranslator/CMakeLists.txt | 2 +- .../kernel/qtranslator/tst_qtranslator.cpp | 4 ++-- .../serialization/qdatastream/CMakeLists.txt | 2 +- .../corelib/text/qbytearray/CMakeLists.txt | 2 +- tests/auto/corelib/text/qchar/CMakeLists.txt | 2 +- .../corelib/text/qcollator/tst_qcollator.cpp | 8 +++---- .../text/qtextboundaryfinder/CMakeLists.txt | 2 +- .../corelib/time/qtimezone/tst_qtimezone.cpp | 4 ++-- .../tst_qcommandlineparser.cpp | 24 +++++++++---------- .../tools/qcryptographichash/CMakeLists.txt | 2 +- .../corelib/tools/qhashseed/tst_qhashseed.cpp | 2 +- tests/auto/gui/image/qimage/CMakeLists.txt | 2 +- .../gui/image/qimagereader/CMakeLists.txt | 2 +- .../gui/image/qimagewriter/CMakeLists.txt | 2 +- .../auto/gui/painting/qpainter/CMakeLists.txt | 2 +- .../tst_qprocess_and_guieventloop.cpp | 3 ++- .../widgets/dialogs/qsidebar/tst_qsidebar.cpp | 4 ++-- .../qgraphicsscene/tst_qgraphicsscene.cpp | 13 +++++----- .../widgets/kernel/qlayout/CMakeLists.txt | 2 +- .../widgets/kernel/qlayout/tst_qlayout.cpp | 4 ++-- util/cmake/condition_simplifier.py | 6 ++--- util/cmake/helper.py | 3 +-- util/cmake/tests/data/standardpaths.pro | 2 +- util/cmake/tests/test_logic_mapping.py | 3 +-- util/cmake/tests/test_parsing.py | 2 +- util/cmake/tests/test_scope_handling.py | 16 ++++++------- 60 files changed, 156 insertions(+), 154 deletions(-) diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf index c3d49759f5..bc55306fb7 100644 --- a/mkspecs/features/android/android_deployment_settings.prf +++ b/mkspecs/features/android/android_deployment_settings.prf @@ -1,4 +1,4 @@ -contains(TEMPLATE, ".*app"):!build_pass:!android-embedded { +contains(TEMPLATE, ".*app"):!build_pass { defineReplace(emitString) { return("\"$$clean_path($$1)\"") diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 4e435afdab..83d26833fe 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -855,27 +855,27 @@ qt_internal_extend_target(Core CONDITION APPLE AND QT_FEATURE_timezone AND NOT N time/qtimezoneprivate_mac.mm ) -qt_internal_extend_target(Core CONDITION ANDROID AND QT_FEATURE_timezone AND NOT ANDROID_EMBEDDED AND (NACL OR NOT APPLE) +qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND ANDROID AND (NACL OR NOT APPLE) SOURCES time/qtimezoneprivate_android.cpp ) -qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) +qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND NOT ANDROID AND (NACL OR NOT APPLE) SOURCES time/qtimezoneprivate_tz.cpp ) -qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) +qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND NOT ANDROID AND (NACL OR NOT APPLE) SOURCES time/qtimezoneprivate_icu.cpp ) -qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) +qt_internal_extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND NOT ANDROID AND (NACL OR NOT APPLE) SOURCES time/qtimezoneprivate_icu.cpp ) -qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) +qt_internal_extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND NOT ANDROID AND (NACL OR NOT APPLE) SOURCES time/qtimezoneprivate_win.cpp ) @@ -979,7 +979,7 @@ qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE kernel/qelapsedtimer_unix.cpp ) -qt_internal_extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED +qt_internal_extend_target(Core CONDITION ANDROID SOURCES io/qstandardpaths_android.cpp io/qstorageinfo_unix.cpp @@ -990,7 +990,7 @@ qt_internal_extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED platform/android/qandroidnativeinterface.cpp ) -qt_internal_extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) +qt_internal_extend_target(Core CONDITION HAIKU AND NOT ANDROID SOURCES io/qstandardpaths_haiku.cpp io/qstorageinfo_unix.cpp @@ -998,7 +998,7 @@ qt_internal_extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDR be ) -qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) +qt_internal_extend_target(Core CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND NOT ANDROID SOURCES io/qstandardpaths_unix.cpp io/qstorageinfo_unix.cpp diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index f425942f96..2301e5eb70 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -79,7 +79,7 @@ # include #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif @@ -2408,7 +2408,7 @@ static bool findUnixOsVersion(QUnixOSVersion &v) # endif // USE_ETC_OS_RELEASE #endif // Q_OS_UNIX -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID static const char *osVer_helper(QOperatingSystemVersion) { /* Data: @@ -2875,7 +2875,7 @@ QString QSysInfo::productVersion() */ QString QSysInfo::prettyProductName() { -#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN) +#if defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN) const auto version = QOperatingSystemVersion::current(); const int majorVersion = version.majorVersion(); const QString versionString = QString::number(majorVersion) + QLatin1Char('.') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 9bb15d21be..dc28680bc7 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Olivier Goffart ** Copyright (C) 2018 Intel Corporation. ** Contact: https://www.qt.io/licensing/ @@ -1632,7 +1632,7 @@ static bool syslog_default_message_handler(QtMsgType type, const QMessageLogCont } #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID static bool android_default_message_handler(QtMsgType type, const QMessageLogContext &context, const QString &message) @@ -1775,7 +1775,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con handledStderr |= systemd_default_message_handler(type, context, message); # elif QT_CONFIG(syslog) handledStderr |= syslog_default_message_handler(type, context, message); -# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +# elif defined(Q_OS_ANDROID) handledStderr |= android_default_message_handler(type, context, message); # elif defined(QT_USE_APPLE_UNIFIED_LOGGING) handledStderr |= AppleUnifiedLogger::messageHandler(type, context, message); diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp index 9d3a903c3a..61f64306e2 100644 --- a/src/corelib/global/qoperatingsystemversion.cpp +++ b/src/corelib/global/qoperatingsystemversion.cpp @@ -49,7 +49,7 @@ #include #include -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif @@ -156,7 +156,7 @@ QOperatingSystemVersion QOperatingSystemVersion::current() { QOperatingSystemVersion version; version.m_os = currentType(); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #ifndef QT_BOOTSTRAPPED const QVersionNumber v = QVersionNumber::fromString(QJniObject::getStaticObjectField( "android/os/Build$VERSION", "RELEASE", "Ljava/lang/String;").toString()); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 9a40e987fa..84b918bd48 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -94,7 +94,7 @@ #endif #endif // QT_NO_QOBJECT -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#if defined(Q_OS_ANDROID) #include #endif @@ -177,10 +177,10 @@ QString QCoreApplicationPrivate::appName() const QString QCoreApplicationPrivate::appVersion() const { QString applicationVersion; -#ifndef QT_BOOTSTRAPPED -# ifdef Q_OS_DARWIN +#ifdef QT_BOOTSTRAPPED +#elif defined(Q_OS_DARWIN) applicationVersion = infoDictionaryStringProperty(QStringLiteral("CFBundleVersion")); -# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QJniObject context(QNativeInterface::QAndroidApplication::context()); if (context.isValid()) { QJniObject pm = context.callObjectMethod( @@ -198,11 +198,10 @@ QString QCoreApplicationPrivate::appVersion() const } } } -# endif #endif return applicationVersion; } -#endif +#endif // !Q_OS_WIN QString *QCoreApplicationPrivate::cachedApplicationFilePath = nullptr; @@ -2315,7 +2314,7 @@ QString QCoreApplication::applicationDirPath() #if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) // qcoreapplication_win.cpp or qcoreapplication_mac.cpp static QString qAppFileName() { -# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +# if defined(Q_OS_ANDROID) // the actual process on Android is the Java VM, so this doesn't help us return QString(); # elif defined(Q_OS_LINUX) diff --git a/src/corelib/kernel/qcoreapplication_platform.h b/src/corelib/kernel/qcoreapplication_platform.h index b163ccb81c..63d5cbaabd 100644 --- a/src/corelib/kernel/qcoreapplication_platform.h +++ b/src/corelib/kernel/qcoreapplication_platform.h @@ -49,7 +49,7 @@ #include #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#if defined(Q_OS_ANDROID) class _jobject; typedef _jobject* jobject; #endif @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE namespace QNativeInterface { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) || defined(Q_CLANG_QDOC) +#if defined(Q_OS_ANDROID) || defined(Q_CLANG_QDOC) struct Q_CORE_EXPORT QAndroidApplication { QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication, 1, QCoreApplication) diff --git a/src/corelib/kernel/qjnienvironment.h b/src/corelib/kernel/qjnienvironment.h index df3753da83..16a6413d31 100644 --- a/src/corelib/kernel/qjnienvironment.h +++ b/src/corelib/kernel/qjnienvironment.h @@ -42,7 +42,7 @@ #include -#if defined(Q_QDOC) || (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) +#if defined(Q_QDOC) || defined(Q_OS_ANDROID) #include QT_BEGIN_NAMESPACE diff --git a/src/corelib/kernel/qjniobject.h b/src/corelib/kernel/qjniobject.h index d9e11c4934..80568b2970 100644 --- a/src/corelib/kernel/qjniobject.h +++ b/src/corelib/kernel/qjniobject.h @@ -42,7 +42,7 @@ #include -#if defined(Q_QDOC) || (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) +#if defined(Q_QDOC) || defined(Q_OS_ANDROID) #include #include diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp index f84b98e670..1f041c14fb 100644 --- a/src/corelib/time/qtimezone.cpp +++ b/src/corelib/time/qtimezone.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2020 John Layt +** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2013 John Layt ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -37,7 +38,6 @@ ** ****************************************************************************/ - #include "qtimezone.h" #include "qtimezoneprivate_p.h" @@ -62,9 +62,9 @@ static QTimeZonePrivate *newBackendTimeZone() #else #if defined Q_OS_MAC return new QMacTimeZonePrivate(); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) return new QAndroidTimeZonePrivate(); -#elif defined(Q_OS_UNIX) || defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_UNIX) return new QTzTimeZonePrivate(); #elif QT_CONFIG(icu) return new QIcuTimeZonePrivate(); @@ -89,9 +89,9 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId) #else #if defined Q_OS_MAC return new QMacTimeZonePrivate(ianaId); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) return new QAndroidTimeZonePrivate(ianaId); -#elif defined(Q_OS_UNIX) || defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_UNIX) return new QTzTimeZonePrivate(ianaId); #elif QT_CONFIG(icu) return new QIcuTimeZonePrivate(ianaId); diff --git a/src/corelib/time/qtimezoneprivate.cpp b/src/corelib/time/qtimezoneprivate.cpp index 793df92831..bbfea5e536 100644 --- a/src/corelib/time/qtimezoneprivate.cpp +++ b/src/corelib/time/qtimezoneprivate.cpp @@ -205,7 +205,7 @@ QTimeZonePrivate::Data QTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const // Private only method for use by QDateTime to convert local msecs to epoch msecs QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs, int hint) const { -#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED) +#ifndef Q_OS_ANDROID // The Android back-end's hasDaylightTime() is only true for zones with // transitions in the future; we need it to mean "has ever had a transition" // though, so can't trust it here. @@ -610,7 +610,7 @@ bool QTimeZonePrivate::isValidId(const QByteArray &ianaId) // Somewhat slack hand-rolled version: const int MinSectionLength = 1; -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID // Android has its own naming of zones. // "Canada/East-Saskatchewan" has a 17-character second component. const int MaxSectionLength = 17; diff --git a/src/corelib/time/qtimezoneprivate_p.h b/src/corelib/time/qtimezoneprivate_p.h index 455db803a9..129f0343b3 100644 --- a/src/corelib/time/qtimezoneprivate_p.h +++ b/src/corelib/time/qtimezoneprivate_p.h @@ -69,7 +69,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone); #include #endif // Q_OS_WIN -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif @@ -273,7 +273,7 @@ private: }; #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED)) +#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) struct QTzTransitionTime { qint64 atMSecsSinceEpoch; @@ -462,7 +462,7 @@ private: }; #endif // Q_OS_WIN -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID class QAndroidTimeZonePrivate final : public QTimeZonePrivate { public: diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 294684584b..99cf9ef7a6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -2338,7 +2338,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE QWindow *window = e->window.data(); modifier_buttons = e->modifiers; if (e->nullWindow() -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID || e->key == Qt::Key_Back || e->key == Qt::Key_Menu #endif ) { @@ -2374,7 +2374,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE if (window && !window->d_func()->blockedByModalWindow) QGuiApplication::sendSpontaneousEvent(window, &ev); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID else ev.setAccepted(false); diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp index 5727b94aa2..3bc01145bd 100644 --- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp +++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -44,7 +44,7 @@ #include #include -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif #ifndef Q_OS_WIN diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 19012dddd3..bc1bad2831 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -422,7 +422,7 @@ static int qt_gl_resolve_extensions() // We don't match GL_APPLE_texture_format_BGRA8888 here because it has different semantics. if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) extensions |= QOpenGLExtensions::BGRATextureFormat; -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString *deviceName = static_cast(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); static bool wrongfullyReportsBgra8888Support = deviceName != 0 diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 8081f0a82e..ba64b6b0f5 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from platforms.pro. -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) add_subdirectory(android) endif() if(NOT ANDROID AND NOT WASM) diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index 2ee237ec28..b1fdba5a46 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -111,11 +111,11 @@ void QEglFSWindow::create() QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); if (screen->primarySurface() != EGL_NO_SURFACE) { if (Q_UNLIKELY(!isRaster() || !compositor->targetWindow())) { -#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED) +# ifndef Q_OS_ANDROID // We can have either a single OpenGL window or multiple raster windows. // Other combinations cannot work. qFatal("EGLFS: OpenGL windows cannot be mixed with others."); -#endif +# endif return; } m_format = compositor->targetWindow()->format(); diff --git a/src/plugins/tls/openssl/CMakeLists.txt b/src/plugins/tls/openssl/CMakeLists.txt index 78c1089823..0a35d5888b 100644 --- a/src/plugins/tls/openssl/CMakeLists.txt +++ b/src/plugins/tls/openssl/CMakeLists.txt @@ -35,7 +35,7 @@ qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION APPLE ${FWSecurity} ) -qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION ANDROID AND NOT ANDROID_EMBEDDED +qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION ANDROID SOURCES qsslsocket_openssl_android.cpp ) diff --git a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp index 5d3b3ea582..69a85a83ec 100644 --- a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp +++ b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp @@ -368,7 +368,7 @@ QTlsPrivate::X509Certificate *QTlsBackendOpenSSL::createCertificate() const namespace QTlsPrivate { // TLSTODO: remove. -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QList fetchSslCertificateData(); #endif diff --git a/tests/auto/corelib/io/qdir/CMakeLists.txt b/tests/auto/corelib/io/qdir/CMakeLists.txt index 4c26780f99..ee24703bd3 100644 --- a/tests/auto/corelib/io/qdir/CMakeLists.txt +++ b/tests/auto/corelib/io/qdir/CMakeLists.txt @@ -45,7 +45,7 @@ qt_internal_extend_target(tst_qdir CONDITION CONFIG___contains___builtin_testdat BUILTIN_TESTDATA ) -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "entrylist/directory/dummy" diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 7b7a996cdd..d45a49229d 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2017 Intel Corporation. -** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -232,20 +232,21 @@ private: Q_DECLARE_METATYPE(tst_QDir::UncHandling) tst_QDir::tst_QDir() -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID : m_dataPath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) #elif !defined(BUILTIN_TESTDATA) : m_dataPath(QFileInfo(QFINDTESTDATA("testData")).absolutePath()) #endif { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString resourceSourcePath = QStringLiteral(":/android_testdata/"); QDirIterator it(resourceSourcePath, QDirIterator::Subdirectories); while (it.hasNext()) { QFileInfo fileInfo = it.nextFileInfo(); if (!fileInfo.isDir()) { - QString destination = m_dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourceSourcePath.length()); + QString destination = m_dataPath + QLatin1Char('/') + + fileInfo.filePath().mid(resourceSourcePath.length()); QFileInfo destinationFileInfo(destination); if (!destinationFileInfo.exists()) { QDir().mkpath(destinationFileInfo.path()); @@ -2217,7 +2218,7 @@ void tst_QDir::equalityOperator_data() //need a path in the root directory that is unlikely to be a symbolic link. #if defined (Q_OS_WIN) QString pathinroot("c:/windows/.."); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QString pathinroot("/system/.."); #elif defined(Q_OS_HAIKU) QString pathinroot("/boot/.."); diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index 35282ccaa3..9761fbcfb3 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -45,7 +45,7 @@ # include "../../../network-settings.h" #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif @@ -122,7 +122,7 @@ private: void tst_QDirIterator::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString testdata_dir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); QString resourceSourcePath = QStringLiteral(":/testdata"); QDirIterator it(resourceSourcePath, QDirIterator::Subdirectories); @@ -130,7 +130,8 @@ void tst_QDirIterator::initTestCase() QFileInfo fileInfo = it.nextFileInfo(); if (!fileInfo.isDir()) { - QString destination = testdata_dir + QLatin1Char('/') + fileInfo.filePath().mid(resourceSourcePath.length()); + QString destination = testdata_dir + QLatin1Char('/') + + fileInfo.filePath().mid(resourceSourcePath.length()); QFileInfo destinationFileInfo(destination); if (!destinationFileInfo.exists()) { QDir().mkpath(destinationFileInfo.path()); diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 461d2c03d4..0720beb238 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1201,7 +1201,7 @@ void tst_QFileInfo::fileTimes() QCOMPARE(fileInfo.birthTime(), birthTime); // mustn't have changed QVERIFY(readTime.isValid()); -#if defined(Q_OS_QNX) || (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) +#if defined(Q_OS_QNX) || defined(Q_OS_ANDROID) noAccessTime = true; #elif defined(Q_OS_WIN) //In Vista the last-access timestamp is not updated when the file is accessed/touched (by default). @@ -1877,7 +1877,7 @@ void tst_QFileInfo::isWritable() void tst_QFileInfo::isExecutable() { QString appPath = QCoreApplication::applicationDirPath(); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID appPath += "/libtst_qfileinfo.so"; #else appPath += "/tst_qfileinfo"; diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 721901ffe7..1fe47f196a 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -41,7 +41,7 @@ #include #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif @@ -104,7 +104,7 @@ tst_QFileSystemWatcher::tst_QFileSystemWatcher() m_tempDirPattern += QLatin1Char('/'); m_tempDirPattern += QStringLiteral("tst_qfilesystemwatcherXXXXXX"); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QDir::setCurrent(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); #endif } diff --git a/tests/auto/corelib/io/qiodevice/CMakeLists.txt b/tests/auto/corelib/io/qiodevice/CMakeLists.txt index 3fa19d9f30..2bd6033440 100644 --- a/tests/auto/corelib/io/qiodevice/CMakeLists.txt +++ b/tests/auto/corelib/io/qiodevice/CMakeLists.txt @@ -21,7 +21,7 @@ qt_internal_add_test(tst_qiodevice ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "tst_qiodevice.cpp" diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index a754984d03..88e41092a6 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -70,7 +70,7 @@ private: void tst_QIODevice::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QVERIFY(QFileInfo(QStringLiteral("./tst_qiodevice.cpp")).exists() || QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp"))); #endif diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp index 24669cd72b..31086d14e7 100644 --- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp +++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2013 David Faure ** Contact: https://www.qt.io/licensing/ ** @@ -83,7 +84,7 @@ public: void tst_QLockFile::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("This test requires deploying and running external console applications"); #elif !QT_CONFIG(process) QSKIP("This test requires QProcess support"); diff --git a/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt index 4c903de17f..a00fb8cb32 100644 --- a/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt +++ b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt @@ -21,7 +21,7 @@ qt_internal_add_test(tst_qloggingregistry ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "qtlogging.ini" diff --git a/tests/auto/corelib/io/qresourceengine/CMakeLists.txt b/tests/auto/corelib/io/qresourceengine/CMakeLists.txt index 7152d988c9..b6b3c588d5 100644 --- a/tests/auto/corelib/io/qresourceengine/CMakeLists.txt +++ b/tests/auto/corelib/io/qresourceengine/CMakeLists.txt @@ -31,7 +31,7 @@ qt_internal_add_test(tst_qresourceengine qt_add_resources(additional_sources testqrc/test.qrc) target_sources(tst_qresourceengine PRIVATE ${additional_sources}) -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) qt_add_resources(additional_sources android_testdata.qrc) target_sources(tst_qresourceengine PRIVATE ${additional_sources}) endif() diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index d55f6f8fb9..1de5749d6e 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -40,8 +40,10 @@ class tst_QResourceEngine: public QObject public: tst_QResourceEngine() -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) - : m_runtimeResourceRcc(QFileInfo(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/runtime_resource.rcc")).absoluteFilePath()) +#ifdef Q_OS_ANDROID + : m_runtimeResourceRcc( + QFileInfo(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + + QStringLiteral("/runtime_resource.rcc")).absoluteFilePath()) #else : m_runtimeResourceRcc(QFINDTESTDATA("runtime_resource.rcc")) #endif @@ -71,7 +73,7 @@ private: void tst_QResourceEngine::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString sourcePath(QStringLiteral(":/android_testdata/")); QString dataPath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); @@ -79,7 +81,8 @@ void tst_QResourceEngine::initTestCase() while (it.hasNext()) { QFileInfo fileInfo = it.nextFileInfo(); if (!fileInfo.isDir()) { - QString destination(dataPath + QLatin1Char('/') + fileInfo.filePath().mid(sourcePath.length())); + QString destination(dataPath + QLatin1Char('/') + + fileInfo.filePath().mid(sourcePath.length())); QFileInfo destinationFileInfo(destination); if (!destinationFileInfo.exists()) { QVERIFY(QDir().mkpath(destinationFileInfo.path())); @@ -186,7 +189,7 @@ void tst_QResourceEngine::checkStructure_data() QStringList rootContents; rootContents << QLatin1String("aliasdir") -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID << QLatin1String("android_testdata") #endif << QLatin1String("otherdir") diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 3332cd6079..0668ba0faa 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -312,7 +312,7 @@ void tst_QTemporaryDir::nonWritableCurrentDir() { #ifdef Q_OS_UNIX -# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +# ifdef Q_OS_ANDROID const char nonWritableDir[] = "/data"; # else const char nonWritableDir[] = "/home"; diff --git a/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt index f8419cee87..e7a1a65296 100644 --- a/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt +++ b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt @@ -31,7 +31,7 @@ qt_internal_add_resource(tst_qtemporaryfile "qtemporaryfile" ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "resources/test.txt" diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index dcf3486449..9dc644e5f8 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2017 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -51,7 +51,7 @@ # include // close(2) #endif -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #include #endif @@ -107,13 +107,15 @@ void tst_QTemporaryFile::initTestCase() QVERIFY(QDir("test-XXXXXX").exists() || QDir().mkdir("test-XXXXXX")); QCoreApplication::setApplicationName("tst_qtemporaryfile"); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString sourceDir(":/android_testdata/"); QDirIterator it(sourceDir, QDirIterator::Subdirectories); while (it.hasNext()) { QFileInfo sourceFileInfo = it.nextFileInfo(); if (!sourceFileInfo.isDir()) { - QFileInfo destinationFileInfo(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + sourceFileInfo.filePath().mid(sourceDir.length())); + QFileInfo destinationFileInfo( + QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + + sourceFileInfo.filePath().mid(sourceDir.length())); if (!destinationFileInfo.exists()) { QVERIFY(QDir().mkpath(destinationFileInfo.path())); @@ -380,7 +382,7 @@ void tst_QTemporaryFile::nonWritableCurrentDir() ChdirOnReturn cor(QDir::currentPath()); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QDir::setCurrent("/data"); #else QDir::setCurrent("/home"); @@ -806,8 +808,9 @@ void tst_QTemporaryFile::createNativeFile_data() QTest::addColumn("valid"); QTest::addColumn("content"); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) - const QString nativeFilePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/resources/test.txt"); +#ifdef Q_OS_ANDROID + const QString nativeFilePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + + QStringLiteral("/resources/test.txt"); #else const QString nativeFilePath = QFINDTESTDATA("resources/test.txt"); #endif diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt index 4053ca16fa..39f16bc970 100644 --- a/tests/auto/corelib/kernel/CMakeLists.txt +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -45,7 +45,7 @@ endif() if(QT_FEATURE_private_tests) add_subdirectory(qproperty) endif() -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) add_subdirectory(qjnienvironment) add_subdirectory(qjniobject) endif() diff --git a/tests/auto/corelib/kernel/qtranslator/CMakeLists.txt b/tests/auto/corelib/kernel/qtranslator/CMakeLists.txt index 1c7de81d71..e3e69537bf 100644 --- a/tests/auto/corelib/kernel/qtranslator/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qtranslator/CMakeLists.txt @@ -28,7 +28,7 @@ qt_internal_add_resource(tst_qtranslator "qtranslator" ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "dependencies_la.qm" diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index 6ce223cbd2..9f0efac63a 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -34,7 +34,7 @@ #include #include -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include #endif diff --git a/tests/auto/corelib/serialization/qdatastream/CMakeLists.txt b/tests/auto/corelib/serialization/qdatastream/CMakeLists.txt index 91e4e31783..5795ad3ed3 100644 --- a/tests/auto/corelib/serialization/qdatastream/CMakeLists.txt +++ b/tests/auto/corelib/serialization/qdatastream/CMakeLists.txt @@ -18,7 +18,7 @@ qt_internal_add_test(tst_qdatastream ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "datastream.q42" diff --git a/tests/auto/corelib/text/qbytearray/CMakeLists.txt b/tests/auto/corelib/text/qbytearray/CMakeLists.txt index bc07b2e1af..57f73f6672 100644 --- a/tests/auto/corelib/text/qbytearray/CMakeLists.txt +++ b/tests/auto/corelib/text/qbytearray/CMakeLists.txt @@ -25,7 +25,7 @@ qt_internal_extend_target(tst_qbytearray CONDITION APPLE ${FWFoundation} ) -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "rfc3252.txt" diff --git a/tests/auto/corelib/text/qchar/CMakeLists.txt b/tests/auto/corelib/text/qchar/CMakeLists.txt index 529fa39bd9..3cfc31172d 100644 --- a/tests/auto/corelib/text/qchar/CMakeLists.txt +++ b/tests/auto/corelib/text/qchar/CMakeLists.txt @@ -18,7 +18,7 @@ qt_internal_add_test(tst_qchar ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "data/NormalizationTest.txt" diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 1ff80294fe..4935ba9cf2 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -76,7 +76,7 @@ void tst_QCollator::basics() // posix implementation supports only C and default locale, // so update it for Android build -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID c3.setLocale(QLocale()); #endif QCollatorSortKey key1 = c3.sortKey("test"); @@ -111,7 +111,7 @@ void tst_QCollator::moveSemantics() // test QCollatorSortKey move assignment // posix implementation supports only C and default locale, // so update it for Android build -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID c1.setLocale(QLocale()); #endif QCollatorSortKey key1 = c1.sortKey("1"); @@ -281,7 +281,7 @@ void tst_QCollator::compare() return compared < 0 ? -1 : compared > 0 ? 1 : 0; }; -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID if (collator.locale() != QLocale()) QSKIP("Posix implementation of collation only supports default locale"); #endif diff --git a/tests/auto/corelib/text/qtextboundaryfinder/CMakeLists.txt b/tests/auto/corelib/text/qtextboundaryfinder/CMakeLists.txt index e9b0da83a6..024608dc8d 100644 --- a/tests/auto/corelib/text/qtextboundaryfinder/CMakeLists.txt +++ b/tests/auto/corelib/text/qtextboundaryfinder/CMakeLists.txt @@ -16,7 +16,7 @@ qt_internal_add_test(tst_qtextboundaryfinder ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "data/GraphemeBreakTest.txt" diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 200844599a..479c2771d7 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -863,7 +863,7 @@ void tst_QTimeZone::isValidId_data() // Parts separated by '/', each part min 1 and max of 14 chars TESTSET("empty", "", false); TESTSET("minimal", "m", true); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID TESTSET("maximal", "East-Saskatchewan", true); // Android actually uses this TESTSET("too long", "North-Saskatchewan", false); // ... but thankfully not this. #else @@ -934,7 +934,7 @@ void tst_QTimeZone::isValidId_data() QTest::newRow("a,z alone") << QByteArray("a,z") << false; QTest::newRow("/z alone") << QByteArray("/z") << false; QTest::newRow("-z alone") << QByteArray("-z") << false; -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QTest::newRow("long alone") << QByteArray("12345678901234567") << true; QTest::newRow("over-long alone") << QByteArray("123456789012345678") << false; #else diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp index aea3550452..9e37d20746 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp +++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2013 David Faure +** Copyright (C) 2021 David Faure +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -555,10 +556,9 @@ void tst_QCommandLineParser::testVersionOption() { #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); -#else -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QSKIP("Deploying executable applications to file system on Android not supported."); -#endif +#else QCoreApplication app(empty_argc, empty_argv); QProcess process; @@ -623,10 +623,9 @@ void tst_QCommandLineParser::testHelpOption() { #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); -#else -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QSKIP("Deploying executable applications to file system on Android not supported."); -#endif +#else QFETCH(QCommandLineParser::SingleDashWordOptionMode, parsingMode); QFETCH(QString, expectedHelpOutput); @@ -671,7 +670,7 @@ void tst_QCommandLineParser::testQuoteEscaping() { #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QSKIP("Deploying executable applications to file system on Android not supported."); #else QCoreApplication app(empty_argc, empty_argv); @@ -697,7 +696,7 @@ void tst_QCommandLineParser::testUnknownOption() { #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QSKIP("Deploying executable applications to file system on Android not supported."); #else QCoreApplication app(empty_argc, empty_argv); @@ -748,7 +747,7 @@ void tst_QCommandLineParser::testHelpAll() #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); #else -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("Deploying executable applications to file system on Android not supported."); #endif @@ -772,10 +771,9 @@ void tst_QCommandLineParser::testVeryLongOptionNames() { #if !QT_CONFIG(process) QSKIP("This test requires QProcess support"); -#else -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#elif defined(Q_OS_ANDROID) QSKIP("Deploying executable applications to file system on Android not supported."); -#endif +#else QCoreApplication app(empty_argc, empty_argv); QProcess process; diff --git a/tests/auto/corelib/tools/qcryptographichash/CMakeLists.txt b/tests/auto/corelib/tools/qcryptographichash/CMakeLists.txt index a4b3106856..d8de1798f3 100644 --- a/tests/auto/corelib/tools/qcryptographichash/CMakeLists.txt +++ b/tests/auto/corelib/tools/qcryptographichash/CMakeLists.txt @@ -19,7 +19,7 @@ qt_internal_add_test(tst_qcryptographichash ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "data/2c1517dad3678f03917f15849b052fd5.md5" diff --git a/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp b/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp index 1e3a7572d0..fbe13cad3d 100644 --- a/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp +++ b/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp @@ -64,7 +64,7 @@ void tst_QHashSeed::initTestCase() void tst_QHashSeed::environmentVariable_data() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("This test needs a helper binary, so is excluded from this platform."); #endif diff --git a/tests/auto/gui/image/qimage/CMakeLists.txt b/tests/auto/gui/image/qimage/CMakeLists.txt index 85f3fd1c76..4c95b32e48 100644 --- a/tests/auto/gui/image/qimage/CMakeLists.txt +++ b/tests/auto/gui/image/qimage/CMakeLists.txt @@ -23,7 +23,7 @@ qt_internal_add_test(tst_qimage ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(qimage_resource_files "images/image.bmp" diff --git a/tests/auto/gui/image/qimagereader/CMakeLists.txt b/tests/auto/gui/image/qimagereader/CMakeLists.txt index dd15618370..a0cda3bb73 100644 --- a/tests/auto/gui/image/qimagereader/CMakeLists.txt +++ b/tests/auto/gui/image/qimagereader/CMakeLists.txt @@ -49,7 +49,7 @@ qt_internal_add_resource(tst_qimagereader "qmake_immediate" ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(android_testdata_resource_files "images/kollada-noext" diff --git a/tests/auto/gui/image/qimagewriter/CMakeLists.txt b/tests/auto/gui/image/qimagewriter/CMakeLists.txt index f7212eca3e..e74321731f 100644 --- a/tests/auto/gui/image/qimagewriter/CMakeLists.txt +++ b/tests/auto/gui/image/qimagewriter/CMakeLists.txt @@ -24,7 +24,7 @@ qt_internal_add_test(tst_qimagewriter ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(qimagewriter_resource_files "images/YCbCr_cmyk.jpg" diff --git a/tests/auto/gui/painting/qpainter/CMakeLists.txt b/tests/auto/gui/painting/qpainter/CMakeLists.txt index bfb992c7b5..9466dddadd 100644 --- a/tests/auto/gui/painting/qpainter/CMakeLists.txt +++ b/tests/auto/gui/painting/qpainter/CMakeLists.txt @@ -42,7 +42,7 @@ qt_internal_extend_target(tst_qpainter CONDITION TARGET Qt::Widgets Qt::WidgetsPrivate ) -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "drawEllipse/10x10SizeAt0x0.png" diff --git a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp index 2d67e32d4a..a21bb9a005 100644 --- a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp +++ b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -41,7 +42,7 @@ private slots: void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("Not supported on Android"); #else diff --git a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp index 5847bcd694..81bd77fda6 100644 --- a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -93,7 +93,7 @@ void tst_QSidebar::addUrls() QAbstractItemModel *model = qsidebar.model(); QDir testDir = QDir::home(); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID // temp and home is the same directory on Android testDir.mkdir(QStringLiteral("test")); QVERIFY(testDir.cd(QStringLiteral("test"))); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 1b7d645eba..b8991b5a9a 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -2697,7 +2697,7 @@ void tst_QGraphicsScene::render() void tst_QGraphicsScene::renderItemsWithNegativeWidthOrHeight() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("Test only works on platforms with resizable windows"); #endif QGraphicsScene scene(0, 0, m_testSize.width(), m_testSize.height()); @@ -2777,7 +2777,7 @@ protected: void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("Test fails on some Android devices (QTBUG-44430)"); #endif @@ -4058,12 +4058,11 @@ void tst_QGraphicsScene::polishItems2() void tst_QGraphicsScene::isActive() { - if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) - QSKIP("Window activation is not supported"); - -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QSKIP("Fails on Android (QTBUG-44430)"); #endif + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); QGraphicsScene scene1; QVERIFY(!scene1.isActive()); diff --git a/tests/auto/widgets/kernel/qlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qlayout/CMakeLists.txt index 0ee2ce145e..049fab0f02 100644 --- a/tests/auto/widgets/kernel/qlayout/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qlayout/CMakeLists.txt @@ -24,7 +24,7 @@ qt_internal_add_test(tst_qlayout ## Scopes: ##################################################################### -if(ANDROID AND NOT ANDROID_EMBEDDED) +if(ANDROID) # Resources: set(testdata_resource_files "baseline/smartmaxsize" diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp index deb473ab8c..5c5869c738 100644 --- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp +++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -355,7 +355,7 @@ void tst_QLayout::adjustSizeShouldMakeSureLayoutIsActivated() void tst_QLayout::testRetainSizeWhenHidden() { -#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) +#ifdef Q_OS_ANDROID QSKIP("Test does not work on platforms which default to showMaximized()"); #endif diff --git a/util/cmake/condition_simplifier.py b/util/cmake/condition_simplifier.py index e8fc0e40d2..ecef86af6a 100644 --- a/util/cmake/condition_simplifier.py +++ b/util/cmake/condition_simplifier.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ############################################################################# ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the plugins of the Qt Toolkit. @@ -108,7 +108,7 @@ def _recursive_simplify(expr): # windowses = ('WIN32', 'WINRT') apples = ("MACOS", "UIKIT", "IOS", "TVOS", "WATCHOS") bsds = ("FREEBSD", "OPENBSD", "NETBSD") - androids = ("ANDROID", "ANDROID_EMBEDDED") + androids = ("ANDROID",) unixes = ( "APPLE", *apples, @@ -140,7 +140,7 @@ def _recursive_simplify(expr): expr = _simplify_flavors_in_condition("APPLE", apples, expr) expr = _simplify_flavors_in_condition("BSD", bsds, expr) expr = _simplify_flavors_in_condition("UNIX", unixes, expr) - expr = _simplify_flavors_in_condition("ANDROID", ("ANDROID_EMBEDDED",), expr) + expr = _simplify_flavors_in_condition("ANDROID", (), expr) # Simplify families of OSes against other families: expr = _simplify_os_families(expr, ("WIN32", "WINRT"), unixes) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 34479b4626..6de3b44593 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2018 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the plugins of the Qt Toolkit. @@ -761,7 +761,6 @@ platform_mapping = { "hpux": "HPUX", "nacl": "NACL", "android": "ANDROID", - "android-embedded": "ANDROID_EMBEDDED", "uikit": "UIKIT", "tvos": "TVOS", "watchos": "WATCHOS", diff --git a/util/cmake/tests/data/standardpaths.pro b/util/cmake/tests/data/standardpaths.pro index 4b45788e4f..b9896b8e29 100644 --- a/util/cmake/tests/data/standardpaths.pro +++ b/util/cmake/tests/data/standardpaths.pro @@ -7,7 +7,7 @@ win32 { } else:unix { mac { OBJECTIVE_SOURCES += io/qstandardpaths_mac.mm - } else:android:!android-embedded { + } else:android { SOURCES += io/qstandardpaths_android.cpp } else:haiku { SOURCES += io/qstandardpaths_haiku.cpp diff --git a/util/cmake/tests/test_logic_mapping.py b/util/cmake/tests/test_logic_mapping.py index 6e4fd20590..b885b47707 100755 --- a/util/cmake/tests/test_logic_mapping.py +++ b/util/cmake/tests/test_logic_mapping.py @@ -182,5 +182,4 @@ def test_simplify_complex_false(): def test_simplify_android_not_apple(): - validate_simplify('ANDROID AND NOT ANDROID_EMBEDDED AND NOT MACOS', - 'ANDROID AND NOT ANDROID_EMBEDDED') + validate_simplify('ANDROID AND NOT MACOS', 'ANDROID') diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 9acee46007..898900674b 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -239,7 +239,7 @@ def test_realworld_standardpaths(): # android / else: (cond4, if_branch4, else_branch4) = evaluate_condition(else_branch3[0]) - assert cond4 == 'android && !android-embedded' + assert cond4 == 'android' assert len(if_branch4) == 1 validate_op('SOURCES', '+=', ['io/qstandardpaths_android.cpp'], if_branch4[0]) assert len(else_branch4) == 1 diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 51e569fb09..996c247cfb 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ############################################################################# ## -## Copyright (C) 2018 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the plugins of the Qt Toolkit. @@ -306,12 +306,10 @@ def test_qstandardpaths_scopes(): # mac { # OBJECTIVE_SOURCES += io/qstandardpaths_mac.mm scope7 = _new_scope(parent_scope=scope6, condition='MACOS', SOURCES='qsp_mac.mm') - # } else:android:!android-embedded { + # } else:android { # SOURCES += io/qstandardpaths_android.cpp scope8 = _new_scope(parent_scope=scope6, condition='else') - scope9 = _new_scope(parent_scope=scope8, - condition='ANDROID AND NOT ANDROID_EMBEDDED', - SOURCES='qsp_android.cpp') + scope9 = _new_scope(parent_scope=scope8, condition='ANDROID', SOURCES='qsp_android.cpp') # } else:haiku { # SOURCES += io/qstandardpaths_haiku.cpp scope10 = _new_scope(parent_scope=scope8, condition='else') @@ -332,10 +330,10 @@ def test_qstandardpaths_scopes(): assert scope6.total_condition == 'UNIX' assert scope7.total_condition == 'MACOS' assert scope8.total_condition == 'UNIX AND NOT MACOS' - assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED' - assert scope10.total_condition == 'UNIX AND NOT MACOS AND (ANDROID_EMBEDDED OR NOT ANDROID)' - assert scope11.total_condition == 'HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' - assert scope12.total_condition == 'UNIX AND NOT MACOS AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope9.total_condition == 'ANDROID' + assert scope10.total_condition == 'UNIX AND NOT MACOS AND NOT ANDROID' + assert scope11.total_condition == 'HAIKU AND NOT ANDROID' + assert scope12.total_condition == 'UNIX AND NOT MACOS AND NOT HAIKU AND NOT ANDROID' def test_recursive_expansion(): scope = _new_scope(A='Foo',B='$$A/Bar')