diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-12-18 14:16:16 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-12-22 09:27:44 +0100 |
commit | ae55d3ea27f1007c7b46f655a64ff64fab9e83a5 (patch) | |
tree | a097f8c678dae87f864705aef86b3e3ce4d6d0ae /tests/auto | |
parent | e511d9b9dddcf4390939a36be12e9c7d6365b0e7 (diff) |
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>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/io/qiodevice/android_testdata.qrc | 5 | ||||
-rw-r--r-- | tests/auto/corelib/io/qiodevice/qiodevice.pro | 5 | ||||
-rw-r--r-- | tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qiodevice/android_testdata.qrc b/tests/auto/corelib/io/qiodevice/android_testdata.qrc new file mode 100644 index 0000000000..fa4b3d11da --- /dev/null +++ b/tests/auto/corelib/io/qiodevice/android_testdata.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>tst_qiodevice.cpp</file> + </qresource> +</RCC> diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro index 9103ff2152..9fd70fb177 100644 --- a/tests/auto/corelib/io/qiodevice/qiodevice.pro +++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro @@ -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 +} diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index dec440a6d5..d94893c767 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -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 |