diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-05-07 13:34:16 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-05-15 13:27:09 +0300 |
commit | 7f3cca72453373e7a9785daeb1c1d7189605d56d (patch) | |
tree | 1dd8a2c8490f27baa378ee69285df9509c53387e /tests/auto/installer/commandlineupdate | |
parent | 20f1400a11837005f0904f2c7cdb40dcd4d5b669 (diff) |
UnitTests: Cleanup code
Move recurred code to common functions, remove unnecessary includes
Change-Id: Idfe3a0c952d1154470ecb229ff3c1e428beaa3ac
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tests/auto/installer/commandlineupdate')
-rw-r--r-- | tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp index d1d174377..78ee7b5b6 100644 --- a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp +++ b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp @@ -26,17 +26,11 @@ ** **************************************************************************/ -#include "metadatajob.h" -#include "settings.h" -#include "init.h" -#include "../shared/commonfunctions.h" +#include "../shared/packagemanager.h" +#include "../shared/verifyinstaller.h" -#include <binarycontent.h> #include <component.h> -#include <errors.h> -#include <fileutils.h> #include <packagemanagercore.h> -#include <progresscoordinator.h> #include <QLoggingCategory> #include <QTest> @@ -62,17 +56,12 @@ private: private slots: void initTestCase() { - core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ()); - QString appFilePath = QCoreApplication::applicationFilePath(); - core->setAllowedRunningProcesses(QStringList() << appFilePath); m_installDir = QInstaller::generateTemporaryFileName(); - QDir().mkpath(m_installDir); - core->setValue(scTargetDir, m_installDir); + core = PackageManager::getPackageManagerWithInit(m_installDir); } void testUpdatePackageSilently() { - QInstaller::init(); //This will eat debug output setRepository(":///data/installPackagesRepository"); core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB"); VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); @@ -94,7 +83,6 @@ private slots: void testUpdateTwoPackageSilently() { - QInstaller::init(); //This will eat debug output setRepository(":///data/installPackagesRepository"); core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB" << "componentG"); VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); @@ -111,7 +99,6 @@ private slots: void testUpdateAllPackagesSilently() { - QInstaller::init(); //This will eat debug output setRepository(":///data/installPackagesRepository"); core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB" << "componentG" << "componentF"); VerifyInstaller::verifyInstallerResources(m_installDir, "componentF", "1.0.0content.txt"); |