From efd0607b818d7c35ed668a8d7c0b0b7b2da7558d Mon Sep 17 00:00:00 2001 From: Thomas Epting Date: Tue, 4 Oct 2016 09:15:12 +0200 Subject: Cleanup remaining qbs_dummy files on detection of the MSVC environment Task-number: QBS-1024 Change-Id: I2ec6b941d77bc769d119f30cac5b0f621db8930f Reviewed-by: Christian Kandeler --- src/lib/corelib/tools/msvcinfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/corelib/tools/msvcinfo.cpp b/src/lib/corelib/tools/msvcinfo.cpp index 0ea4e11f2..044f864d2 100644 --- a/src/lib/corelib/tools/msvcinfo.cpp +++ b/src/lib/corelib/tools/msvcinfo.cpp @@ -151,6 +151,9 @@ static QVariantMap getMsvcDefines(const QString &hostCompilerFilePath, } DummyFile actualDummyFile(actualDummyFilePath); const QString qbsClFrontend = nativeDummyFilePath + QStringLiteral(".exe"); + const QString qbsClFrontendObj = nativeDummyFilePath + QStringLiteral(".obj"); + DummyFile actualQbsClFrontend(qbsClFrontend); + DummyFile actualQbsClFrontendObj(qbsClFrontendObj); // The host compiler is the x86 compiler, which will execute on any edition of Windows // for which host compilers have been released so far (x86, x86_64, ia64) @@ -162,6 +165,7 @@ static QVariantMap getMsvcDefines(const QString &hostCompilerFilePath, runProcess(hostCompilerFilePath, QStringList() << QStringLiteral("/nologo") << QStringLiteral("/TC") + << (QStringLiteral("/Fo") + qbsClFrontendObj) << nativeDummyFilePath << QStringLiteral("/link") << (QStringLiteral("/out:") + qbsClFrontend), msvc2.environments[QString()]); -- cgit v1.2.3 From 6a5250c89662ff7b289c23b30a7bece9410de130 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 6 Oct 2016 11:21:35 -0700 Subject: Remove ResourceRules handling These have been obsoleted by Apple, and breaks iOS builds in Xcode 8. https://developer.apple.com/library/mac/technotes/tn2206/_index.html Change-Id: I46a86ae80641d760c8f061b7f76769f8ff99d3db Reviewed-by: Christian Kandeler --- share/qbs/modules/bundle/BundleModule.qbs | 2 +- share/qbs/modules/cpp/ios-gcc.qbs | 24 ---------------------- .../testdata/bundle-structure/bundle-structure.qbs | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index 53d69e704..abd9af1ef 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -487,7 +487,7 @@ Module { condition: qbs.targetOS.contains("darwin") multiplex: true inputs: ["aggregate_infoplist", "pkginfo", "hpp", - "icns", "resourcerules", "xcent", + "icns", "xcent", "compiled_ibdoc", "compiled_assetcatalog", "xcode.provisioningprofile.main"] diff --git a/share/qbs/modules/cpp/ios-gcc.qbs b/share/qbs/modules/cpp/ios-gcc.qbs index 1ab6e8021..2ff4dc49c 100644 --- a/share/qbs/modules/cpp/ios-gcc.qbs +++ b/share/qbs/modules/cpp/ios-gcc.qbs @@ -60,30 +60,6 @@ DarwinGCC { : []; } - Rule { - condition: !product.moduleProperty("qbs", "targetOS").contains("ios-simulator") - multiplex: true - inputs: ["qbs"] - - Artifact { - filePath: product.destinationDirectory + "/" - + product.moduleProperty("bundle", "contentsFolderPath") - + "/ResourceRules.plist" - fileTags: ["resourcerules"] - } - - prepare: { - var cmd = new JavaScriptCommand(); - cmd.description = "generating ResourceRules"; - cmd.highlight = "codegen"; - cmd.sysroot = product.moduleProperty("qbs","sysroot"); - cmd.sourceCode = function() { - File.copy(sysroot + "/ResourceRules.plist", outputs.resourcerules[0].filePath); - } - return cmd; - } - } - Rule { condition: !product.moduleProperty("qbs", "targetOS").contains("ios-simulator") inputsFromDependencies: ["bundle"] diff --git a/tests/auto/blackbox/testdata/bundle-structure/bundle-structure.qbs b/tests/auto/blackbox/testdata/bundle-structure/bundle-structure.qbs index 19586522c..5b372589a 100644 --- a/tests/auto/blackbox/testdata/bundle-structure/bundle-structure.qbs +++ b/tests/auto/blackbox/testdata/bundle-structure/bundle-structure.qbs @@ -3,7 +3,7 @@ import qbs Project { property stringList bundleFileTags: [ "aggregate_infoplist", "pkginfo", "hpp", - "icns", "resourcerules", "xcent", + "icns", "xcent", "compiled_ibdoc", "compiled_assetcatalog", "bundle.symlink.headers", "bundle.symlink.private-headers", "bundle.symlink.resources", "bundle.symlink.executable", -- cgit v1.2.3 From fb7a6ddcd96004f5e7e56b26a722ca49488448e6 Mon Sep 17 00:00:00 2001 From: Thomas Epting Date: Tue, 4 Oct 2016 10:49:05 +0200 Subject: Introduce property cpp.linkerWrapper This allows integration with tools like Bullseye Coverage. Task-number: QBS-1000 Change-Id: I318599a9df0f082a096fb72db7a8878b15e571cc Reviewed-by: Christian Kandeler Reviewed-by: Jake Petroules Reviewed-by: Leena Miettinen --- doc/reference/modules/cpp-module.qdoc | 7 +++++++ share/qbs/modules/cpp/CppModule.qbs | 1 + share/qbs/modules/cpp/gcc.js | 16 ++++++++++++++-- share/qbs/modules/cpp/msvc.js | 9 ++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/doc/reference/modules/cpp-module.qdoc b/doc/reference/modules/cpp-module.qdoc index a9c2464f3..ce6b1ac53 100644 --- a/doc/reference/modules/cpp-module.qdoc +++ b/doc/reference/modules/cpp-module.qdoc @@ -321,6 +321,13 @@ \li 1.1.1 \li determined by qbs-setup-toolchains \li Full path of the linker binary. This is set in the build profile. + \row + \li linkerWrapper + \li \c{stringList} + \li 1.6.2 + \li \c{undefined} + \li Wrapper binary and its arguments for wrapping linker calls. + This is useful for linker wrappers as needed by Bullseye Coverage, for example. \row \li entryPoint \li \c{string} diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 6aa0211a3..2459a419b 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -146,6 +146,7 @@ Module { property stringList compilerWrapper property string linkerName property string linkerPath: linkerName + property stringList linkerWrapper property string staticLibraryPrefix property string dynamicLibraryPrefix property string loadableModulePrefix diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 3f5309985..641d8e579 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -749,10 +749,22 @@ function prepareLinker(project, product, inputs, outputs, input, output) { primaryOutput = outputs.loadablemodule[0]; } - cmd = new Command(effectiveLinkerPath(product, inputs), - linkerFlags(project, product, inputs, primaryOutput)); + var linkerPath = effectiveLinkerPath(product, inputs) + + var args = linkerFlags(project, product, inputs, primaryOutput) + var wrapperArgsLength = 0; + var wrapperArgs = ModUtils.moduleProperty(product, "linkerWrapper"); + if (wrapperArgs && wrapperArgs.length > 0) { + wrapperArgsLength = wrapperArgs.length; + args.unshift(linkerPath); + linkerPath = wrapperArgs.shift(); + args = wrapperArgs.concat(args); + } + + cmd = new Command(linkerPath, args); cmd.description = 'linking ' + primaryOutput.fileName; cmd.highlight = 'linker'; + cmd.responseFileArgumentIndex = wrapperArgsLength; cmd.responseFileUsagePrefix = '@'; commands.push(cmd); diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 43a6a990a..03773dd3a 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -319,8 +319,15 @@ function prepareLinker(project, product, inputs, outputs, input, output) { if (ModUtils.moduleProperty(product, "allowUnresolvedSymbols")) args.push("/FORCE:UNRESOLVED"); + var linkerPath = product.moduleProperty("cpp", "linkerPath"); + var wrapperArgs = product.moduleProperty("cpp", "linkerWrapper"); + if (wrapperArgs && wrapperArgs.length > 0) { + args.unshift(linkerPath); + linkerPath = wrapperArgs.shift(); + args = wrapperArgs.concat(args); + } var commands = []; - var cmd = new Command(product.moduleProperty("cpp", "linkerPath"), args) + var cmd = new Command(linkerPath, args) cmd.description = 'linking ' + primaryOutput.fileName; cmd.highlight = 'linker'; cmd.workingDirectory = FileInfo.path(primaryOutput.filePath) -- cgit v1.2.3 From 16597049dccbe22da92616387a57f7e00bccbb3a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 7 Oct 2016 14:50:53 -0700 Subject: Fix bundleStructure autotest Amends 6a5250c Change-Id: Iffd5d0f07a2655412ed4b4af814cbab84cf2235c Reviewed-by: Christian Kandeler --- tests/auto/blackbox/tst_blackbox.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 60fe58d20..80c3a1f1c 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -696,7 +696,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/A.app/Info.plist").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/A.app/PkgInfo").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/A.app/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/A.app/ResourceRules.plist").isRegularFile()); } if (productName == "B") { @@ -711,7 +710,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/B.framework/PrivateHeaders").isRegularDir()); QVERIFY(QFileInfo2(defaultInstallRoot + "/B.framework/PrivateHeaders/dummy_p.h").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/B.framework/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/B.framework/ResourceRules.plist").isRegularFile()); } if (productName == "C") { @@ -726,7 +724,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/C.framework/PrivateHeaders").isRegularDir()); QVERIFY(QFileInfo2(defaultInstallRoot + "/C.framework/PrivateHeaders/dummy_p.h").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/C.framework/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/C.framework/ResourceRules.plist").isRegularFile()); } if (productName == "D") { @@ -739,7 +736,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/D.bundle/PrivateHeaders").isRegularDir()); QVERIFY(QFileInfo2(defaultInstallRoot + "/D.bundle/PrivateHeaders/dummy_p.h").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/D.bundle/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/D.bundle/ResourceRules.plist").isRegularFile()); } if (productName == "E") { @@ -752,7 +748,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/E.appex/PrivateHeaders").isRegularDir()); QVERIFY(QFileInfo2(defaultInstallRoot + "/E.appex/PrivateHeaders/dummy_p.h").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/E.appex/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/E.appex/ResourceRules.plist").isRegularFile()); } if (productName == "F") { @@ -765,7 +760,6 @@ void TestBlackbox::bundleStructure() QVERIFY(QFileInfo2(defaultInstallRoot + "/F.xpc/PrivateHeaders").isRegularDir()); QVERIFY(QFileInfo2(defaultInstallRoot + "/F.xpc/PrivateHeaders/dummy_p.h").isRegularFile()); QVERIFY(QFileInfo2(defaultInstallRoot + "/F.xpc/resource.txt").isRegularFile()); - QVERIFY(QFileInfo2(defaultInstallRoot + "/F.xpc/ResourceRules.plist").isRegularFile()); } if (productName == "G") { -- cgit v1.2.3 From 1e60fab274e722efa01bce67c9acc56627fcc801 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 11 Oct 2016 09:51:52 +0200 Subject: Extend the autotest for module property assignments in Groups So that we won't accidentally fix only one special case. Task-number: QBS-1005 Change-Id: I2093fd1569880f1ad683118cdd8df2576039f5f2 Reviewed-by: Jake Petroules --- .../language/testdata/modulepropertiesingroups.qbs | 25 ++++++++- .../language/testdata/modules/gmod1/gmod1.qbs | 12 ++++ .../language/testdata/modules/gmod2/gmod2.qbs | 5 ++ src/lib/corelib/language/tst_language.cpp | 65 ++++++++++++++++++---- 4 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 src/lib/corelib/language/testdata/modules/gmod1/gmod1.qbs create mode 100644 src/lib/corelib/language/testdata/modules/gmod2/gmod2.qbs diff --git a/src/lib/corelib/language/testdata/modulepropertiesingroups.qbs b/src/lib/corelib/language/testdata/modulepropertiesingroups.qbs index 6bfbf42d3..22fb750e4 100644 --- a/src/lib/corelib/language/testdata/modulepropertiesingroups.qbs +++ b/src/lib/corelib/language/testdata/modulepropertiesingroups.qbs @@ -3,11 +3,34 @@ import qbs 1.0 Project { Product { name: "grouptest" + + Depends { name: "gmod1" } Depends { name: "dummyqt.core" } + + gmod1.listProp2: ["product", gmod1.stringProp] + gmod1.p1: 1 + + // TODO: Also test nested groups in >= 1.7 Group { - name: "thegroup" + name: "g1" files: ["Banana"] + + gmod1.stringProp: "g1" + gmod1.listProp2: ["g1"] + gmod1.p2: 2 + gmod2.prop: 1 dummyqt.core.zort: "X" } + + Group { + name: "g2" + files: ["zort"] + + gmod1.stringProp: "g2" + gmod1.listProp2: ["g2"] + gmod1.p1: 2 + gmod1.p2: 4 + gmod2.prop: 2 + } } } diff --git a/src/lib/corelib/language/testdata/modules/gmod1/gmod1.qbs b/src/lib/corelib/language/testdata/modules/gmod1/gmod1.qbs new file mode 100644 index 000000000..416372e3d --- /dev/null +++ b/src/lib/corelib/language/testdata/modules/gmod1/gmod1.qbs @@ -0,0 +1,12 @@ +import qbs + +Module { + Depends { name: "gmod2" } + property stringList listProp1: ["prototype", stringProp] + property stringList listProp2: ["prototype"] + property string stringProp: "prototype" + property int depProp: gmod2.prop + property int p0: p1 + p2 + property int p1: 0 + property int p2: 0 +} diff --git a/src/lib/corelib/language/testdata/modules/gmod2/gmod2.qbs b/src/lib/corelib/language/testdata/modules/gmod2/gmod2.qbs new file mode 100644 index 000000000..208f7330d --- /dev/null +++ b/src/lib/corelib/language/testdata/modules/gmod2/gmod2.qbs @@ -0,0 +1,5 @@ +import qbs + +Module { + property int prop: 0 +} diff --git a/src/lib/corelib/language/tst_language.cpp b/src/lib/corelib/language/tst_language.cpp index 6e5d78a14..4dec7dbde 100644 --- a/src/lib/corelib/language/tst_language.cpp +++ b/src/lib/corelib/language/tst_language.cpp @@ -1120,21 +1120,62 @@ void TestLanguage::modulePropertiesInGroups() const QHash products = productsFromProject(project); const ResolvedProductPtr product = products.value("grouptest"); QVERIFY(product); - GroupConstPtr group; + GroupConstPtr g1; + GroupConstPtr g2; foreach (const GroupConstPtr &g, product->groups) { - if (g->name == "thegroup") { - group = g; - break; - } + if (g->name == "g1") + g1= g; + else if (g->name == "g2") + g2 = g; } - QVERIFY(group); - QVariantList values = PropertyFinder().propertyValues(group->properties->value(), - "dummy", "cFlags"); - QStringList valueStrings; - foreach (const QVariant &v, values) - valueStrings += v.toString(); + QVERIFY(g1); + QVERIFY(g2); + + const QVariantMap productProps = product->moduleProperties->value(); + PropertyFinder pf; + + const auto &productListProp1 = pf.propertyValue(productProps, "gmod1", "listProp1") + .toStringList(); + QCOMPARE(productListProp1, QStringList() << "prototype" << "prototype"); + const auto &productListProp2 = pf.propertyValue(productProps, "gmod1", "listProp2") + .toStringList(); + QCOMPARE(productListProp2, QStringList() << "product" << "prototype" << "prototype"); + const int productP0 = pf.propertyValue(productProps, "gmod1", "p0").toInt(); + QCOMPARE(productP0, 1); + const int productDepProp = pf.propertyValue(productProps, "gmod1", "depProp").toInt(); + QCOMPARE(productDepProp, 0); + + const QVariantMap g1Props = g1->properties->value(); + const auto &g1ListProp1 = pf.propertyValue(g1Props, "gmod1", "listProp1") + .toStringList(); + QCOMPARE(g1ListProp1, QStringList() << "prototype" << "g1"); + const auto &g1ListProp2 = pf.propertyValue(g1Props, "gmod1", "listProp2") + .toStringList(); + QEXPECT_FAIL(0, "QBS-1005", Continue); + QCOMPARE(g1ListProp2, QStringList() << "product" << "g1" << "prototype"); + const int g1P0 = pf.propertyValue(g1Props, "gmod1", "p0").toInt(); + QCOMPARE(g1P0, 3); + const int g1DepProp = pf.propertyValue(g1Props, "gmod1", "depProp").toInt(); + QEXPECT_FAIL(0, "QBS-1005", Continue); + QCOMPARE(g1DepProp, 1); + const auto &g1DummyCFlags = pf.propertyValue(g1Props, "dummy", "cFlags") + .toStringList(); + QEXPECT_FAIL(0, "QBS-1005", Continue); + QCOMPARE(g1DummyCFlags, QStringList("X")); + + const QVariantMap g2Props = g2->properties->value(); + const auto &g2ListProp1 = pf.propertyValue(g2Props, "gmod1", "listProp1") + .toStringList(); + QCOMPARE(g2ListProp1, QStringList() << "prototype" << "g2"); + const auto &g2ListProp2 = pf.propertyValue(g2Props, "gmod1", "listProp2") + .toStringList(); + QEXPECT_FAIL(0, "QBS-1005", Continue); + QCOMPARE(g2ListProp2, QStringList() << "product" << "g2" << "prototype"); + const int g2P0 = pf.propertyValue(g2Props, "gmod1", "p0").toInt(); + QCOMPARE(g2P0, 6); + const int g2DepProp = pf.propertyValue(g2Props, "gmod1", "depProp").toInt(); QEXPECT_FAIL(0, "QBS-1005", Continue); - QCOMPARE(valueStrings, QStringList("X")); + QCOMPARE(g2DepProp, 2); } catch (const ErrorInfo &e) { exceptionCaught = true; qDebug() << e.toString(); -- cgit v1.2.3 From 47b575a3b3bf7dc104e1b91babc986577a63ff37 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 10 Oct 2016 17:44:19 +0200 Subject: Convert null variant values to empty lists ... if their declared type is a list. This is a workaround for QTBUG-51237. Change-Id: Ie9e02f5fd125ce73b993e59af0e3dc2b47fe14c1 Reviewed-by: Jake Petroules --- src/lib/corelib/language/evaluatorscriptclass.cpp | 10 ++++++++-- src/lib/corelib/language/projectresolver.cpp | 7 ++++++- .../QTBUG-51237/modules/mymodule/mymodule.qbs | 6 ++++++ .../blackbox/testdata/QTBUG-51237/qtbug-51237.qbs | 22 ++++++++++++++++++++++ tests/auto/blackbox/tst_blackbox.cpp | 20 ++++++++++++++++++++ tests/auto/blackbox/tst_blackbox.h | 1 + 6 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs create mode 100644 tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp index 8230d3990..aa07935dc 100644 --- a/src/lib/corelib/language/evaluatorscriptclass.cpp +++ b/src/lib/corelib/language/evaluatorscriptclass.cpp @@ -398,8 +398,14 @@ static QString overriddenSourceDirectory(const Item *item) } inline void convertToPropertyType(const Item *item, const PropertyDeclaration::Type t, - QScriptValue &v) + Value::Type valueType, QScriptValue &v) { + if (valueType == Value::VariantValueType && v.isUndefined() + && (t == PropertyDeclaration::StringList || t == PropertyDeclaration::PathList)) { + v = v.engine()->newArray(); // QTBUG-51237 + return; + } + if (v.isUndefined() || v.isError()) return; switch (t) { @@ -497,7 +503,7 @@ QScriptValue EvaluatorScriptClass::property(const QScriptValue &object, const QS converter.start(); const PropertyDeclaration decl = data->item->propertyDeclaration(name.toString()); - convertToPropertyType(data->item, decl.type(), result); + convertToPropertyType(data->item, decl.type(), value->type(), result); } if (debugProperties) diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp index e712aff49..bfb2eb74c 100644 --- a/src/lib/corelib/language/projectresolver.cpp +++ b/src/lib/corelib/language/projectresolver.cpp @@ -1129,7 +1129,12 @@ QVariantMap ProjectResolver::evaluateProperties(Item *item, Item *propertiesCont if (result.contains(it.key())) break; VariantValuePtr vvp = it.value().staticCast(); - result[it.key()] = vvp->value(); + QVariant v = vvp->value(); + + if (v.isNull() && !item->propertyDeclaration(it.key()).isScalar()) // QTBUG-51237 + v = QStringList(); + + result[it.key()] = v; break; } } diff --git a/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs b/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs new file mode 100644 index 000000000..223da0b3c --- /dev/null +++ b/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs @@ -0,0 +1,6 @@ +import qbs + +Module { + property stringList theProperty: [] + //property stringList otherProperty: theProperty.concat([]) +} diff --git a/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs b/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs new file mode 100644 index 000000000..e1f8d8ef6 --- /dev/null +++ b/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs @@ -0,0 +1,22 @@ +import qbs + +Product { + type: "custom" + Depends { name: "mymodule" } + Rule { + multiplex: true + Artifact { + filePath: "dummy.custom" + fileTags: ["custom"] + } + prepare: { + var theProperty = product.moduleProperty("mymodule", "theProperty"); + if (!theProperty) + throw "Oh no!"; + var dummy = new JavaScriptCommand(); + dummy.silent = true; + dummy.sourceCode = function() {}; + return [dummy]; + } + } +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 80c3a1f1c..74329abf2 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2335,6 +2335,26 @@ void TestBlackbox::qobjectInObjectiveCpp() QCOMPARE(runQbs(), 0); } +void TestBlackbox::qtBug51237() +{ + const QString profileName = "profile-qtBug51237"; + const QString propertyName = "mymodule.theProperty"; + { + Settings settings((QString())); + Profile profile(profileName, &settings); + profile.setValue(propertyName, QStringList()); + } + Settings settings((QString())); + qbs::Internal::TemporaryProfile profile(profileName, &settings); + const QVariant propertyValue = profile.p.value(propertyName); + QVERIFY(!propertyValue.isValid()); // QTBUG-51237 + QDir::setCurrent(testDataDir + "/QTBUG-51237"); + QbsRunParameters params; + params.arguments << "profile:" + profileName; + params.useProfile = false; + QCOMPARE(runQbs(params), 0); +} + void TestBlackbox::dynamicMultiplexRule() { const QString testDir = testDataDir + "/dynamicMultiplexRule"; diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 64e3b0770..b5a539bb8 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -199,6 +199,7 @@ private slots: void qbsVersion(); void qmlDebugging(); void qobjectInObjectiveCpp(); + void qtBug51237(); void radAfterIncompleteBuild_data(); void radAfterIncompleteBuild(); void recursiveRenaming(); -- cgit v1.2.3 From 704eb30d27117d88e3edbe5d255ea5b8989509f3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 14 Oct 2016 18:13:26 +0200 Subject: Fix autotest for QTBUG-51237 We have to remove one check because of the additional bug QTBUG-19552. Change-Id: I7cf1d46bca6a03a4970281496853f4b3a3055181 Reviewed-by: Jake Petroules --- tests/auto/blackbox/tst_blackbox.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 74329abf2..f791c5e86 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2344,10 +2344,6 @@ void TestBlackbox::qtBug51237() Profile profile(profileName, &settings); profile.setValue(propertyName, QStringList()); } - Settings settings((QString())); - qbs::Internal::TemporaryProfile profile(profileName, &settings); - const QVariant propertyValue = profile.p.value(propertyName); - QVERIFY(!propertyValue.isValid()); // QTBUG-51237 QDir::setCurrent(testDataDir + "/QTBUG-51237"); QbsRunParameters params; params.arguments << "profile:" + profileName; -- cgit v1.2.3