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
parent
e511d9b9dd
commit
ae55d3ea27
|
|
@ -0,0 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>tst_qiodevice.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue