Blame SOURCES/qttools-fix-data-files-path-for-tests.patch

95aa25
diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
95aa25
index 63ee55c..09dfa2e 100644
95aa25
--- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
95aa25
+++ b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
95aa25
@@ -84,12 +84,12 @@ private:
95aa25
 void tst_QHelpContentModel::init()
95aa25
 {
95aa25
     // defined in profile
95aa25
-    QString path = QLatin1String(SRCDIR);
95aa25
+    QString path = QFINDTESTDATA("data/");
95aa25
 
95aa25
-    m_colFile = path + QLatin1String("/data/col.qhc");
95aa25
+    m_colFile = path + QLatin1String("col.qhc");
95aa25
     if (QFile::exists(m_colFile))
95aa25
         QDir::current().remove(m_colFile);
95aa25
-    if (!QFile::copy(path + "/data/collection.qhc", m_colFile))
95aa25
+    if (!QFile::copy(path + "collection.qhc", m_colFile))
95aa25
         QFAIL("Cannot copy file!");
95aa25
     QFile f(m_colFile);
95aa25
     f.setPermissions(QFile::WriteUser|QFile::ReadUser);
95aa25
diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
95aa25
index 4793250..2398e83 100644
95aa25
--- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
95aa25
+++ b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
95aa25
@@ -81,14 +81,14 @@ private:
95aa25
 void tst_QHelpEngineCore::init()
95aa25
 {
95aa25
     // defined in profile
95aa25
-    m_path = QLatin1String(SRCDIR);
95aa25
+    m_path = QFINDTESTDATA("data/");
95aa25
 
95aa25
     m_path = QFileInfo(m_path).absoluteFilePath();
95aa25
 
95aa25
-    m_colFile = m_path + QLatin1String("/data/col.qhc");
95aa25
+    m_colFile = m_path + QLatin1String("col.qhc");
95aa25
     if (QFile::exists(m_colFile))
95aa25
         QDir::current().remove(m_colFile);
95aa25
-    if (!QFile::copy(m_path + "/data/collection.qhc", m_colFile))
95aa25
+    if (!QFile::copy(m_path + "collection.qhc", m_colFile))
95aa25
         QFAIL("Cannot copy file!");
95aa25
     QFile f(m_colFile);
95aa25
     f.setPermissions(QFile::WriteUser|QFile::ReadUser);
95aa25
@@ -111,7 +111,7 @@ void tst_QHelpEngineCore::setCollectionFile()
95aa25
     QHelpEngineCore help(m_colFile, 0);
95aa25
     QCOMPARE(help.collectionFile(), QFileInfo(m_colFile).absoluteFilePath());
95aa25
 
95aa25
-    QString col1File = m_path + QLatin1String("/data/collection1.qhc");
95aa25
+    QString col1File = m_path + QLatin1String("collection1.qhc");
95aa25
     help.setCollectionFile(col1File);
95aa25
     QCOMPARE(help.collectionFile(), QFileInfo(col1File).absoluteFilePath());
95aa25
 
95aa25
@@ -125,7 +125,7 @@ void tst_QHelpEngineCore::copyCollectionFile()
95aa25
     QHelpEngineCore help(m_colFile, 0);
95aa25
     QCOMPARE(help.collectionFile(), QFileInfo(m_colFile).absoluteFilePath());
95aa25
 
95aa25
-    QString copiedFile = m_path + QLatin1String("/collectionCopy.qhc");
95aa25
+    QString copiedFile = m_path + QLatin1String("collectionCopy.qhc");
95aa25
     if (QFile::exists(copiedFile))
95aa25
         QDir::current().remove(copiedFile);
95aa25
 
95aa25
@@ -165,7 +165,7 @@ void tst_QHelpEngineCore::copyCollectionFile()
95aa25
         while (m_query->next()) {
95aa25
             if (i == 0) {
95aa25
                 QCOMPARE(m_query->value(0).toString(), QString("trolltech.com.3-3-8.qmake"));
95aa25
-                QCOMPARE(m_query->value(1).toString(), QString("data/qmake-3.3.8.qch"));
95aa25
+                QCOMPARE(m_query->value(1).toString(), QString("qmake-3.3.8.qch"));
95aa25
             }
95aa25
             ++i;
95aa25
         }
95aa25
@@ -179,9 +179,9 @@ void tst_QHelpEngineCore::copyCollectionFile()
95aa25
 
95aa25
 void tst_QHelpEngineCore::namespaceName()
95aa25
 {
95aa25
-    QCOMPARE(QHelpEngineCore::namespaceName(m_path + "/data/qmake-3.3.8.qch"),
95aa25
+    QCOMPARE(QHelpEngineCore::namespaceName(m_path + "qmake-3.3.8.qch"),
95aa25
         QString("trolltech.com.3-3-8.qmake"));
95aa25
-    QCOMPARE(QHelpEngineCore::namespaceName(m_path + "/data/linguist-3.3.8.qch"),
95aa25
+    QCOMPARE(QHelpEngineCore::namespaceName(m_path + "linguist-3.3.8.qch"),
95aa25
         QString("trolltech.com.3-3-8.linguist"));
95aa25
 }
95aa25
 
95aa25
@@ -206,11 +206,11 @@ void tst_QHelpEngineCore::registerDocumentation()
95aa25
     {
95aa25
         QHelpEngineCore c(m_colFile);
95aa25
         QCOMPARE(c.setupData(), true);
95aa25
-        c.registerDocumentation(m_path + "/data/qmake-3.3.8.qch");
95aa25
+        c.registerDocumentation(m_path + "qmake-3.3.8.qch");
95aa25
         QCOMPARE(c.registeredDocumentations().count(), 1);
95aa25
-        c.registerDocumentation(m_path + "/data/qmake-3.3.8.qch");
95aa25
+        c.registerDocumentation(m_path + "qmake-3.3.8.qch");
95aa25
         QCOMPARE(c.registeredDocumentations().count(), 1);
95aa25
-        c.registerDocumentation(m_path + "/data/linguist-3.3.8.qch");
95aa25
+        c.registerDocumentation(m_path + "linguist-3.3.8.qch");
95aa25
         QCOMPARE(c.registeredDocumentations().count(), 2);
95aa25
     }
95aa25
 
95aa25
@@ -248,9 +248,9 @@ void tst_QHelpEngineCore::documentationFileName()
95aa25
     QHelpEngineCore c(m_colFile);
95aa25
     QCOMPARE(c.setupData(), true);
95aa25
     QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.3-3-8.qmake")),
95aa25
-        QString(m_path + "/data/qmake-3.3.8.qch"));
95aa25
+        QString(m_path + "qmake-3.3.8.qch"));
95aa25
     QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.1-0-0.test")),
95aa25
-        QString(m_path + "/data/test.qch"));
95aa25
+        QString(m_path + "test.qch"));
95aa25
     QCOMPARE(c.documentationFileName(QLatin1String("trolltech.com.empty")),
95aa25
         QString());
