summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-11-01 16:56:31 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-11-02 09:39:43 +0000
commit072251bf003fa687ed3e356f0a78a38f06633ae1 (patch)
tree4be2221e78817df16f9ecd37f284edfc914f025c /tests
parent6cb626668a0f5062afbd89a971dcc9488a6188d1 (diff)
downloadqbs-072251bf003fa687ed3e356f0a78a38f06633ae1.tar.gz
Give the SubProject item a condition property
Users will expect it to have one. [ChangeLog] The SubProject item now has a condition property. Change-Id: I3bf571fd3f68ab8eaed81a044f2028df83efca05 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/language/testdata/disabled-subproject.qbs28
-rw-r--r--tests/auto/language/tst_language.cpp17
-rw-r--r--tests/auto/language/tst_language.h1
3 files changed, 46 insertions, 0 deletions
diff --git a/tests/auto/language/testdata/disabled-subproject.qbs b/tests/auto/language/testdata/disabled-subproject.qbs
new file mode 100644
index 000000000..3074e5090
--- /dev/null
+++ b/tests/auto/language/testdata/disabled-subproject.qbs
@@ -0,0 +1,28 @@
+import qbs
+
+Project {
+ SubProject {
+ condition: false
+ filePath: "nosuchfile.qbs"
+ }
+ SubProject {
+ Properties {
+ condition: false
+ }
+ filePath: "nosuchfile.qbs"
+ }
+ SubProject {
+ condition: true
+ Properties {
+ condition: false
+ }
+ filePath: "nosuchfile.qbs"
+ }
+ SubProject {
+ condition: false
+ Properties {
+ condition: true
+ }
+ filePath: "nosuchfile.qbs"
+ }
+}
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index 38bd86400..4153f1f69 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -553,6 +553,23 @@ void TestLanguage::derivedSubProject()
QCOMPARE(exceptionCaught, false);
}
+void TestLanguage::disabledSubProject()
+{
+ bool exceptionCaught = false;
+ try {
+ SetupProjectParameters params = defaultParameters;
+ params.setProjectFilePath(testProject("disabled-subproject.qbs"));
+ const TopLevelProjectPtr project = loader->loadProject(params);
+ QVERIFY(!!project);
+ const QHash<QString, ResolvedProductPtr> products = productsFromProject(project);
+ QCOMPARE(products.count(), 0);
+ } catch (const ErrorInfo &e) {
+ exceptionCaught = true;
+ qDebug() << e.toString();
+ }
+ QCOMPARE(exceptionCaught, false);
+}
+
void TestLanguage::enumerateProjectProperties()
{
bool exceptionCaught = false;
diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h
index c7520e9dc..ee4888e11 100644
--- a/tests/auto/language/tst_language.h
+++ b/tests/auto/language/tst_language.h
@@ -90,6 +90,7 @@ private slots:
void delayedError_data();
void dependencyOnAllProfiles();
void derivedSubProject();
+ void disabledSubProject();
void enumerateProjectProperties();
void environmentVariable();
void errorInDisabledProduct();