diff --git a/tests/auto/widgets/kernel/qapplication/CMakeLists.txt b/tests/auto/widgets/kernel/qapplication/CMakeLists.txt index b9d0ce3c67e..717daf4bcd2 100644 --- a/tests/auto/widgets/kernel/qapplication/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qapplication/CMakeLists.txt @@ -21,6 +21,9 @@ qt_internal_add_executable(apphelper_widgets Qt::Widgets ) set_target_properties(apphelper_widgets PROPERTIES OUTPUT_NAME apphelper) +set_target_properties(tst_qapplication PROPERTIES + QT_ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_BINARY_DIR}/libmodal_helper_${ANDROID_ABI}.so +) if(QT_FEATURE_library) qt_internal_add_cmake_library(apphelper_widgets_plugin diff --git a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST index 3a454dfa03e..b725839047d 100644 --- a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST +++ b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST @@ -13,5 +13,5 @@ android android [wheelEventPropagation] android -[qtbug_12673] +[modalDialog] android diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 056d47e1d7d..f75f0daeddc 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -48,6 +48,7 @@ #include #include "../../../corelib/kernel/qcoreapplication/apphelper.h" +#include "../../../../../shared/androidutils.h" #include @@ -132,7 +133,7 @@ private slots: void wheelEventPropagation_data(); void wheelEventPropagation(); - void qtbug_12673(); + void modalDialog(); void qtbug_103611(); void noQuitOnHide(); @@ -2434,12 +2435,24 @@ void tst_QApplication::wheelEventPropagation() } } -void tst_QApplication::qtbug_12673() +QString modalHelperPath() +{ +#ifdef Q_OS_ANDROID + int argc = 1; + QApplication app(argc, &argv0); + return app.applicationDirPath() + QString("/libmodal_helper_%1.so").arg(androidAbi()); +#else + return "./modal_helper"; +#endif +} + +// QTBUG-133037, QTBUG-12673 +void tst_QApplication::modalDialog() { #if QT_CONFIG(process) QProcess testProcess; QStringList arguments; - testProcess.start("./modal_helper", arguments); + testProcess.start(modalHelperPath(), arguments); QVERIFY2(testProcess.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start 'modal_helper': %1").arg(testProcess.errorString()))); QVERIFY(testProcess.waitForFinished(20000)); diff --git a/tests/shared/androidutils.h b/tests/shared/androidutils.h new file mode 100644 index 00000000000..48deb6fc0f0 --- /dev/null +++ b/tests/shared/androidutils.h @@ -0,0 +1,18 @@ +// Copyright (C) 2025 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include + +inline QString androidAbi() +{ +#if defined(__aarch64__) + return "arm64-v8a"; +#elif defined(__arm__) + return "armeabi-v7a"; +#elif defined(__i386__) + return "x86"; +#elif defined(__x86_64__) + return "x86_64"; +#endif +} +