summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/moveoperation/tst_moveoperation.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-11-19 07:25:01 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-12-07 07:36:36 +0200
commite82ab45ed71d9b807dc23eae559c759f4584b79d (patch)
tree1ff8a7379a7c0fbd1908783404babd9b83e4d414 /tests/auto/installer/moveoperation/tst_moveoperation.cpp
parentb43ab89a64c6484a8af4be424ab695b956d7f7bc (diff)
Add option to define operations in component.xml
Operations can from now on be declared also in component.xml. The operations are performed, backuped and rollbacked the same way as they would be when defined from scripting api. Task-number: QTIFW-507 Change-Id: Ia509219b94737136c3de25db0cb0c72076b48380 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tests/auto/installer/moveoperation/tst_moveoperation.cpp')
-rw-r--r--tests/auto/installer/moveoperation/tst_moveoperation.cpp45
1 files changed, 27 insertions, 18 deletions
diff --git a/tests/auto/installer/moveoperation/tst_moveoperation.cpp b/tests/auto/installer/moveoperation/tst_moveoperation.cpp
index f5b7bbcd9..6bc72242a 100644
--- a/tests/auto/installer/moveoperation/tst_moveoperation.cpp
+++ b/tests/auto/installer/moveoperation/tst_moveoperation.cpp
@@ -39,6 +39,27 @@ class tst_moveoperation : public QObject
{
Q_OBJECT
+private:
+ void installFromCLI(const QString &repository)
+ {
+ PackageManagerCore *core = PackageManager::getPackageManagerWithInit
+ (m_testDirectory, repository);
+ core->installDefaultComponentsSilently();
+
+ QFile movedFile(m_testDirectory + QDir::separator() + "DestinationFolder/testFile.txt");
+ QVERIFY(movedFile.exists());
+ QFile originalFile(m_sourceFile);
+ QVERIFY(!originalFile.exists());
+
+ core->setPackageManager();
+ core->commitSessionOperations();
+
+ core->uninstallComponentsSilently(QStringList() << "A");
+
+ QVERIFY(!movedFile.exists());
+ QVERIFY(originalFile.exists());
+ }
+
private slots:
void initTestCase()
{
@@ -101,26 +122,14 @@ private slots:
QVERIFY(QFile::exists(m_destinationFile));
}
- void testPerformingFromCLI()
+ void testMoveOperationFromScript()
{
- PackageManagerCore *core = PackageManager::getPackageManagerWithInit
- (m_testDirectory, ":///data/repository");
- core->installDefaultComponentsSilently();
-
- QFile movedFile(m_testDirectory + QDir::separator() + "DestinationFolder/testFile.txt");
- QVERIFY(movedFile.exists());
- QFile originalFile(m_sourceFile);
- QVERIFY(!originalFile.exists());
-
- core->setPackageManager();
- core->commitSessionOperations();
-
- core->uninstallComponentsSilently(QStringList() << "A");
-
- QVERIFY(!movedFile.exists());
- QVERIFY(originalFile.exists());
+ installFromCLI(":///data/repository");
+ }
- core->deleteLater();
+ void testMoveOperationFromXML()
+ {
+ installFromCLI(":///data/xmloperationrepository");
}
void cleanupTestCase()