diff options
| author | Christian Kandeler <christian.kandeler@digia.com> | 2013-11-22 10:52:00 +0100 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-11-25 12:35:40 +0100 |
| commit | b46a9a08fd48872cffb622ed1dd596087a6e7a4c (patch) | |
| tree | 8d67ea893bd198ffa80e046357fc3ff4af312725 /tests | |
| parent | 9ad4bc2401dd3d3be8b6c4407666b9ea1973dbb5 (diff) | |
| download | qbs-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.cpp | 17 |
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; |
