Android: Fix QIODevice tests

Test requires that tst_qiodevice.cpp is available on file system,
but since we're not able to deploy directly to the file system
on Android and since we want to actually test file system access,
we bundle it in qrc and copy it out during initialization.

Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62
Reviewed-by: BogDan Vatra <bogdan@kde.org>
bb10
Eskil Abrahamsen Blomfeldt 2014-12-18 14:16:16 +01:00
parent e511d9b9dd
commit ae55d3ea27
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>tst_qiodevice.cpp</file>
</qresource>
</RCC>

View File

@ -6,3 +6,8 @@ SOURCES = tst_qiodevice.cpp
TESTDATA += tst_qiodevice.cpp
MOC_DIR=tmp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
android:!android-no-sdk: {
RESOURCES += \
android_testdata.qrc
}

View File

@ -62,6 +62,10 @@ private slots:
void tst_QIODevice::initTestCase()
{
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
QVERIFY(QFileInfo(QStringLiteral("./tst_qiodevice.cpp")).exists()
|| QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp")));
#endif
}
// Testing get/set functions