summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-06-03 14:46:44 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-06-10 06:31:19 +0000
commit7eebeaa99645b3cb5a1e6307ba3594378ba4727f (patch)
tree7cd24485a9652fa01b5faaf65ab1d62b4c8c12ef /tests
parentffccc5a021632ba6989575da46a74bde0269fd8d (diff)
Refactor maintenance tool writing conditions
This change fixes a bug caused by a blocking runInstaller() call in PerformInstallationPage::entering() and also contains refactoring to related parts of code. Change-Id: Ic3309707c1f975a646937aa96fc407a3e5931359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp3
-rw-r--r--tests/auto/installer/createshortcutoperation/tst_createshortcutoperation.cpp1
-rw-r--r--tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp3
-rw-r--r--tests/auto/installer/shared/packagemanager.h1
4 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp
index e260ab175..8d223ae09 100644
--- a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp
+++ b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp
@@ -90,7 +90,8 @@ private slots:
void testUpdateNoUpdatesForSelectedPackage()
{
setRepository(":///data/installPackagesRepositoryUpdate");
- QVERIFY(!core->updateComponentsSilently(QStringList() << "componentInvalid"));
+ // Succeeds as no updates available for component so nothing to do
+ QVERIFY(core->updateComponentsSilently(QStringList() << "componentInvalid"));
}
void testUpdateTwoPackageSilently()
diff --git a/tests/auto/installer/createshortcutoperation/tst_createshortcutoperation.cpp b/tests/auto/installer/createshortcutoperation/tst_createshortcutoperation.cpp
index f3c1132f3..a8826124e 100644
--- a/tests/auto/installer/createshortcutoperation/tst_createshortcutoperation.cpp
+++ b/tests/auto/installer/createshortcutoperation/tst_createshortcutoperation.cpp
@@ -70,6 +70,7 @@ private slots:
QString(), Protocol::DefaultAuthorizationKey, Protocol::Mode::Production,
QHash<QString, QString>(), true);
core->setAllowedRunningProcesses(QStringList() << QCoreApplication::applicationFilePath());
+ core->disableWriteMaintenanceTool();
QSet<Repository> repoList;
Repository repo = Repository::fromUserInput(":///data/repository");
repoList.insert(repo);
diff --git a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
index 9dc3367f8..83d93d647 100644
--- a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
+++ b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp
@@ -96,6 +96,7 @@ private slots:
QString(), Protocol::DefaultAuthorizationKey, Protocol::Mode::Production,
QHash<QString, QString>(), true);
core->setAllowedRunningProcesses(QStringList() << QCoreApplication::applicationFilePath());
+ core->disableWriteMaintenanceTool();
m_installDir = QInstaller::generateTemporaryFileName();
QVERIFY(QDir().mkpath(m_installDir));
core->setValue(scTargetDir, m_installDir);
@@ -162,7 +163,7 @@ private slots:
setRepository(":///data/invalidoperation");
core->autoAcceptMessageBoxes();
core->installDefaultComponentsSilently();
- QCOMPARE(PackageManagerCore::Running, core->status());
+ QCOMPARE(PackageManagerCore::Success, core->status());
}
void invalidHashAutoReject()
diff --git a/tests/auto/installer/shared/packagemanager.h b/tests/auto/installer/shared/packagemanager.h
index 762edc61f..a62f13484 100644
--- a/tests/auto/installer/shared/packagemanager.h
+++ b/tests/auto/installer/shared/packagemanager.h
@@ -46,6 +46,7 @@ struct PackageManager
PackageManagerCore *core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ());
QString appFilePath = QCoreApplication::applicationFilePath();
core->setAllowedRunningProcesses(QStringList() << appFilePath);
+ core->disableWriteMaintenanceTool();
QSet<Repository> repoList;
Repository repo = Repository::fromUserInput(repository);
repoList.insert(repo);