diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-11-23 08:58:46 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-12-06 08:37:19 (GMT) |
commit | 1ba320366e1b010ecf32c263574e183e4b1f452d (patch) | |
tree | 87976c9795ef0324f46022a6bc66d5071ef4c6cc /tests | |
parent | d3dc2ab3e0ee6bca8eca374e3cb3b3f4c7d0c34e (diff) | |
download | Qt-1ba320366e1b010ecf32c263574e183e4b1f452d.zip Qt-1ba320366e1b010ecf32c263574e183e4b1f452d.tar.gz Qt-1ba320366e1b010ecf32c263574e183e4b1f452d.tar.bz2 |
Move test data to a qrc file.
Using qrc file simplify deployment on a device.
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 8 | ||||
-rw-r--r-- | tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc | 5 | ||||
-rw-r--r-- | tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 12 | ||||
-rw-r--r-- | tests/benchmarks/script/sunspider/sunspider.pro | 10 | ||||
-rw-r--r-- | tests/benchmarks/script/sunspider/sunspider.qrc | 5 | ||||
-rw-r--r-- | tests/benchmarks/script/sunspider/tst_sunspider.cpp | 9 | ||||
-rw-r--r-- | tests/benchmarks/script/v8/tst_v8.cpp | 9 | ||||
-rw-r--r-- | tests/benchmarks/script/v8/v8.pro | 10 | ||||
-rw-r--r-- | tests/benchmarks/script/v8/v8.qrc | 5 |
9 files changed, 25 insertions, 48 deletions
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 5d8e5af4..00e2e01 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -1,10 +1,4 @@ load(qttest_p4) QT = core script SOURCES += tst_qscriptv8testsuite.cpp -!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" - -wince*|symbian: { -testFiles.files = tests -testFiles.path = . -DEPLOYMENT += testFiles -} +RESOURCES += qscriptv8testsuite.qrc diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc new file mode 100644 index 0000000..a894ee5 --- /dev/null +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>tests</file> +</qresource> +</RCC> diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 5f9a578..912027e 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -45,10 +45,6 @@ #include <QtScript> -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - //TESTED_CLASS= //TESTED_FILES= @@ -217,9 +213,8 @@ int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a) tst_Suite::tst_Suite() { - testsDir = QDir(SRCDIR); - bool testsFound = testsDir.cd("tests"); - if (!testsFound) { + testsDir = QDir(":/tests"); + if (!testsDir.exists()) { qWarning("*** no tests/ dir!"); } else { if (!testsDir.exists("mjsunit.js")) @@ -297,8 +292,7 @@ tst_Suite::tst_Suite() appendCString(stringdata, ""); QFileInfoList testFileInfos; - if (testsFound) - testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files); + testFileInfos = testsDir.entryInfoList(QStringList() << "*.js", QDir::Files); foreach (QFileInfo tfi, testFileInfos) { QString name = tfi.baseName(); // slot: signature, parameters, type, tag, flags diff --git a/tests/benchmarks/script/sunspider/sunspider.pro b/tests/benchmarks/script/sunspider/sunspider.pro index aab4cdb..dce3855 100644 --- a/tests/benchmarks/script/sunspider/sunspider.pro +++ b/tests/benchmarks/script/sunspider/sunspider.pro @@ -1,19 +1,11 @@ load(qttest_p4) TEMPLATE = app TARGET = tst_bench_sunspider - +RESOURCES += sunspider.qrc SOURCES += tst_sunspider.cpp QT = core script -!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" - -wince*|symbian: { -testFiles.files = tests -testFiles.path = . -DEPLOYMENT += testFiles -} - symbian* { TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB TARGET.EPOCSTACKSIZE = 0x14000 diff --git a/tests/benchmarks/script/sunspider/sunspider.qrc b/tests/benchmarks/script/sunspider/sunspider.qrc new file mode 100644 index 0000000..a894ee5 --- /dev/null +++ b/tests/benchmarks/script/sunspider/sunspider.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>tests</file> +</qresource> +</RCC> diff --git a/tests/benchmarks/script/sunspider/tst_sunspider.cpp b/tests/benchmarks/script/sunspider/tst_sunspider.cpp index 7a8617a..0df19b6 100644 --- a/tests/benchmarks/script/sunspider/tst_sunspider.cpp +++ b/tests/benchmarks/script/sunspider/tst_sunspider.cpp @@ -46,10 +46,6 @@ #include <QtScript/qscriptengine.h> #include <QtScript/qscriptvalue.h> -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - //TESTED_FILES= static QString readFile(const QString &filename) @@ -84,9 +80,8 @@ private: tst_SunSpider::tst_SunSpider() { - testsDir = QDir(SRCDIR); - bool testsFound = testsDir.cd("tests"); - if (!testsFound) + testsDir = QDir(":/tests"); + if (!testsDir.exists()) qWarning("*** no tests/ dir!"); } diff --git a/tests/benchmarks/script/v8/tst_v8.cpp b/tests/benchmarks/script/v8/tst_v8.cpp index f8297e2..841e2f3 100644 --- a/tests/benchmarks/script/v8/tst_v8.cpp +++ b/tests/benchmarks/script/v8/tst_v8.cpp @@ -46,10 +46,6 @@ #include <QtScript/qscriptengine.h> #include <QtScript/qscriptvalue.h> -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - //TESTED_FILES= static QString readFile(const QString &filename) @@ -84,9 +80,8 @@ private: tst_V8::tst_V8() { - testsDir = QDir(SRCDIR); - bool testsFound = testsDir.cd("tests"); - if (!testsFound) + testsDir = QDir(":/tests"); + if (!testsDir.exists()) qWarning("*** no tests/ dir!"); } diff --git a/tests/benchmarks/script/v8/v8.pro b/tests/benchmarks/script/v8/v8.pro index f36bda5..547eecc 100644 --- a/tests/benchmarks/script/v8/v8.pro +++ b/tests/benchmarks/script/v8/v8.pro @@ -1,19 +1,11 @@ load(qttest_p4) TEMPLATE = app TARGET = tst_bench_v8 - +RESOURCES += v8.qrc SOURCES += tst_v8.cpp QT = core script -!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" - -wince*|symbian: { -testFiles.files = tests -testFiles.path = . -DEPLOYMENT += testFiles -} - symbian* { TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB TARGET.EPOCSTACKSIZE = 0x14000 diff --git a/tests/benchmarks/script/v8/v8.qrc b/tests/benchmarks/script/v8/v8.qrc new file mode 100644 index 0000000..a894ee5 --- /dev/null +++ b/tests/benchmarks/script/v8/v8.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>tests</file> +</qresource> +</RCC> |