From 2a893db48017a850044156442b93d935c78e941d Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Wed, 23 Mar 2022 13:59:30 +0100 Subject: Android: enable tst_QLocale Do not try to properly specify a path to an external syslocale app, because the related test can't be executed on Android anyway. This fixes a failure in initTestCase() and allows to unblock other test-cases. Also skip systemLocale() test, because Android platform plugin already creates a custom QSystemLocale instance, so a hack with MySystemLocale does not work. As a drive-by: simplify the #ifery in initTestCase() and remove an unused second parameter of QSKIP() in emptyCtor_data(). Fixes: QTBUG-87414 Pick-to: 6.3 6.2 Change-Id: Iefc587062362469856fdca77f9ec9d96f5552e45 Reviewed-by: Assam Boudjelthia --- tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tests/auto/corelib/text') diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 7b9934dec1..bf2b9c210a 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -189,19 +189,19 @@ tst_QLocale::tst_QLocale() void tst_QLocale::initTestCase() { -#if QT_CONFIG(process) -# ifdef Q_OS_ANDROID - m_sysapp = QCoreApplication::applicationDirPath() + "/libsyslocaleapp.so"; -# else // !defined(Q_OS_ANDROID) +#ifdef Q_OS_ANDROID + // We can't start a QProcess on Android, and we anyway skip the test + // that uses m_sysapp. So no need to initialize it properly. + return; +#elif QT_CONFIG(process) const QString syslocaleapp_dir = QFINDTESTDATA("syslocaleapp"); QVERIFY2(!syslocaleapp_dir.isEmpty(), qPrintable(QStringLiteral("Cannot find 'syslocaleapp' starting from ") + QDir::toNativeSeparators(QDir::currentPath()))); m_sysapp = syslocaleapp_dir + QStringLiteral("/syslocaleapp"); -# ifdef Q_OS_WIN +#ifdef Q_OS_WIN m_sysapp += QStringLiteral(".exe"); -# endif -# endif // Q_OS_ANDROID +#endif const QFileInfo fi(m_sysapp); QVERIFY2(fi.exists() && fi.isExecutable(), qPrintable(QDir::toNativeSeparators(m_sysapp) @@ -558,10 +558,10 @@ static inline bool runSysAppTest(const QString &binary, void tst_QLocale::emptyCtor_data() { #if !QT_CONFIG(process) - QSKIP("No qprocess support", SkipAll); + QSKIP("No qprocess support"); #endif #ifdef Q_OS_ANDROID - QSKIP("This test crashes on Android"); + QSKIP("Can't start QProcess to run a custom user binary on Android"); #endif QTest::addColumn("expected"); @@ -3185,6 +3185,9 @@ private: void tst_QLocale::systemLocale_data() { +#ifdef Q_OS_ANDROID + QSKIP("Android already has a QSystemLocale installed, we can't override it"); +#endif // Test uses MySystemLocale, so is platform-independent. QTest::addColumn("name"); QTest::addColumn("language"); -- cgit v1.2.3