summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-11-22 10:52:00 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-11-25 12:35:40 +0100
commitb46a9a08fd48872cffb622ed1dd596087a6e7a4c (patch)
tree8d67ea893bd198ffa80e046357fc3ff4af312725 /tests
parent9ad4bc2401dd3d3be8b6c4407666b9ea1973dbb5 (diff)
downloadqbs-b46a9a08fd48872cffb622ed1dd596087a6e7a4c.tar.gz
API: Add the ability to remove groups.
Change-Id: Ic0d7a9f4976e87ab1894bb3a34372c0a27b087fe Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/api/tst_api.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index 94c94e656..a148f5052 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -260,6 +260,23 @@ void TestApi::changeContent()
QVERIFY(errorInfo.hasError());
QVERIFY2(errorInfo.toString().contains("prefix"), qPrintable(errorInfo.toString()));
+ // Remove group.
+ projectData = project.projectData();
+ QVERIFY(projectData.products().count() == 1);
+ product = projectData.products().first();
+ group = findGroup(product, "Existing Group 5");
+ QVERIFY(group.isValid());
+ errorInfo = project.removeGroup(product, group);
+ QVERIFY2(!errorInfo.hasError(), qPrintable(errorInfo.toString()));
+ projectData = project.projectData();
+ QVERIFY(projectData.products().count() == 1);
+ QCOMPARE(projectData.products().first().groups().count(), 7);
+
+ // Error handling: Try to remove the same group again.
+ errorInfo = project.removeGroup(product, group);
+ QVERIFY(errorInfo.hasError());
+ QVERIFY2(errorInfo.toString().contains("does not exist"), qPrintable(errorInfo.toString()));
+
// Check whether building will take the added and removed cpp files into account.
// This must not be moved below the re-resolving test!!!
qbs::BuildOptions buildOptions;