diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-02 09:28:28 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-02 09:28:28 +0000 |
| commit | 37da09eeb4ac168217a0d05ae40adfd8c0f35e64 (patch) | |
| tree | b0893dc04fa317463c6f48a2a3744ce3623f1776 /tests | |
| parent | 8324556cfa55a0cc15ac19165dc48a1492aa43d0 (diff) | |
| download | qxmpp-37da09eeb4ac168217a0d05ae40adfd8c0f35e64.tar.gz | |
load test files from resources so the tests can be run from any path
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tests.cpp | 3 | ||||
| -rw-r--r-- | tests/tests.pro | 2 | ||||
| -rw-r--r-- | tests/tests.qrc | 11 |
3 files changed, 14 insertions, 2 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp index 69f0cd2a..4ad3fc59 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -109,7 +109,8 @@ void TestUtils::testJid() static void testMimeType(const QString &fileName, const QString fileType) { - QFile file(fileName); + // load file from resources + QFile file(":/" + fileName); QCOMPARE(file.open(QIODevice::ReadOnly), true); QCOMPARE(getImageType(file.readAll()), fileType); file.close(); diff --git a/tests/tests.pro b/tests/tests.pro index 1ce95d39..2848c2ed 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -4,8 +4,8 @@ QT += network xml testlib TARGET = tests +RESOURCES += tests.qrc SOURCES += tests.cpp - HEADERS += tests.h INCLUDEPATH += $$QXMPP_INCLUDE_DIR diff --git a/tests/tests.qrc b/tests/tests.qrc new file mode 100644 index 00000000..6bc9605e --- /dev/null +++ b/tests/tests.qrc @@ -0,0 +1,11 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>test.bmp</file> + <file>test.gif</file> + <file>test.jpg</file> + <file>test.mng</file> + <file>test.png</file> + <file>test.svg</file> + <file>test.xpm</file> +</qresource> +</RCC> |
