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

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