diff options
author | Katja Marttila <katja.marttila@qt.io> | 2022-06-02 10:46:14 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2022-06-06 14:12:13 +0300 |
commit | fdfd2e381bd16a99822ef8c9dfdffb75ab29d142 (patch) | |
tree | c97aa34d0e11907c8f65978a7aecc7c088e9d341 /tests/auto/installer/cliinterface | |
parent | b6e6ad4876ab6c2c2a20f6cce191e27411441921 (diff) |
Convert possible test cases to data-driven tests
Also rename the test to better correspond the test cases.
Change-Id: Ic3f624fc8cf42724ff4df550cc85a52343ac6452
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tests/auto/installer/cliinterface')
34 files changed, 0 insertions, 1213 deletions
diff --git a/tests/auto/installer/cliinterface/cliinterface.pro b/tests/auto/installer/cliinterface/cliinterface.pro deleted file mode 100644 index db2a3138a..000000000 --- a/tests/auto/installer/cliinterface/cliinterface.pro +++ /dev/null @@ -1,9 +0,0 @@ -include(../../qttest.pri) - -QT += qml - -SOURCES += tst_cliinterface.cpp - -RESOURCES += \ - settings.qrc \ - ../shared/config.qrc diff --git a/tests/auto/installer/cliinterface/data/components.xml b/tests/auto/installer/cliinterface/data/components.xml deleted file mode 100644 index d5102787f..000000000 --- a/tests/auto/installer/cliinterface/data/components.xml +++ /dev/null @@ -1,24 +0,0 @@ -<Packages> - <ApplicationName>Online Installer Example</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Package> - <Name>A</Name> - <Title>A Title</Title> - <Description>Example component A</Description> - <Version>1.0.2-1</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-02-13</InstallDate> - <Size>74</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>B</Name> - <Title>B Title</Title> - <Description>Example component B</Description> - <Version>1.0.0-1</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-02-13</InstallDate> - <Size>74</Size> - <Checkable>true</Checkable> - </Package> -</Packages>
\ No newline at end of file diff --git a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml b/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml deleted file mode 100644 index 18d6f11c3..000000000 --- a/tests/auto/installer/cliinterface/data/componentsFromInstallPackagesRepository.xml +++ /dev/null @@ -1,160 +0,0 @@ -<Packages> - <ApplicationName>Dependency Solving Example</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Package> - <Name>componentA</Name> - <Title>Component A</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>158</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentB</Name> - <Title>Component B</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentC</Name> - <Title>Component C (depends on A and B)</Title> - <Description>This component depends on Component A and Component B. Selecting this component for installation also marks Component A and Component B for installation, which in turn marks Component D, because it has an automatic dependency on Component A and Component B.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Dependencies>componentA,componentB</Dependencies> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentD</Name> - <Title>Component D (auto depends on A and B)</Title> - <Description>This component has an automatic dependency on Component A and Component B. If both A and B are 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>componentA,componentB</AutoDependOn> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentE</Name> - <Title>Component E (forced)</Title> - <Description>This is a forced component that is always installed.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <ForcedInstallation>true</ForcedInstallation> - </Package> - <Package> - <Name>componentF</Name> - <Title>Component F</Title> - <Description>This component contains 2 subcomponents.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent1</Name> - <Title>Subcomponent 1</Title> - <Description>This component contains 2 leaf components.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent1.subsubcomponent1</Name> - <Title>Subsubcomponent 1</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent1.subsubcomponent2</Name> - <Title>Subsubcomponent 2</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent2</Name> - <Title>Subcomponent 2</Title> - <Description>This component contains 2 leaf components.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent2.subsubcomponent1</Name> - <Title>Subsubcomponent 1</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentF.subcomponent2.subsubcomponent2</Name> - <Title>Subsubcomponent 2</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentG</Name> - <Title>Component G (default, depends on A, dependency added dynamically)</Title> - <Description>By default, this component is selected for installation. It depends on component A. Dependency is added from inside component script.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <Dependencies>componentA</Dependencies> - <Checkable>true</Checkable> - </Package> - <Package> - <Name>componentH</Name> - <Title>Component H</Title> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <LastUpdateDate></LastUpdateDate> - <InstallDate>2020-03-23</InstallDate> - <Size>99</Size> - <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/config.xml b/tests/auto/installer/cliinterface/data/config.xml deleted file mode 100644 index 041ce5062..000000000 --- a/tests/auto/installer/cliinterface/data/config.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Installer> - <Name>Your application</Name> - <Version>1.2.3</Version> - <MaintenanceToolName></MaintenanceToolName> - <MaintenanceToolIniFile></MaintenanceToolIniFile> - <TargetConfigurationFile></TargetConfigurationFile> -</Installer> diff --git a/tests/auto/installer/cliinterface/data/filequeryrepository/A/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/filequeryrepository/A/1.0.2-1meta.7z Binary files differdeleted file mode 100644 index 0b0b6ade6..000000000 --- a/tests/auto/installer/cliinterface/data/filequeryrepository/A/1.0.2-1meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/filequeryrepository/Updates.xml b/tests/auto/installer/cliinterface/data/filequeryrepository/Updates.xml deleted file mode 100644 index 72b7938d9..000000000 --- a/tests/auto/installer/cliinterface/data/filequeryrepository/Updates.xml +++ /dev/null @@ -1,13 +0,0 @@ -<Updates> - <ApplicationName>{AnyApplication}</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <PackageUpdate> - <Name>A</Name> - <DisplayName>A</DisplayName> - <Description>A component</Description> - <Version>1.0.2-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <Script>script.qs</Script> - </PackageUpdate> -</Updates> diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/Updates.xml b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/Updates.xml deleted file mode 100644 index 72931954a..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/Updates.xml +++ /dev/null @@ -1,72 +0,0 @@ -<Updates> - <ApplicationName>{AnyApplication}</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>false</Checksum> - <PackageUpdate> - <Name>componentA</Name> - <DisplayName>Component A</DisplayName> - <Description>New dependency added</Description> - <Version>2.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>100</SortingPriority> - <UpdateFile OS="Any" CompressedSize="299" UncompressedSize="158"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>92b02a74d0886bc1569ff8b3a7edd1f9d828e56c</SHA1> - <Dependencies>componentF</Dependencies> - </PackageUpdate> - <PackageUpdate> - <Name>componentB</Name> - <DisplayName>Component B</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>90</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>aedfaef53cdc0f52353a8680009be405fa767811</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentC</Name> - <DisplayName>Component C. Dependencies removed</DisplayName> - <Description>This component dependencies on Component A and Component B are removed in update.</Description> - <Dependencies></Dependencies> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>80</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>20b9463a5e06f373182b3c7c4cf879806d429409</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentD</Name> - <DisplayName>Component D (auto depends on A and B)</DisplayName> - <Description>This component has an automatic dependency on Component A and Component B. If both A and B are marked for installation, this component is also installed.</Description> - <AutoDependOn>componentA, componentB</AutoDependOn> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>70</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>99cf24c71559c75dfae9933826ed16051fca6ea1</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF</Name> - <DisplayName>Component F</DisplayName> - <Description>This component contains 2 subcomponents.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>40</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>e6443a8b5a5651f63c0604cae6d32431ca617f1a</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentH</Name> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>50</SortingPriority> - <DownloadableArchives>content.7z</DownloadableArchives> - <Virtual>false</Virtual> - </PackageUpdate> -</Updates> diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentA/2.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentA/2.0.0content.7z Binary files differdeleted file mode 100644 index 4ddbe565b..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentA/2.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentB/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentB/1.0.0content.7z Binary files differdeleted file mode 100644 index f84ffcdc5..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentB/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentC/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentC/1.0.0content.7z Binary files differdeleted file mode 100644 index 9ad11e06f..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentC/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentD/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentD/1.0.0content.7z Binary files differdeleted file mode 100644 index 0c8c52e31..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentD/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentF/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentF/1.0.0content.7z Binary files differdeleted file mode 100644 index 4a04b1394..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentF/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentH/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentH/1.0.0content.7z Binary files differdeleted file mode 100644 index e1449ad29..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesDependencyChanged/componentH/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml b/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml deleted file mode 100644 index adabceab4..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/Updates.xml +++ /dev/null @@ -1,171 +0,0 @@ -<Updates> - <ApplicationName>{AnyApplication}</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>false</Checksum> - <PackageUpdate> - <Name>componentA</Name> - <DisplayName>Component A</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>100</SortingPriority> - <UpdateFile OS="Any" CompressedSize="299" UncompressedSize="158"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>92b02a74d0886bc1569ff8b3a7edd1f9d828e56c</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentB</Name> - <DisplayName>Component B</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>90</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>aedfaef53cdc0f52353a8680009be405fa767811</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentC</Name> - <DisplayName>Component C (depends on A and B)</DisplayName> - <Description>This component depends on Component A and Component B. Selecting this component for installation also marks Component A and Component B for installation, which in turn marks Component D, because it has an automatic dependency on Component A and Component B.</Description> - <Dependencies>componentA, componentB</Dependencies> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>80</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>20b9463a5e06f373182b3c7c4cf879806d429409</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentD</Name> - <DisplayName>Component D (auto depends on A and B)</DisplayName> - <Description>This component has an automatic dependency on Component A and Component B. If both A and B are marked for installation, this component is also installed.</Description> - <AutoDependOn>componentA, componentB</AutoDependOn> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>70</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>99cf24c71559c75dfae9933826ed16051fca6ea1</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentE</Name> - <DisplayName>Component E (forced)</DisplayName> - <Description>This is a forced component that is always installed.</Description> - <ForcedInstallation>true</ForcedInstallation> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>60</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>926bf503ccdff93351744843a95e5e2172cad5ec</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF</Name> - <DisplayName>Component F</DisplayName> - <Description>This component contains 2 subcomponents.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>40</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>e6443a8b5a5651f63c0604cae6d32431ca617f1a</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent1</Name> - <DisplayName>Subcomponent 1</DisplayName> - <Description>This component contains 2 leaf components.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>100</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>a3bc5dce1c93add30c22e46436396c66b0b51001</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent1.subsubcomponent1</Name> - <DisplayName>Subsubcomponent 1</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>100</SortingPriority> - <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>ebe4d69414a1675a7f46887e15d9bffc275b7cc4</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent1.subsubcomponent2</Name> - <DisplayName>Subsubcomponent 2</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>50</SortingPriority> - <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>e4379d20320d4c173b2d8e228f5722e3f36e3114</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent2</Name> - <DisplayName>Subcomponent 2</DisplayName> - <Description>This component contains 2 leaf components.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>50</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>6462be25912c490569a7c4f3931d978e78c69dc4</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent2.subsubcomponent1</Name> - <DisplayName>Subsubcomponent 1</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>100</SortingPriority> - <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>72b224bc8f3431210834ce6db373fc8d638a3546</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentF.subcomponent2.subsubcomponent2</Name> - <DisplayName>Subsubcomponent 2</DisplayName> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>50</SortingPriority> - <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>3e2744edaef06af75b3248d5935523a6e2e61551</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentG</Name> - <DisplayName>Component G (default, depends on A, dependency added dynamically)</DisplayName> - <Description>By default, this component is selected for installation. It depends on component A. Dependency is added from inside component script.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <Script>installscript.js</Script> - <SortingPriority>30</SortingPriority> - <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>8cba36dd589492c28e0d04942b4f8aa0a09f59cc</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>componentH</Name> - <Description>This component does not depend on any other component.</Description> - <Version>1.0.0</Version> - <ReleaseDate>2014-08-25</ReleaseDate> - <SortingPriority>50</SortingPriority> - <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/componentA/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentA/1.0.0content.7z Binary files differdeleted file mode 100644 index 4ddbe565b..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentA/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentB/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentB/1.0.0content.7z Binary files differdeleted file mode 100644 index f84ffcdc5..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentB/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentC/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentC/1.0.0content.7z Binary files differdeleted file mode 100644 index 9ad11e06f..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentC/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentD/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentD/1.0.0content.7z Binary files differdeleted file mode 100644 index 0c8c52e31..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentD/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentE/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentE/1.0.0content.7z Binary files differdeleted file mode 100644 index f5abacf81..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentE/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z Binary files differdeleted file mode 100644 index 3aced680f..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z Binary files differdeleted file mode 100644 index e5385a163..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z Binary files differdeleted file mode 100644 index 5bc549863..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z Binary files differdeleted file mode 100644 index da9e9f340..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z Binary files differdeleted file mode 100644 index d0b013706..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z Binary files differdeleted file mode 100644 index 74ab44033..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF/1.0.0content.7z Binary files differdeleted file mode 100644 index 4a04b1394..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentF/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0content.7z Binary files differdeleted file mode 100644 index 81fc02052..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0meta.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0meta.7z Binary files differdeleted file mode 100644 index 90bfe33a2..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentG/1.0.0meta.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentH/1.0.0content.7z b/tests/auto/installer/cliinterface/data/installPackagesRepository/componentH/1.0.0content.7z Binary files differdeleted file mode 100644 index e1449ad29..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentH/1.0.0content.7z +++ /dev/null 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 Binary files differdeleted file mode 100644 index 651a29f94..000000000 --- a/tests/auto/installer/cliinterface/data/installPackagesRepository/componentI/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/installer/cliinterface/data/repository/Updates.xml b/tests/auto/installer/cliinterface/data/repository/Updates.xml deleted file mode 100644 index 52707d09d..000000000 --- a/tests/auto/installer/cliinterface/data/repository/Updates.xml +++ /dev/null @@ -1,69 +0,0 @@ -<Updates> - <ApplicationName>{AnyApplication}</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>true</Checksum> - <PackageUpdate> - <Name>A</Name> - <DisplayName>A</DisplayName> - <Description>Example component A</Description> - <Version>1.0.2-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>9d54e3a5adf3563913feee8ba23a99fb80d46590</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>B</Name> - <DisplayName>B</DisplayName> - <Description>Example component B</Description> - <Version>1.0.0-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>false</Default> - <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>9170d55a6af81c1a6a63d708a4ab6ed359775cd9</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>C</Name> - <DisplayName>C</DisplayName> - <Description>Example component C</Description> - <Version>1.0.0-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>C.virt</Name> - <DisplayName>Virtual subcomponent of C</DisplayName> - <Description>Example virtual component</Description> - <Version>1.0.0-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Virtual>true</Virtual> - <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>C.virt.subcomponent</Name> - <DisplayName>Subcomponent of virtual component</DisplayName> - <Description>Example subcomponent of virtual component</Description> - <Version>1.0.0-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1> - </PackageUpdate> - <PackageUpdate> - <Name>AB</Name> - <DisplayName>AB</DisplayName> - <Description>Example component AB</Description> - <Version>1.0.2-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile UncompressedSize="0" OS="Any" CompressedSize="0"/> - <SHA1>f75e65b1a0f68abb77fc41da08fc26dda5409a18</SHA1> - </PackageUpdate> -</Updates> diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml deleted file mode 100644 index f0c724db8..000000000 --- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml +++ /dev/null @@ -1,50 +0,0 @@ -<Updates> - <ApplicationName>{AnyApplication}</ApplicationName> - <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>true</Checksum> - <PackageUpdate> - <Name>A</Name> - <DisplayName>A</DisplayName> - <Description>Example component A</Description> - <Version>2.0.0</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile CompressedSize="224" OS="Any" UncompressedSize="74"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>c1f340c9a7ad1edbef4cb6288c83c646211e5ccd</SHA1> - <AutoDependOn>autoDep</AutoDependOn> - </PackageUpdate> - <PackageUpdate> - <Name>AB</Name> - <DisplayName>AB</DisplayName> - <Description>Example component AB</Description> - <Version>1.0.2-1</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile CompressedSize="0" OS="Any" UncompressedSize="0"/> - <SHA1>3c1470896a9db84092e00806b1303f3b5fa4f7ad</SHA1> - <Checkable>false</Checkable> - </PackageUpdate> - <PackageUpdate> - <Name>B</Name> - <DisplayName>B</DisplayName> - <Description>Example component B</Description> - <Version>2.0.0</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <Default>true</Default> - <UpdateFile CompressedSize="224" OS="Any" UncompressedSize="74"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1> - <Virtual>true</Virtual> - </PackageUpdate> - <PackageUpdate> - <Name>B.subcomponent</Name> - <DisplayName>Subcomponent of B</DisplayName> - <Description>Example non-virtual subcomponent of B</Description> - <Version>2.0.0</Version> - <ReleaseDate>2015-01-01</ReleaseDate> - <UpdateFile CompressedSize="224" OS="Any" UncompressedSize="74"/> - <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1> - </PackageUpdate> -</Updates> diff --git a/tests/auto/installer/cliinterface/settings.qrc b/tests/auto/installer/cliinterface/settings.qrc deleted file mode 100644 index 824517e1e..000000000 --- a/tests/auto/installer/cliinterface/settings.qrc +++ /dev/null @@ -1,35 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>data/config.xml</file> - <file>data/repository/Updates.xml</file> - <file>data/uninstallableComponentsRepository/Updates.xml</file> - <file>data/components.xml</file> - <file>data/installPackagesRepository/Updates.xml</file> - <file>data/installPackagesRepository/componentA/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentB/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentC/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentD/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentE/1.0.0content.7z</file> - <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> - <file>data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z</file> - <file>data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/Updates.xml</file> - <file>data/installPackagesDependencyChanged/componentA/2.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/componentB/1.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/componentC/1.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/componentD/1.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/componentF/1.0.0content.7z</file> - <file>data/installPackagesDependencyChanged/componentH/1.0.0content.7z</file> - <file>data/filequeryrepository/Updates.xml</file> - <file>data/filequeryrepository/A/1.0.2-1meta.7z</file> - <file>data/componentsFromInstallPackagesRepository.xml</file> - </qresource> -</RCC> diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp deleted file mode 100644 index 8f1784543..000000000 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ /dev/null @@ -1,602 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2022 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Installer Framework. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -**************************************************************************/ -#include "../shared/packagemanager.h" -#include "../shared/verifyinstaller.h" - -#include <component.h> -#include <packagemanagercore.h> - -#include <QLoggingCategory> -#include <QTest> -#include <QRegularExpression> - -#include <iostream> -#include <sstream> - -using namespace QInstaller; - -class tst_CLIInterface : public QObject -{ - Q_OBJECT - -private slots: - void testListAvailablePackages() - { - QString loggingRules = (QLatin1String("ifw.* = false\n")); - - QTest::ignoreMessage(QtDebugMsg, "Operations sanity check succeeded."); - - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManager - (m_installDir, ":///data/repository")); - - QLoggingCategory::setFilterRules(loggingRules); - auto func = &PackageManagerCore::listAvailablePackages; - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"AB\" displayname=\"AB\" version=\"1.0.2-1\"/>\n" - " <package name=\"A\" displayname=\"A\" version=\"1.0.2-1\"/>\n" - " <package name=\"B\" displayname=\"B\" version=\"1.0.0-1\"/>\n" - " <package name=\"C\" displayname=\"C\" version=\"1.0.0-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("."), QHash<QString, QString>()); - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"AB\" displayname=\"AB\" version=\"1.0.2-1\"/>\n" - " <package name=\"A\" displayname=\"A\" version=\"1.0.2-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("A"), QHash<QString, QString>()); - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"AB\" displayname=\"AB\" version=\"1.0.2-1\"/>\n" - " <package name=\"A\" displayname=\"A\" version=\"1.0.2-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("A.*"), QHash<QString, QString>()); - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"B\" displayname=\"B\" version=\"1.0.0-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("^B"), QHash<QString, QString>()); - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"B\" displayname=\"B\" version=\"1.0.0-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("^B.*"), QHash<QString, QString>()); - - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"C\" displayname=\"C\" version=\"1.0.0-1\"/>\n" - "</availablepackages>\n"), func, QLatin1String("^C"), QHash<QString, QString>()); - - // Test with filters - QHash<QString, QString> searchHash { - { "Version", "1.0.2" }, - { "DisplayName", "A" } - }; - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"AB\" displayname=\"AB\" version=\"1.0.2-1\"/>\n" - " <package name=\"A\" displayname=\"A\" version=\"1.0.2-1\"/>\n" - "</availablepackages>\n"), func, QString(), searchHash); - - searchHash.clear(); - searchHash.insert("Default", "false"); - verifyListPackagesMessage(core.get(), QLatin1String("<?xml version=\"1.0\"?>\n" - "<availablepackages>\n" - " <package name=\"B\" displayname=\"B\" version=\"1.0.0-1\"/>\n" - "</availablepackages>\n"), func, QString(), searchHash); - - // Need to change rules here to catch messages - QLoggingCategory::setFilterRules("ifw.* = true\n"); - - QTest::ignoreMessage(QtDebugMsg, "No matching packages found."); - core->listAvailablePackages(QLatin1String("C.virt")); - - QTest::ignoreMessage(QtDebugMsg, "No matching packages found."); - core->listAvailablePackages(QLatin1String("C.virt.subcomponent")); - } - - void testInstallPackageFails() - { - QString loggingRules = (QLatin1String("ifw.* = false\n" - "ifw.installer.installlog = true\n")); - - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManager - (m_installDir, ":///data/uninstallableComponentsRepository")); - - QLoggingCategory::setFilterRules(loggingRules); - - QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); - QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Cannot install component A. Component " - "is installed only as automatic dependency to autoDep.\n")); - QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("A"))); - - QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); - QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Cannot install component AB. Component " - "is not checkable, meaning you have to select one of the subcomponents.\n")); - QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("AB"))); - - QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); - QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Cannot install B. Component is virtual.\n")); - QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("B"))); - - QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); - QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Cannot install B.subcomponent. Component " - "is a descendant of a virtual component B.\n")); - QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("B.subcomponent"))); - - QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download..."); - QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Cannot install MissingComponent. " - "Component not found.\n")); - QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("MissingComponent"))); - QCOMPARE(PackageManagerCore::Canceled, core->status()); - } - - void testUninstallPackageFails() - { - QString loggingRules = (QLatin1String("ifw.installer.installog = true\n")); - PackageManagerCore core; - core.setPackageManager(); - QString appFilePath = QCoreApplication::applicationFilePath(); - core.setAllowedRunningProcesses(QStringList() << appFilePath); - QLoggingCategory::setFilterRules(loggingRules); - - m_installDir = QInstaller::generateTemporaryFileName(); - QVERIFY(QDir().mkpath(m_installDir)); - QVERIFY(QFile::copy(":/data/componentsFromInstallPackagesRepository.xml", m_installDir + "/components.xml")); - - core.setValue(scTargetDir, m_installDir); - QTest::ignoreMessage(QtWarningMsg, "Cannot uninstall ForcedInstallation component componentE"); - QCOMPARE(PackageManagerCore::Success, core.uninstallComponentsSilently(QStringList() - << "componentE")); - - QTest::ignoreMessage(QtWarningMsg, "Cannot uninstall component componentD because it is added as auto dependency to componentA,componentB"); - QCOMPARE(PackageManagerCore::Success, core.uninstallComponentsSilently(QStringList() - << "componentD")); - - QTest::ignoreMessage(QtWarningMsg, "Cannot uninstall component MissingComponent. Component not found in install tree."); - QCOMPARE(PackageManagerCore::Success, core.uninstallComponentsSilently(QStringList() - << "MissingComponent")); - - QTest::ignoreMessage(QtWarningMsg, "Cannot uninstall virtual component componentH"); - QCOMPARE(PackageManagerCore::Success, core.uninstallComponentsSilently(QStringList() - << "componentH")); - - QCOMPARE(PackageManagerCore::Success, core.status()); - } - - void testListInstalledPackages() - { - QString loggingRules = (QLatin1String("ifw.* = false\n")); - PackageManagerCore core; - core.setPackageManager(); - QLoggingCategory::setFilterRules(loggingRules); - auto func = &PackageManagerCore::listInstalledPackages; - - const QString testDirectory = QInstaller::generateTemporaryFileName(); - QVERIFY(QDir().mkpath(testDirectory)); - QVERIFY(QFile::copy(":/data/components.xml", testDirectory + "/components.xml")); - - core.setValue(scTargetDir, testDirectory); - - verifyListPackagesMessage(&core, QLatin1String("<?xml version=\"1.0\"?>\n" - "<localpackages>\n" - " <package name=\"A\" displayname=\"A Title\" version=\"1.0.2-1\"/>\n" - " <package name=\"B\" displayname=\"B Title\" version=\"1.0.0-1\"/>\n" - "</localpackages>\n"), func, QString()); - - verifyListPackagesMessage(&core, QLatin1String("<?xml version=\"1.0\"?>\n" - "<localpackages>\n" - " <package name=\"A\" displayname=\"A Title\" version=\"1.0.2-1\"/>\n" - "</localpackages>\n"), func, QLatin1String("A")); - - QDir dir(testDirectory); - QVERIFY(dir.removeRecursively()); - } - - void testNoDefaultInstallations() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - core->setNoDefaultInstallation(true); - QCOMPARE(PackageManagerCore::Success, core->installDefaultComponentsSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" - << "installcontentE.txt"); - core->setNoDefaultInstallation(false); - } - - void testInstallForcedPackageSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentE"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); - } - - void testInstallPackageSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentA"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); - } - - void testUninstallPackageSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentA"))); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentE.txt" - << "installcontentA.txt" << "installcontent.txt" << "installcontentG.txt"); - - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << QLatin1String("componentA"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentA"); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentG"); //Depends on componentA - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentE.txt"); - } - - void testRemoveAllSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentA"))); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentE.txt" - << "installcontentA.txt" << "installcontent.txt" << "installcontentG.txt"); - - core->commitSessionOperations(); - core->setUninstaller(); - QCOMPARE(PackageManagerCore::Success, core->removeInstallationSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentA"); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentE"); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentG"); - - // On Windows we have to settle for the resources check above as maintenance - // tool (if it would exists) and target directory are only removed later via - // started VBScript process. On Unix platforms the target directory should - // be removed in PackageManagerCorePrivate::runUninstaller(). -#if defined(Q_OS_UNIX) - QVERIFY(!QDir(m_installDir).exists()); -#endif - } - - void testInstallWithDependencySilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentC"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentC - 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" << "installcontentI.txt"); - } - - void testUninstallWithDependencySilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentC"))); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt" - << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" - << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt" << "installcontentI.txt"); - - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << QLatin1String("componentC"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentC - 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, "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"); - } - - void testInstallSubcomponentSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentF.subcomponent2.subsubcomponent2"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2.subsubcomponent2", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentF", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default install - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentF.txt" - << "installcontentF_2.txt" << "installcontentF_2_2.txt" - << "installcontent.txt" << "installcontentA.txt" - << "installcontentE.txt" << "installcontentG.txt"); - } - - void testUninstallSubcomponentSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentF.subcomponent2.subsubcomponent2"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentF.txt" - << "installcontentF_2.txt" << "installcontentF_2_2.txt" - << "installcontent.txt" << "installcontentA.txt" - << "installcontentE.txt" << "installcontentG.txt"); - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << QLatin1String("componentF.subcomponent2"))); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default install - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF.subcomponent2.subsubcomponent2"); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF.subcomponent2"); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF"); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" - << "installcontent.txt" << "installcontentA.txt" - << "installcontentE.txt" << "installcontentG.txt"); - } - - void testInstallDefaultPackagesSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installDefaultComponentsSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); - } - - void testInstallPackagesWithChangedRepository() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - core->setNoDefaultInstallation(true); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentC"))); - - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency to componentC - VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); //Dependency to componentC - VerifyInstaller::verifyInstallerResources(m_installDir, "componentC", "1.0.0content.txt"); //Selected - VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA,componentB - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //AutodependOn componentC - VerifyInstaller::verifyInstallerResources(m_installDir, "componentI", "1.0.0content.txt"); //Virtual dependency to componentC - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" - << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" - << "installcontentC.txt" << "installcontentD.txt" << "installcontentE.txt" - << "installcontentI.txt"); - - core->reset(); - core->cancelMetaInfoJob(); //Call cancel to reset metadata so that update repositories are fetched - - QSet<Repository> repoList; - Repository repo = Repository::fromUserInput(":///data/installPackagesDependencyChanged"); - repoList.insert(repo); - core->settings().setDefaultRepositories(repoList); - - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << QLatin1String("componentH"))); - // New dependency is added in repository from componentA to componentF, check that it is not installed - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF"); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" - << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" - << "installcontentC.txt" << "installcontentD.txt" << "installcontentE.txt" - << "installcontentI.txt" << "installcontentH.txt"); - core->setNoDefaultInstallation(false); - } - - void testUnInstallDefaultPackagesSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installDefaultComponentsSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); - - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << "componentG")); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentG"); - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt"); - } - - void testUninstallForcedPackagesSilenly() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installDefaultComponentsSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << "componentE")); - QCOMPARE(PackageManagerCore::Success, core->status()); - //Nothing is uninstalled as componentE is forced install and cannot be uninstalled - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); - } - - void testUninstallAutodependencyPackagesSilenly() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - << "componentA" << "componentB")); - QCOMPARE(PackageManagerCore::Success, core->status()); - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << "componentD")); - QCOMPARE(PackageManagerCore::Success, core->status()); - //Nothing is uninstalled as componentD is installed as autodependency to componentA and componentB - VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall - VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default - VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" - << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt" - << "installcontentB.txt" << "installcontentD.txt"); - } - - void testUninstallVirtualSetVisibleSilently() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit - (m_installDir, ":///data/installPackagesRepository")); - core->setVirtualComponentsVisible(true); - QCOMPARE(PackageManagerCore::Success, core->installSelectedComponentsSilently(QStringList() - <<"componentH")); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResources(m_installDir, "componentH", "1.0.0content.txt"); - - core->commitSessionOperations(); - core->setPackageManager(); - QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() - << "componentH")); - QCOMPARE(PackageManagerCore::Success, core->status()); - VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentH"); - } - - void testFileQuery() - { - QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit(m_installDir, - ":///data/filequeryrepository")); - core->setCommandLineInstance(true); - core->setFileDialogAutomaticAnswer("ValidDirectory", m_installDir); - - QString testFile = qApp->applicationDirPath() + QDir::toNativeSeparators("/test"); - QFile file(testFile); - QVERIFY(file.open(QIODevice::WriteOnly)); - core->setFileDialogAutomaticAnswer("ValidFile", testFile); - - //File dialog launched without ID - core->setFileDialogAutomaticAnswer("GetExistingDirectory", m_installDir); - core->setFileDialogAutomaticAnswer("GetExistingFile", testFile); - - QCOMPARE(PackageManagerCore::Success, core->installDefaultComponentsSilently()); - QCOMPARE(PackageManagerCore::Success, core->status()); - - QVERIFY(core->containsFileDialogAutomaticAnswer("ValidFile")); - core->removeFileDialogAutomaticAnswer("ValidFile"); - QVERIFY(!core->containsFileDialogAutomaticAnswer("ValidFile")); - - QVERIFY(file.remove()); - core->deleteLater(); - } - - void init() - { - m_installDir = QInstaller::generateTemporaryFileName(); - QVERIFY(QDir().mkpath(m_installDir)); - } - - void initTestCase() - { - qSetGlobalQHashSeed(0); //Ensures the dom document deterministic behavior - } - - void cleanup() - { - QDir dir(m_installDir); - QVERIFY(dir.removeRecursively()); - } - -private: - template <typename Func, typename... Args> - void verifyListPackagesMessage(PackageManagerCore *core, const QString &message, - Func func, Args... args) - { - std::ostringstream stream; - std::streambuf *buf = std::cout.rdbuf(); - std::cout.rdbuf(stream.rdbuf()); - - (core->*func)(std::forward<Args>(args)...); - - std::cout.rdbuf(buf); - QVERIFY(stream && stream.str() == message.toStdString()); - } - -private: - QString m_installDir; -}; - - -QTEST_MAIN(tst_CLIInterface) - -#include "tst_cliinterface.moc" |