diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-10-02 16:00:10 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-10-11 14:34:36 +0000 |
commit | 37d602bf6744fa5a3f2b4687da77fe1fc2fe1ff8 (patch) | |
tree | aa11cce892f5d0697ab2b00e897925eacca4157e /tests/auto | |
parent | 61ddc0685e0edc35b5fc39fdebacf08c64dbc991 (diff) | |
download | qbs-37d602bf6744fa5a3f2b4687da77fe1fc2fe1ff8.tar.gz |
Remove bogus assertion from Properties item handler
It does not appear to serve a purpose, and it prevented deriving from
the Properties item.
Change-Id: Icf71e3358299ea7a0f697637967e65dd0fb9b743
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto')
6 files changed, 58 insertions, 0 deletions
diff --git a/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs b/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs new file mode 100644 index 000000000..5ac15658c --- /dev/null +++ b/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs @@ -0,0 +1,6 @@ +import qbs + +Properties { + condition: qbs.buildVariant === "debug" + name: "product_debug" +} diff --git a/tests/auto/language/testdata/inherited-properties-items/imports/ReleaseName.qbs b/tests/auto/language/testdata/inherited-properties-items/imports/ReleaseName.qbs new file mode 100644 index 000000000..e33c5652b --- /dev/null +++ b/tests/auto/language/testdata/inherited-properties-items/imports/ReleaseName.qbs @@ -0,0 +1,6 @@ +import qbs + +Properties { + condition: qbs.buildVariant === "release" + name: "product_release" +} diff --git a/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items-product.qbs b/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items-product.qbs new file mode 100644 index 000000000..c20f045c8 --- /dev/null +++ b/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items-product.qbs @@ -0,0 +1,7 @@ +import qbs + +Product { + name: "product_default" + DebugName {} + ReleaseName {} +} diff --git a/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items.qbs b/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items.qbs new file mode 100644 index 000000000..40d41c2fb --- /dev/null +++ b/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items.qbs @@ -0,0 +1,6 @@ +import qbs + +Project { + qbsSearchPaths: sourceDirectory + references: "inherited-properties-items-product.qbs" +} diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index 9aa92229e..3a9325c29 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1357,6 +1357,37 @@ void TestLanguage::importCollection() QVERIFY(!exceptionCaught); } +void TestLanguage::inheritedPropertiesItems_data() +{ + QTest::addColumn<QString>("buildVariant"); + QTest::addColumn<QString>("productName"); + QTest::newRow("debug build") << "debug" << "product_debug"; + QTest::newRow("release build") << "release" << "product_release"; +} + +void TestLanguage::inheritedPropertiesItems() +{ + bool exceptionCaught = false; + try { + SetupProjectParameters params = defaultParameters; + QFETCH(QString, buildVariant); + QFETCH(QString, productName); + params.setProjectFilePath + (testProject("inherited-properties-items/inherited-properties-items.qbs")); + params.setOverriddenValues(QVariantMap{std::make_pair("qbs.buildVariant", buildVariant)}); + TopLevelProjectPtr project = loader->loadProject(params); + QVERIFY(!!project); + QHash<QString, ResolvedProductPtr> products = productsFromProject(project); + QCOMPARE(products.size(), 1); + QVERIFY(!!products.value(productName)); + } + catch (const ErrorInfo &e) { + exceptionCaught = true; + qDebug() << e.toString(); + } + QVERIFY(!exceptionCaught); +} + void TestLanguage::invalidBindingInDisabledItem() { bool exceptionCaught = false; diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h index 18027ab45..d724e5fc6 100644 --- a/tests/auto/language/tst_language.h +++ b/tests/auto/language/tst_language.h @@ -113,6 +113,8 @@ private slots: void idUsage(); void idUniqueness(); void importCollection(); + void inheritedPropertiesItems_data(); + void inheritedPropertiesItems(); void invalidBindingInDisabledItem(); void invalidOverrides(); void invalidOverrides_data(); |