diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-06 10:18:01 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-13 11:04:28 +0300 |
commit | 2d5f0ffaf1278516bbd74e3b60f9849f4c51cffa (patch) | |
tree | 6a0882c4007a933f40010b167a6abb1be62baca7 /tests/auto | |
parent | 5dfded3b43b3adfec411c036e5aac97d400f4613 (diff) |
3rdparty: deprecate usage of LZMA SDK
The 3rd-party sources haven't been updated in a long time, and
is missing some features compared to libarchive (which the
official IFW binaries use), like symbolic link support on Windows.
Add deprecation warning when compiling with LZMA SDK, and make
building the library and related client code conditional behind
a separate config feature.
Update docs to emphasize that libarchive is the recommended build
option for archive handler.
Change-Id: I70ed5f9b5d13e2243778f7c44b4ea833c8092ae0
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
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() |