summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-11-02 12:10:33 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-11-26 07:22:38 +0000
commit2ce1d0963f0c1b4139709802a82df30e2975d199 (patch)
treea9e87f08516b6cdba3a3ee63b9329214e6474270 /tests
parent61fc55b5b650663a048f0bb692e0f02b545beb6b (diff)
Add Extract operation tests for new archive formats
Change-Id: I63f80301f452d3d83384fb2c7b3039b43b9d61fe Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data.qrc4
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content1.tar.gzbin0 -> 105 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content2.tar.bz2bin0 -> 125 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content3.tar.xzbin0 -> 152 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content4.zipbin0 -> 202 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/Updates.xml18
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp12
7 files changed, 33 insertions, 1 deletions
diff --git a/tests/auto/installer/extractarchiveoperationtest/data.qrc b/tests/auto/installer/extractarchiveoperationtest/data.qrc
index d6eb2cf92..974c0c6f7 100644
--- a/tests/auto/installer/extractarchiveoperationtest/data.qrc
+++ b/tests/auto/installer/extractarchiveoperationtest/data.qrc
@@ -4,6 +4,10 @@
<file>data/invalid.7z</file>
<file>data/xmloperationrepository/Updates.xml</file>
<file>data/xmloperationrepository/A/1.0.0content.7z</file>
+ <file>data/xmloperationrepository/A/1.0.0content1.tar.gz</file>
+ <file>data/xmloperationrepository/A/1.0.0content2.tar.bz2</file>
+ <file>data/xmloperationrepository/A/1.0.0content3.tar.xz</file>
+ <file>data/xmloperationrepository/A/1.0.0content4.zip</file>
<file>data/xmloperationrepository/A/1.0.0anothercontent.7z</file>
<file>data/xmloperationrepository/A/1.0.0default.7z</file>
</qresource>
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content1.tar.gz b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content1.tar.gz
new file mode 100644
index 000000000..3e494db34
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content1.tar.gz
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content2.tar.bz2 b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content2.tar.bz2
new file mode 100644
index 000000000..12cbef8a1
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content2.tar.bz2
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content3.tar.xz b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content3.tar.xz
new file mode 100644
index 000000000..bfa825493
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content3.tar.xz
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content4.zip b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content4.zip
new file mode 100644
index 000000000..866bfa589
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/A/1.0.0content4.zip
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/Updates.xml b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/Updates.xml
index 3a8bdd018..73a093725 100644
--- a/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/Updates.xml
+++ b/tests/auto/installer/extractarchiveoperationtest/data/xmloperationrepository/Updates.xml
@@ -8,7 +8,7 @@
<Version>1.0.0</Version>
<ReleaseDate>2015-01-01</ReleaseDate>
<Default>true</Default>
- <DownloadableArchives>content.7z,anothercontent.7z,default.7z</DownloadableArchives>
+ <DownloadableArchives>content.7z,anothercontent.7z,content1.tar.gz,content2.tar.bz2,content3.tar.xz,content4.zip,default.7z</DownloadableArchives>
<Operations>
<Operation name="Extract">
<Argument>@TargetDir@/FolderForContent</Argument>
@@ -19,6 +19,22 @@
<Argument>anothercontent.7z</Argument>
</Operation>
<Operation name="Extract">
+ <Argument>@TargetDir@/FolderForTarGzContent</Argument>
+ <Argument>content1.tar.gz</Argument>
+ </Operation>
+ <Operation name="Extract">
+ <Argument>@TargetDir@/FolderForTarBz2Content</Argument>
+ <Argument>content2.tar.bz2</Argument>
+ </Operation>
+ <Operation name="Extract">
+ <Argument>@TargetDir@/FolderForTarXzContent</Argument>
+ <Argument>content3.tar.xz</Argument>
+ </Operation>
+ <Operation name="Extract">
+ <Argument>@TargetDir@/FolderForZipContent</Argument>
+ <Argument>content4.zip</Argument>
+ </Operation>
+ <Operation name="Extract">
<Argument>@TargetDir@/FolderForDefault</Argument>
</Operation>
</Operations>
diff --git a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
index cbbc1a1c7..14afc6902 100644
--- a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
+++ b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
@@ -100,6 +100,18 @@ private slots:
QFile extractedFile(m_testDirectory + QDir::separator() + "FolderForContent/content.txt");
QVERIFY(extractedFile.exists());
+ extractedFile.setFileName(m_testDirectory + QDir::separator() + "FolderForTarGzContent/content.txt");
+ QVERIFY(extractedFile.exists());
+
+ extractedFile.setFileName(m_testDirectory + QDir::separator() + "FolderForTarBz2Content/content.txt");
+ QVERIFY(extractedFile.exists());
+
+ extractedFile.setFileName(m_testDirectory + QDir::separator() + "FolderForTarXzContent/content.txt");
+ QVERIFY(extractedFile.exists());
+
+ extractedFile.setFileName(m_testDirectory + QDir::separator() + "FolderForZipContent/content.txt");
+ QVERIFY(extractedFile.exists());
+
extractedFile.setFileName(m_testDirectory + QDir::separator() + "FolderForAnotherContent/anothercontent.txt");
QVERIFY(extractedFile.exists());