diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/installer/archivefactory/tst_archivefactory.cpp | 2 | ||||
-rw-r--r-- | tests/auto/installer/installer.pro | 5 | ||||
-rw-r--r-- | tests/auto/tools/repotest/tst_repotest.cpp | 14 |
3 files changed, 15 insertions, 6 deletions
diff --git a/tests/auto/installer/archivefactory/tst_archivefactory.cpp b/tests/auto/installer/archivefactory/tst_archivefactory.cpp index a00f8c815..0c1a7b6f6 100644 --- a/tests/auto/installer/archivefactory/tst_archivefactory.cpp +++ b/tests/auto/installer/archivefactory/tst_archivefactory.cpp @@ -91,7 +91,7 @@ private slots: QTest::newRow("LibArchive") << "LibArchive" << "myfile.zip" << (QStringList() << "tar" << "tar.gz" << "tar.bz2" << "tar.xz" << "zip" << "7z" << "qbsp"); -#else +#elif defined(IFW_LIB7Z) QTest::newRow("Lib7z") << "Lib7z" << "myfile.7z" << (QStringList() << "7z" << "qbsp"); #endif diff --git a/tests/auto/installer/installer.pro b/tests/auto/installer/installer.pro index 947dc92a2..eb5fa6d2e 100644 --- a/tests/auto/installer/installer.pro +++ b/tests/auto/installer/installer.pro @@ -10,7 +10,6 @@ SUBDIRS += \ fakestopprocessforupdateoperation \ messageboxhandler \ extractarchiveoperationtest \ - lib7zarchive \ fileutils \ unicodeexecutable \ scriptengine \ @@ -48,6 +47,10 @@ CONFIG(libarchive) { SUBDIRS += libarchivearchive } +CONFIG(lzmasdk) { + SUBDIRS += lib7zarchive +} + win32 { SUBDIRS += registerfiletypeoperation \ createshortcutoperation diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp index f27acfe89..af48ba3fc 100644 --- a/tests/auto/tools/repotest/tst_repotest.cpp +++ b/tests/auto/tools/repotest/tst_repotest.cpp @@ -30,8 +30,11 @@ #include <repositorygen.h> #include <repositorygen.cpp> #include <init.h> +#include <archivefactory.h> + +#ifdef IFW_LIB7Z #include <lib7z_facade.h> -#include <lib7zarchive.h> +#endif #include <QFile> #include <QTest> @@ -94,12 +97,13 @@ private: QString existingUniteMeta7z = QInstallerTools::existingUniteMeta7z(m_repoInfo.repositoryDir); QCOMPARE(2, matches.count()); QCOMPARE(existingUniteMeta7z, matches.at(1)); - Lib7zArchive file(m_repoInfo.repositoryDir + QDir::separator() + matches.at(1)); - QVERIFY(file.open(QIODevice::ReadOnly)); + QScopedPointer<AbstractArchive> file(ArchiveFactory::instance() + .create(m_repoInfo.repositoryDir + QDir::separator() + matches.at(1))); + QVERIFY(file->open(QIODevice::ReadOnly)); //We have script<version>.qs for package A in the unite metadata QVector<ArchiveEntry>::const_iterator fileIt; - const QVector<ArchiveEntry> files = file.list(); + const QVector<ArchiveEntry> files = file->list(); for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) { if (fileIt->isDirectory) continue; @@ -288,7 +292,9 @@ private slots: void initTestCase() { +#ifdef IFW_LIB7Z Lib7z::initSevenZ(); +#endif } void testWithComponentMeta() |