diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-02-10 17:54:47 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-02-11 10:24:20 +0000 |
commit | e1ea84b740fb54bf7a60e852f68dd5a126da0104 (patch) | |
tree | 59d00287f370ad1d326515fe915709577c9be6e4 | |
parent | 7409abb0b7dc2a8ecb672de09b50d0c199873532 (diff) |
Remove invalid assertion.
We can find different values for a scalar property in module prototypes
if they are assigned indirectly at some place.
Change-Id: I97349cd5879e33133ad85751d76728e9873ff265
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
6 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/corelib/tools/propertyfinder.cpp b/src/lib/corelib/tools/propertyfinder.cpp index fec2a69cf..358869064 100644 --- a/src/lib/corelib/tools/propertyfinder.cpp +++ b/src/lib/corelib/tools/propertyfinder.cpp @@ -57,7 +57,6 @@ QVariant PropertyFinder::propertyValue(const QVariantMap &properties, const QStr m_values.clear(); findScalarModuleValue(properties); - QBS_ASSERT(m_values.count() <= 1, return QVariant()); return m_values.isEmpty() ? QVariant() : m_values.first(); } diff --git a/tests/auto/blackbox/testdata/two-default-property-values/modules/mymodule/mymodule.qbs b/tests/auto/blackbox/testdata/two-default-property-values/modules/mymodule/mymodule.qbs new file mode 100644 index 000000000..52e99e24d --- /dev/null +++ b/tests/auto/blackbox/testdata/two-default-property-values/modules/mymodule/mymodule.qbs @@ -0,0 +1,24 @@ +import qbs +import qbs.TextFile + +Module { + property string direct + property string indirect: direct ? "set" : "unset" + + Rule { + inputs: ["txt"] + Artifact { + filePath: product.moduleProperty("mymodule", "indirect") + fileTags: ["mymodule"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Creating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + }; + return [cmd]; + } + } +} diff --git a/tests/auto/blackbox/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs b/tests/auto/blackbox/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs new file mode 100644 index 000000000..e0ec699df --- /dev/null +++ b/tests/auto/blackbox/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs @@ -0,0 +1,5 @@ +import qbs + +Module { + Depends { name: "mymodule" } +} diff --git a/tests/auto/blackbox/testdata/two-default-property-values/project.qbs b/tests/auto/blackbox/testdata/two-default-property-values/project.qbs new file mode 100644 index 000000000..c0bc720f7 --- /dev/null +++ b/tests/auto/blackbox/testdata/two-default-property-values/project.qbs @@ -0,0 +1,13 @@ +import qbs + +Product { + name: "two-default-property-values" + type: "mymodule" + Depends { name: "mymodule" } + Depends { name: "myothermodule" } + mymodule.direct: "dummy" + Group { + files: ["test.txt"] + fileTags: ["txt"] + } +} diff --git a/tests/auto/blackbox/testdata/two-default-property-values/test.txt b/tests/auto/blackbox/testdata/two-default-property-values/test.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata/two-default-property-values/test.txt diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index d1e3353ab..197eed341 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -330,6 +330,9 @@ void TestBlackbox::build_project_data() QTest::newRow("application without sources") << QString("appWithoutSources") << executableFilePath("appWithoutSources"); + QTest::newRow("only default properties") + << QString("two-default-property-values") + << productBuildDir("two-default-property-values") + "/set"; QTest::newRow("QBS-728") << QString("QBS-728") << QString(); |