summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Kampas <martin.kampas@jolla.com>2018-09-27 06:53:22 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-11-04 10:14:02 +0000
commit6dcbefc257895445d99deb06426607cc274fca08 (patch)
tree82c1c5ad29934be1d5724aed26ad63d2958eca25 /tests
parent4be2a6ed5db2ca69bd6a2d008c1290e592eaa3f8 (diff)
Automatically uninstall unneeded virtual components
Change-Id: Ifbbfec4449a9f5b0a79269fc7ddfcc1780e762e5 Task-number: QTBUG-76210 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml12
-rw-r--r--tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml10
-rw-r--r--tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7zbin0 -> 209 bytes
-rw-r--r--tests/auto/installer/cliinterface/settings.qrc1
-rw-r--r--tests/auto/installer/cliinterface/tst_cliinterface.cpp6
5 files changed, 27 insertions, 2 deletions
diff --git a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml b/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml
index 90d14c93e..18d6f11c3 100644
--- a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml
+++ b/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml
@@ -145,4 +145,16 @@
<Virtual>true</Virtual>
<Checkable>true</Checkable>
</Package>
+ <Package>
+ <Name>componentI</Name>
+ <Title>Component I</Title>
+ <Description>This component has an automatic dependency on Component C. If C is marked for installation, this component is also installed.</Description>
+ <Version>1.0.0</Version>
+ <LastUpdateDate></LastUpdateDate>
+ <InstallDate>2020-03-23</InstallDate>
+ <Size>99</Size>
+ <AutoDependOn>componentC</AutoDependOn>
+ <Virtual>true</Virtual>
+ <Checkable>true</Checkable>
+ </Package>
</Packages>
diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml b/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml
index e61b11189..adabceab4 100644
--- a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml
+++ b/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml
@@ -158,4 +158,14 @@
<DownloadableArchives>content.7z</DownloadableArchives>
<Virtual>true</Virtual>
</PackageUpdate>
+ <PackageUpdate>
+ <Name>componentI</Name>
+ <Description>This component has an automatic dependency on Component C. If C is marked for installation, this component is also installed.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>50</SortingPriority>
+ <AutoDependOn>componentC</AutoDependOn>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <Virtual>true</Virtual>
+ </PackageUpdate>
</Updates>
diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z
new file mode 100644
index 000000000..651a29f94
--- /dev/null
+++ b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/cliinterface/settings.qrc b/tests/auto/installer/cliinterface/settings.qrc
index 2278f42d0..6b46aaffd 100644
--- a/tests/auto/installer/cliinterface/settings.qrc
+++ b/tests/auto/installer/cliinterface/settings.qrc
@@ -13,6 +13,7 @@
<file>data/installPackagesRepository/componentF/1.0.0content.7z</file>
<file>data/installPackagesRepository/componentG/1.0.0content.7z</file>
<file>data/installPackagesRepository/componentH/1.0.0content.7z</file>
+ <file>data/installPackagesRepository/componentI/1.0.0content.7z</file>
<file>data/installPackagesRepository/componentG/1.0.0meta.7z</file>
<file>data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z</file>
<file>data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z</file>
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
index 281572111..2c077d22d 100644
--- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp
+++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
@@ -271,10 +271,11 @@ private slots:
VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); //Dependency for componentC
VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall
VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA
+ VerifyInstaller::verifyInstallerResources(m_installDir, "componentI", "1.0.0content.txt"); //Virtual, depends on componentC
VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB
VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt"
<< "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt"
- << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt");
+ << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt" << "installcontentI.txt");
}
void testUninstallWithDependencySilently()
@@ -285,7 +286,7 @@ private slots:
<< QLatin1String("componentC")));
VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt"
<< "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt"
- << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt");
+ << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt" << "installcontentI.txt");
core->commitSessionOperations();
core->setPackageManager();
@@ -298,6 +299,7 @@ private slots:
VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA
VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB
VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentC");
+ VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentI"); //Virtual, depends on componentC
VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml"
<< "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt"
<< "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt");