summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-03-23 13:59:30 +0100
committerIvan Solovev <ivan.solovev@qt.io>2022-03-29 13:56:14 +0100
commit2a893db48017a850044156442b93d935c78e941d (patch)
treed5f460e7b7d7f64e12b30783f908f3d3644dd8d2 /tests/auto/corelib/text
parent939a8281e66226cfdd175e03cd92818639d31765 (diff)
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 <assam.boudjelthia@qt.io>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp21
1 files changed, 12 insertions, 9 deletions
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<QString>("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<QString>("name");
QTest::addColumn<QLocale::Language>("language");