95aa25
 }
95aa25
@@ -367,7 +367,7 @@ void tst_QHelpEngineCore::fileData()
95aa25
     QCOMPARE(ba.size(), 0);
95aa25
     ba = help.fileData(QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html"));
95aa25
     QTextStream s(ba, QIODevice::ReadOnly|QIODevice::Text);
95aa25
-    QFile f(m_path + "/data/test.html");
95aa25
+    QFile f(m_path + "test.html");
95aa25
     if (!f.open(QIODevice::ReadOnly|QIODevice::Text))
95aa25
         QFAIL("Cannot open original file!");
95aa25
     QTextStream ts(&f);
95aa25
@@ -433,9 +433,9 @@ void tst_QHelpEngineCore::setAutoSaveFilter()
95aa25
 
95aa25
 void tst_QHelpEngineCore::metaData()
95aa25
 {
95aa25
-    QCOMPARE(QHelpEngineCore::metaData(m_path + "/data/test.qch", "author").toString(),
95aa25
+    QCOMPARE(QHelpEngineCore::metaData(m_path + "test.qch", "author").toString(),
95aa25
         QString("Digia Plc and/or its subsidiary(-ies)"));
95aa25
-    QCOMPARE(QHelpEngineCore::metaData(m_path + "/data/test.qch", "notExisting").isValid(),
95aa25
+    QCOMPARE(QHelpEngineCore::metaData(m_path + "test.qch", "notExisting").isValid(),
95aa25
         false);
95aa25
 }
95aa25
 
95aa25
diff --git a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
95aa25
index 10cfff9..fdb3b93 100644
95aa25
--- a/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
95aa25
+++ b/tests/auto/qhelpgenerator/tst_qhelpgenerator.cpp
95aa25
@@ -57,8 +57,8 @@ private:
95aa25
 
95aa25
 void tst_QHelpGenerator::initTestCase()
95aa25
 {
95aa25
-    QString path = QLatin1String(SRCDIR);
95aa25
-    m_outputFile = path + QLatin1String("/data/test.qch");
95aa25
+    QString path = QFINDTESTDATA("data/");
95aa25
+    m_outputFile = path + QLatin1String("test.qch");
95aa25
     if (QFile::exists(m_outputFile)) {
95aa25
         QDir d;
95aa25
         if (!d.remove(m_outputFile))
95aa25
@@ -69,9 +69,9 @@ void tst_QHelpGenerator::initTestCase()
95aa25
 void tst_QHelpGenerator::generateHelp()
95aa25
 {
95aa25
     // defined in profile
95aa25
-    QString path = QLatin1String(SRCDIR);
95aa25
+    QString path = QFINDTESTDATA("data/");
95aa25
 
95aa25
-    QString inputFile(path + "/data/test.qhp");
95aa25
+    QString inputFile(path + "test.qhp");
95aa25
     QHelpProjectData data;
95aa25
     if (!data.readData(inputFile))
95aa25
         QFAIL("Cannot read qthp file!");
95aa25
@@ -194,17 +194,17 @@ void tst_QHelpGenerator::checkMetaData()
95aa25
 void tst_QHelpGenerator::generateTwice()
95aa25
 {
95aa25
     // defined in profile
95aa25
-    QString path = QLatin1String(SRCDIR);
95aa25
+    QString path = QFINDTESTDATA("data/");
95aa25
 
95aa25
-    QString inputFile(path + "/data/test.qhp");
95aa25
+    QString inputFile(path + "test.qhp");
95aa25
     QHelpProjectData data;
95aa25
     if (!data.readData(inputFile))
95aa25
         QFAIL("Cannot read qhp file!");
95aa25
 
95aa25
     QHelpGenerator generator1;
95aa25
     QHelpGenerator generator2;
95aa25
-    QString outputFile1 = path + QLatin1String("/data/test1.qch");
95aa25
-    QString outputFile2 = path + QLatin1String("/data/test2.qch");
95aa25
+    QString outputFile1 = path + QLatin1String("test1.qch");
95aa25
+    QString outputFile2 = path + QLatin1String("test2.qch");
95aa25
     QCOMPARE(generator1.generate(&data, outputFile1), true);
95aa25
     QCOMPARE(generator2.generate(&data, outputFile2), true);
95aa25
 
95aa25
diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
95aa25
index 494355c..4e1c015 100644
95aa25
--- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
95aa25
+++ b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
95aa25
@@ -84,12 +84,12 @@ private:
95aa25
 
95aa25
 void tst_QHelpIndexModel::init()
95aa25
 {
95aa25
-    QString path = QLatin1String(SRCDIR);
95aa25
+    QString path = QFINDTESTDATA("data/");
95aa25
 
95aa25
-    m_colFile = path + QLatin1String("/data/col.qhc");
95aa25
+    m_colFile = path + QLatin1String("col.qhc");
95aa25
     if (QFile::exists(m_colFile))
95aa25
         QDir::current().remove(m_colFile);
95aa25
-    if (!QFile::copy(path + "/data/collection.qhc", m_colFile))
95aa25
+    if (!QFile::copy(path + "collection.qhc", m_colFile))
95aa25
         QFAIL("Cannot copy file!");
95aa25
     QFile f(m_colFile);
95aa25
     f.setPermissions(QFile::WriteUser|QFile::ReadUser);
95aa25
diff --git a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.cpp b/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.cpp
95aa25
index 3686416..bb507fa 100644
95aa25
--- a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.cpp
95aa25
+++ b/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.cpp
95aa25
@@ -52,8 +52,8 @@ private:
95aa25
 
95aa25
 void tst_QHelpProjectData::initTestCase()
95aa25
 {
95aa25
-    const QString path = QLatin1String(SRCDIR);
95aa25
-    m_inputFile = path + QLatin1String("/data/test.qhp");
95aa25
+    const QString path = QFINDTESTDATA("data/");
95aa25
+    m_inputFile = path + QLatin1String("test.qhp");
95aa25
 }
95aa25
 
95aa25
 void tst_QHelpProjectData::readData()