summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/xml
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-11-24 10:36:10 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-01 09:12:52 +0100
commit3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef (patch)
treeb77bb527bf3a21dc95a317248b2640c73751f629 /tests/auto/corelib/xml
parent13eba9ddf47d570fc4562c20fcfbacd1dfa4a61a (diff)
Fixed installation of corelib tests
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and replaced them with TESTDATA where appropriate. In .cpp files, removed SRCDIR and relative paths to testdata and replaced them with the QFINDTESTDATA macro where appropriate. Modified test helper apps/libs to install themselves under the test they relate to. This change allows corelib tests to be correctly installed, along with their testdata, via `make install'. Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/xml')
-rw-r--r--tests/auto/corelib/xml/qxmlstream/qxmlstream.pro9
-rw-r--r--tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp10
2 files changed, 6 insertions, 13 deletions
diff --git a/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro b/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro
index f2534ca82d..0a739f0a0e 100644
--- a/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro
+++ b/tests/auto/corelib/xml/qxmlstream/qxmlstream.pro
@@ -3,11 +3,4 @@ TARGET = tst_qxmlstream
QT = core xml network testlib
SOURCES = tst_qxmlstream.cpp
-wince* {
- addFiles.files = data XML-Test-Suite
- addFiles.path = .
- DEPLOYMENT += addFiles
- DEFINES += SRCDIR=\\\"\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+TESTDATA += data XML-Test-Suite
diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
index aeca42608f..1040a3ef87 100644
--- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
@@ -57,7 +57,7 @@
Q_DECLARE_METATYPE(QXmlStreamReader::ReadElementTextBehaviour)
-static const char *const catalogFile = SRCDIR "XML-Test-Suite/xmlconf/finalCatalog.xml";
+static const char *const catalogFile = "XML-Test-Suite/xmlconf/finalCatalog.xml";
static const int expectedRunCount = 1646;
static const int expectedSkipCount = 532;
@@ -529,7 +529,7 @@ class tst_QXmlStream: public QObject
{
Q_OBJECT
public:
- tst_QXmlStream() : m_handler(QUrl::fromLocalFile(QLatin1String(catalogFile)))
+ tst_QXmlStream() : m_handler(QUrl::fromLocalFile(QFINDTESTDATA(catalogFile)))
{
}
@@ -581,7 +581,7 @@ private:
void tst_QXmlStream::initTestCase()
{
- QFile file(QString::fromLatin1(catalogFile));
+ QFile file(QFINDTESTDATA(catalogFile));
QVERIFY2(file.open(QIODevice::ReadOnly),
qPrintable(QString::fromLatin1("Failed to open the test suite catalog; %1").arg(file.fileName())));
@@ -807,7 +807,7 @@ void tst_QXmlStream::testReader_data() const
QTest::addColumn<QString>("xml");
QTest::addColumn<QString>("ref");
QDir dir;
- dir.cd(SRCDIR "data/");
+ dir.cd(QFINDTESTDATA("data/"));
foreach(QString filename , dir.entryList(QStringList() << "*.xml")) {
QString reference = QFileInfo(filename).baseName() + ".ref";
QTest::newRow(dir.filePath(filename).toLatin1().data()) << dir.filePath(filename) << dir.filePath(reference);
@@ -1120,7 +1120,7 @@ void tst_QXmlStream::crashInUTF16Codec() const
QEventLoop eventLoop;
QNetworkAccessManager networkManager;
- QNetworkRequest request(QUrl::fromLocalFile(QLatin1String(SRCDIR "data/051reduced.xml")));
+ QNetworkRequest request(QUrl::fromLocalFile(QFINDTESTDATA("data/051reduced.xml")));
QNetworkReply *const reply = networkManager.get(request);
eventLoop.connect(reply, SIGNAL(finished()), SLOT(quit()));