diff options
Diffstat (limited to 'tests/auto/language/testdata')
83 files changed, 339 insertions, 87 deletions
diff --git a/tests/auto/language/testdata/ParentWithExport.qbs b/tests/auto/language/testdata/ParentWithExport.qbs index 16f9a2cd1..b16097e69 100644 --- a/tests/auto/language/testdata/ParentWithExport.qbs +++ b/tests/auto/language/testdata/ParentWithExport.qbs @@ -1,6 +1,6 @@ Product { Export { Depends { name: "dummy" } - dummy.defines: [product.name.toUpperCase()] + dummy.defines: [exportingProduct.name.toUpperCase()] } } diff --git a/tests/auto/language/testdata/additional-product-types.qbs b/tests/auto/language/testdata/additional-product-types.qbs index 686650f42..f84397da3 100644 --- a/tests/auto/language/testdata/additional-product-types.qbs +++ b/tests/auto/language/testdata/additional-product-types.qbs @@ -5,8 +5,8 @@ Product { Depends { name: "dummy" } Depends { name: "dummy2" } - property bool hasTag1: type.contains("tag1") - property bool hasTag2: type.contains("tag2") - property bool hasTag3: type.contains("tag3") - property bool hasTag4: type.contains("tag4") + property bool hasTag1: type.includes("tag1") + property bool hasTag2: type.includes("tag2") + property bool hasTag3: type.includes("tag3") + property bool hasTag4: type.includes("tag4") } diff --git a/tests/auto/language/testdata/chained-probes/modules/m/m.qbs b/tests/auto/language/testdata/chained-probes/modules/m/m.qbs index 3c6bcd1c9..bf68e56b6 100644 --- a/tests/auto/language/testdata/chained-probes/modules/m/m.qbs +++ b/tests/auto/language/testdata/chained-probes/modules/m/m.qbs @@ -2,13 +2,13 @@ Module { Probe { id: probe1 property string probe1Prop - configure: { probe1Prop = "probe1Val"; found = true; } + configure: { probe1Prop = "probe1Val"; found = true } } Probe { id: probe2 property string inputProp: prop1 property string probe2Prop - configure: { probe2Prop = inputProp + "probe2Val"; found = true; } + configure: { probe2Prop = inputProp + "probe2Val"; found = true } } property string prop1: probe1.probe1Prop property string prop2: probe2.probe2Prop diff --git a/tests/auto/language/testdata/conditionaldepends.qbs b/tests/auto/language/testdata/conditionaldepends.qbs index 9a499da92..e4f9fae7d 100644 --- a/tests/auto/language/testdata/conditionaldepends.qbs +++ b/tests/auto/language/testdata/conditionaldepends.qbs @@ -14,25 +14,25 @@ Project { Product { name: "product_props_true" property bool someTrueProp: true - Depends { condition: someTrueProp; name: "dummy"} + Depends { condition: someTrueProp; name: "dummy" } } Product { name: "product_props_false" property bool someFalseProp: false - Depends { condition: someFalseProp; name: "dummy"} + Depends { condition: someFalseProp; name: "dummy" } } property bool someTruePrjProp: true Product { name: "project_props_true" - Depends { condition: project.someTruePrjProp; name: "dummy"} + Depends { condition: project.someTruePrjProp; name: "dummy" } } property bool someFalsePrjProp: false Product { name: "project_props_false" - Depends { condition: project.someFalsePrjProp; name: "dummy"} + Depends { condition: project.someFalsePrjProp; name: "dummy" } } Product { diff --git a/tests/auto/language/testdata/conditionaldepends_base.qbs b/tests/auto/language/testdata/conditionaldepends_base.qbs index 5ab5b973a..74eb958d4 100644 --- a/tests/auto/language/testdata/conditionaldepends_base.qbs +++ b/tests/auto/language/testdata/conditionaldepends_base.qbs @@ -1,4 +1,4 @@ -Application { +Product { name: 'conditionaldepends_base' property bool someProp: false Depends { diff --git a/tests/auto/language/testdata/dotted-names/dotted-names.qbs b/tests/auto/language/testdata/dotted-names/dotted-names.qbs index cf5658384..714988f0b 100644 --- a/tests/auto/language/testdata/dotted-names/dotted-names.qbs +++ b/tests/auto/language/testdata/dotted-names/dotted-names.qbs @@ -1,5 +1,3 @@ -import qbs - Project { name: "theProject" property bool includeDottedProduct diff --git a/tests/auto/language/testdata/dotted-names/modules/x/y/xy.qbs b/tests/auto/language/testdata/dotted-names/modules/x/y/xy.qbs index 71cfac9cb..eee46458d 100644 --- a/tests/auto/language/testdata/dotted-names/modules/x/y/xy.qbs +++ b/tests/auto/language/testdata/dotted-names/modules/x/y/xy.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property string z: "default" } diff --git a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value.qbs b/tests/auto/language/testdata/duplicate-multiplex-value.qbs index 56da41af1..24b246604 100644 --- a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value.qbs +++ b/tests/auto/language/testdata/duplicate-multiplex-value.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" multiplexByQbsProperties: "architectures" diff --git a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value2.qbs b/tests/auto/language/testdata/duplicate-multiplex-value2.qbs index e412e5210..d6c057a9e 100644 --- a/tests/auto/language/testdata/erroneous/duplicate-multiplex-value2.qbs +++ b/tests/auto/language/testdata/duplicate-multiplex-value2.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" multiplexByQbsProperties: ["architectures", "buildVariants", "architectures"] diff --git a/tests/auto/language/testdata/erroneous/ambiguous-multiplex-dependency.qbs b/tests/auto/language/testdata/erroneous/ambiguous-multiplex-dependency.qbs new file mode 100644 index 000000000..6f60b1faf --- /dev/null +++ b/tests/auto/language/testdata/erroneous/ambiguous-multiplex-dependency.qbs @@ -0,0 +1,14 @@ +Project { + Product { + name: "a" + multiplexByQbsProperties: ["architectures", "buildVariants"] + qbs.architectures: ["x86", "arm"] + qbs.buildVariants: ["debug", "release"] + } + Product { + name: "b" + Depends { name: "a" } + multiplexByQbsProperties: ["architectures"] + qbs.architectures: ["x86", "arm"] + } +} diff --git a/tests/auto/language/testdata/erroneous/conflicting_fileTagsFilter.qbs b/tests/auto/language/testdata/erroneous/conflicting_fileTagsFilter.qbs index 97e11bb9b..3738e0cca 100644 --- a/tests/auto/language/testdata/erroneous/conflicting_fileTagsFilter.qbs +++ b/tests/auto/language/testdata/erroneous/conflicting_fileTagsFilter.qbs @@ -1,10 +1,11 @@ -Application { +Product { + type: "app" Group { - fileTagsFilter: "application" + fileTagsFilter: "app" qbs.install: true } Group { - fileTagsFilter: "application" + fileTagsFilter: "app" qbs.install: false } } diff --git a/tests/auto/language/testdata/erroneous/dependency-profile-mismatch-2.qbs b/tests/auto/language/testdata/erroneous/dependency-profile-mismatch-2.qbs new file mode 100644 index 000000000..d76907a35 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/dependency-profile-mismatch-2.qbs @@ -0,0 +1,17 @@ +Project { + Profile { + name: "profile1" + } + Profile { + name: "profile2" + } + + Product { + name: "dep" + qbs.profiles: ["profile1", "profile2"] + } + Product { + name: "main" + Depends { name: "dep"; profiles: ["profile47"]; } + } +} diff --git a/tests/auto/language/testdata/erroneous/dependency-profile-mismatch.qbs b/tests/auto/language/testdata/erroneous/dependency-profile-mismatch.qbs new file mode 100644 index 000000000..e014fa9b1 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/dependency-profile-mismatch.qbs @@ -0,0 +1,14 @@ +Project { + Profile { + name: "profile1" + } + + Product { + name: "dep" + qbs.profiles: ["profile1"] + } + Product { + name: "main" + Depends { name: "dep"; profiles: ["profile47"]; } + } +} diff --git a/tests/auto/language/testdata/erroneous/dependency_cycle.qbs b/tests/auto/language/testdata/erroneous/dependency_cycle.qbs index 83a6e35f6..80c678f89 100644 --- a/tests/auto/language/testdata/erroneous/dependency_cycle.qbs +++ b/tests/auto/language/testdata/erroneous/dependency_cycle.qbs @@ -1,15 +1,15 @@ Project { - CppApplication { + Product { name: "A" Depends { name: "B" } files: ["main.cpp"] } - CppApplication { + Product { name: "B" Depends { name: "C" } files: ["main.cpp"] } - CppApplication { + Product { name: "C" Depends { name: "A" } files: ["main.cpp"] diff --git a/tests/auto/language/testdata/erroneous/dependency_cycle2.qbs b/tests/auto/language/testdata/erroneous/dependency_cycle2.qbs index 335355480..4aff0b75c 100644 --- a/tests/auto/language/testdata/erroneous/dependency_cycle2.qbs +++ b/tests/auto/language/testdata/erroneous/dependency_cycle2.qbs @@ -1,20 +1,20 @@ Project { - CppApplication { + Product { name: "A" Depends { name: "B" } files: ["main.cpp"] } - CppApplication { + Product { name: "B" Depends { name: "C" } files: ["main.cpp"] } - CppApplication { + Product { name: "C" Depends { name: "A" } files: ["main.cpp"] } - CppApplication { + Product { name: "D" files: ["main.cpp"] } diff --git a/tests/auto/language/testdata/erroneous/dependency_cycle3a.qbs b/tests/auto/language/testdata/erroneous/dependency_cycle3a.qbs new file mode 100644 index 000000000..a0660c074 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/dependency_cycle3a.qbs @@ -0,0 +1,11 @@ +Project { + Product { + name: "B" + Depends { productTypes: ["a"] } + } + Product { + type: ["a"] + name: "A" + Depends { name: "B" } + } +} diff --git a/tests/auto/language/testdata/erroneous/frozen-object-list.qbs b/tests/auto/language/testdata/erroneous/frozen-object-list.qbs new file mode 100644 index 000000000..8bbd2b413 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/frozen-object-list.qbs @@ -0,0 +1,17 @@ + +Product { + Probe { + id: probe + property varList output + configure: { + output = [{"key": "value"}]; + found = true; + } + } + + property var test: { + var result = probe.output; + result.push({}); + return result; + } +} diff --git a/tests/auto/language/testdata/erroneous/frozen-object.qbs b/tests/auto/language/testdata/erroneous/frozen-object.qbs new file mode 100644 index 000000000..0f891d04b --- /dev/null +++ b/tests/auto/language/testdata/erroneous/frozen-object.qbs @@ -0,0 +1,18 @@ + +Product { + Probe { + id: probe + property var output + configure: { + output = {"key": "value"} + found = true + } + } + + property var test: { + "use strict" + var result = probe.output; + result.key = "newValue"; + return result; + } +} diff --git a/tests/auto/language/testdata/erroneous/invalid_file.qbs b/tests/auto/language/testdata/erroneous/invalid_file.qbs index c461b87ef..54ec27410 100644 --- a/tests/auto/language/testdata/erroneous/invalid_file.qbs +++ b/tests/auto/language/testdata/erroneous/invalid_file.qbs @@ -1,3 +1,3 @@ -Application { +Product { files: ["main.cpp", "other.h"] } diff --git a/tests/auto/language/testdata/erroneous/missing-colon.qbs b/tests/auto/language/testdata/erroneous/missing-colon.qbs index e62eb7cfd..6e136bb56 100644 --- a/tests/auto/language/testdata/erroneous/missing-colon.qbs +++ b/tests/auto/language/testdata/erroneous/missing-colon.qbs @@ -1,3 +1,5 @@ -CppApplication { - cpp.dynamicLibraries { } +Product { + Depends { name: "dummy" } + qbsSearchPaths: ".." + dummy.cxxFlags { } } diff --git a/tests/auto/language/testdata/erroneous/missing-js-file.qbs b/tests/auto/language/testdata/erroneous/missing-js-file.qbs new file mode 100644 index 000000000..a3274a35b --- /dev/null +++ b/tests/auto/language/testdata/erroneous/missing-js-file.qbs @@ -0,0 +1,3 @@ +Product { + Depends { name: "missing-js-file-module" } +} diff --git a/tests/auto/language/testdata/erroneous/module-property-binding-in-project.qbs b/tests/auto/language/testdata/erroneous/module-property-binding-in-project.qbs new file mode 100644 index 000000000..667088c17 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/module-property-binding-in-project.qbs @@ -0,0 +1,3 @@ +Project { + qbs.sysroot: "/" +} diff --git a/tests/auto/language/testdata/erroneous/module-with-id.qbs b/tests/auto/language/testdata/erroneous/module-with-id.qbs new file mode 100644 index 000000000..5b980100f --- /dev/null +++ b/tests/auto/language/testdata/erroneous/module-with-id.qbs @@ -0,0 +1,4 @@ +Product { + name: "p" + Depends { name: "module-with-id" } +} diff --git a/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file-module.qbs b/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file-module.qbs new file mode 100644 index 000000000..31302b5c2 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file-module.qbs @@ -0,0 +1,3 @@ +import "missing-js-file.js" as MissingJsFile + +Module { } diff --git a/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file.js b/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file.js new file mode 100644 index 000000000..b66048a8f --- /dev/null +++ b/tests/auto/language/testdata/erroneous/modules/missing-js-file-module/missing-js-file.js @@ -0,0 +1 @@ +var userfile = require("javascriptfile.js") diff --git a/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithId.qbs b/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithId.qbs new file mode 100644 index 000000000..d20b96784 --- /dev/null +++ b/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithId.qbs @@ -0,0 +1 @@ +ModuleWithIdParent { id: foo } diff --git a/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithIdParent.qbs b/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithIdParent.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/erroneous/modules/module-with-id/ModuleWithIdParent.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/erroneous/original-in-export-item.qbs b/tests/auto/language/testdata/erroneous/original-in-export-item.qbs index 51fedb9a2..c83601cfb 100644 --- a/tests/auto/language/testdata/erroneous/original-in-export-item.qbs +++ b/tests/auto/language/testdata/erroneous/original-in-export-item.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/language/testdata/erroneous/original-in-export-item2.qbs b/tests/auto/language/testdata/erroneous/original-in-export-item2.qbs index d932d4aee..1c9f3de4b 100644 --- a/tests/auto/language/testdata/erroneous/original-in-export-item2.qbs +++ b/tests/auto/language/testdata/erroneous/original-in-export-item2.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/language/testdata/erroneous/original-in-export-item3.qbs b/tests/auto/language/testdata/erroneous/original-in-export-item3.qbs index d7bcb322e..d23ad0a08 100644 --- a/tests/auto/language/testdata/erroneous/original-in-export-item3.qbs +++ b/tests/auto/language/testdata/erroneous/original-in-export-item3.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs b/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs index e7128092a..00661fb66 100644 --- a/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs +++ b/tests/auto/language/testdata/erroneous/original-in-module-prototype.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "module-with-invalid-original" } } diff --git a/tests/auto/language/testdata/erroneous/properties-item-with-invalid-condition.qbs b/tests/auto/language/testdata/erroneous/properties-item-with-invalid-condition.qbs index 5b1a41f1b..0b48731ae 100644 --- a/tests/auto/language/testdata/erroneous/properties-item-with-invalid-condition.qbs +++ b/tests/auto/language/testdata/erroneous/properties-item-with-invalid-condition.qbs @@ -1,7 +1,7 @@ Product { Depends { name: "cpp" } Properties { - condition: cpp.nonexistingproperty.contains("somevalue") + condition: cpp.nonexistingproperty.includes("somevalue") cpp.defines: ["ABC"] } } diff --git a/tests/auto/language/testdata/eval-error-in-non-present-module.qbs b/tests/auto/language/testdata/eval-error-in-non-present-module.qbs index c112bc6d4..6882a2216 100644 --- a/tests/auto/language/testdata/eval-error-in-non-present-module.qbs +++ b/tests/auto/language/testdata/eval-error-in-non-present-module.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" property bool moduleRequired diff --git a/tests/auto/language/testdata/exports.qbs b/tests/auto/language/testdata/exports.qbs index cc86b1e4a..0071aadce 100644 --- a/tests/auto/language/testdata/exports.qbs +++ b/tests/auto/language/testdata/exports.qbs @@ -1,7 +1,8 @@ import "exports_product.qbs" as ProductWithInheritedExportItem Project { - Application { + Product { + type: "app" name: "myapp" Depends { name: "mylib" } Depends { name: "dummy" } @@ -15,30 +16,35 @@ Project { "subdir2/exports-mylib2.qbs" ] - Application { + Product { + type: "app" name: "A" Depends { name: "qbs" } Depends { name: "B" } } - StaticLibrary { + Product { + type: "lib" name: "B" Export { Depends { name: "C" } Depends { name: "qbs" } } } - StaticLibrary { + Product { + type: "lib" name: "C" Export { Depends { name: "D" } Depends { name: "qbs" } } } - StaticLibrary { + Product { + type: "lib" name: "D" } - Application { + Product { + type: "app" name: "myapp2" Depends { name: "productWithInheritedExportItem" } Depends { name: "qbs" } @@ -46,7 +52,7 @@ Project { ProductWithInheritedExportItem { name: "productWithInheritedExportItem" Export { - dummy.cFlags: base.concat("PRODUCT_" + product.name.toUpperCase()) + dummy.cFlags: base.concat("PRODUCT_" + exportingProduct.name.toUpperCase()) dummy.cxxFlags: ["-bar"] Properties { condition: true @@ -54,7 +60,8 @@ Project { } } } - Application { + Product { + type: "app" name: "myapp3" Depends { name: "productWithInheritedExportItem"; versionAtLeast: "2.0" } } @@ -125,7 +132,7 @@ Project { Export { property bool depend: false - property var config: product.config + property var config: exportingProduct.config Depends { condition: depend; name: "cpp" } Properties { condition: depend; cpp.includePaths: ["."] } } @@ -142,8 +149,9 @@ Project { name: "broken_cycle1" Export { property bool depend: true - Depends { name: "broken_cycle3"; condition: depend } } + Depends { name: "broken_cycle3"; condition: depend } } + } Product { name: "broken_cycle2" Export { diff --git a/tests/auto/language/testdata/exports_product.qbs b/tests/auto/language/testdata/exports_product.qbs index dc4c9f462..394d388d9 100644 --- a/tests/auto/language/testdata/exports_product.qbs +++ b/tests/auto/language/testdata/exports_product.qbs @@ -2,7 +2,7 @@ Product { Export { version: "2.0" Depends { name: "dummy" } - dummy.cFlags: ["BASE_" + product.name.toUpperCase()] + dummy.cFlags: ["BASE_" + exportingProduct.name.toUpperCase()] dummy.cxxFlags: ["-foo"] dummy.defines: ["ABC"] } diff --git a/tests/auto/language/testdata/getNativeSetting.qbs b/tests/auto/language/testdata/getNativeSetting.qbs index 975aefebc..73af01316 100644 --- a/tests/auto/language/testdata/getNativeSetting.qbs +++ b/tests/auto/language/testdata/getNativeSetting.qbs @@ -1,15 +1,17 @@ import qbs.FileInfo import qbs.Utilities +import qbs.Host + Project { Product { name: "p1" targetName: { - if (qbs.hostOS.contains("macos")) { + if (Host.os().includes("macos")) { return Utilities.getNativeSetting("/System/Library/CoreServices/SystemVersion.plist", "ProductName"); - } else if (qbs.hostOS.contains("windows")) { + } else if (Host.os().includes("windows")) { var productName = Utilities.getNativeSetting("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion", "ProductName"); - if (productName.contains("Windows")) { + if (productName.includes("Windows")) { return "Windows"; } return undefined; diff --git a/tests/auto/language/testdata/groupconditions.qbs b/tests/auto/language/testdata/groupconditions.qbs index b7f383d45..4f55db9cd 100644 --- a/tests/auto/language/testdata/groupconditions.qbs +++ b/tests/auto/language/testdata/groupconditions.qbs @@ -43,7 +43,7 @@ Project { Product { name: "condition_accessing_module_property" Group { - condition: qbs.targetOS.contains("narf") + condition: qbs.targetOS.includes("narf") files: ["main.cpp"] qbs.install: false } diff --git a/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs b/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs index 5ac15658c..d129dc9db 100644 --- a/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs +++ b/tests/auto/language/testdata/inherited-properties-items/imports/DebugName.qbs @@ -1,5 +1,3 @@ -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 index e33c5652b..57ab96a7e 100644 --- a/tests/auto/language/testdata/inherited-properties-items/imports/ReleaseName.qbs +++ b/tests/auto/language/testdata/inherited-properties-items/imports/ReleaseName.qbs @@ -1,5 +1,3 @@ -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 index c20f045c8..6d148ba53 100644 --- 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 @@ -1,5 +1,3 @@ -import qbs - Product { name: "product_default" DebugName {} 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 index 40d41c2fb..52f7ffc00 100644 --- a/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items.qbs +++ b/tests/auto/language/testdata/inherited-properties-items/inherited-properties-items.qbs @@ -1,5 +1,3 @@ -import qbs - Project { qbsSearchPaths: sourceDirectory references: "inherited-properties-items-product.qbs" diff --git a/tests/auto/language/testdata/invalid-prop-on-non-required-module/invalid-prop-on-non-required-module.qbs b/tests/auto/language/testdata/invalid-prop-on-non-required-module/invalid-prop-on-non-required-module.qbs new file mode 100644 index 000000000..80ae6ad93 --- /dev/null +++ b/tests/auto/language/testdata/invalid-prop-on-non-required-module/invalid-prop-on-non-required-module.qbs @@ -0,0 +1,19 @@ +Project { + property bool useExistingModule + + Product { + name: "a" + condition: project.useExistingModule + Depends { name: "deploader" } + Depends { name: "dep" } + dep.nosuchprop: true + } + + Product { + name: "b" + condition: !project.useExistingModule + Depends { name: "deploader" } + Depends { name: "random"; required: false } + random.nosuchprop: true + } +} diff --git a/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/dep/dep.qbs b/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/dep/dep.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/dep/dep.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/deploader/deploader.qbs b/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/deploader/deploader.qbs new file mode 100644 index 000000000..15a1b5309 --- /dev/null +++ b/tests/auto/language/testdata/invalid-prop-on-non-required-module/modules/deploader/deploader.qbs @@ -0,0 +1,7 @@ +Module { + // This indirection exists to properly model QBS-1776. + // "deploader" corresponds to "bundle", and "dep" corresponds to "codesign" + Depends { condition: project.useExistingModule; name: "dep"; required: false } + + Depends { condition: !project.useExistingModule; name: "random"; required: false } +} diff --git a/tests/auto/language/testdata/jsextensions.js b/tests/auto/language/testdata/jsextensions.js index df74a263b..5c5821e86 100644 --- a/tests/auto/language/testdata/jsextensions.js +++ b/tests/auto/language/testdata/jsextensions.js @@ -57,9 +57,9 @@ var a = ["one", "two", "three"]; initTestContext("Array.prototype.contains"); for (var k in a) verify(k !== "contains"); -verify(a.contains("one")); -verify(a.contains("two")); -verify(a.contains("three")); -verify(!a.contains("four")); +verify(a.includes("one")); +verify(a.includes("two")); +verify(a.includes("three")); +verify(!a.includes("four")); })() // END function wrapper diff --git a/tests/auto/language/testdata/local-profile-as-top-level-profile.qbs b/tests/auto/language/testdata/local-profile-as-top-level-profile.qbs new file mode 100644 index 000000000..9bca3c599 --- /dev/null +++ b/tests/auto/language/testdata/local-profile-as-top-level-profile.qbs @@ -0,0 +1,7 @@ +Product { + Profile { + name: "test-profile" + qbs.architecture: "arm" + qbs.targetPlatform: "macos" + } +} diff --git a/tests/auto/language/testdata/erroneous/module-depends-on-product.qbs b/tests/auto/language/testdata/module-depends-on-product.qbs index a7db9e036..a7db9e036 100644 --- a/tests/auto/language/testdata/erroneous/module-depends-on-product.qbs +++ b/tests/auto/language/testdata/module-depends-on-product.qbs diff --git a/tests/auto/language/testdata/module-name-collisions/complex-collision.qbs b/tests/auto/language/testdata/module-name-collisions/complex-collision.qbs new file mode 100644 index 000000000..cd55aa946 --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/complex-collision.qbs @@ -0,0 +1,4 @@ +Product { + Depends { name: "prefix1.middle1" } + Depends { name: "prefix1.middle1.suffix1" } +} diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/middle1.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/middle1.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/middle1.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix1/suffix1.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix1/suffix1.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix1/suffix1.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix2/suffix2.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix2/suffix2.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle1/suffix2/suffix2.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle2/suffix/suffix.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle2/suffix/suffix.qbs new file mode 100644 index 000000000..5e45122de --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/middle2/suffix/suffix.qbs @@ -0,0 +1 @@ +Module {} diff --git a/tests/auto/language/testdata/erroneous/modules/prefix1/prefix1.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/prefix1.qbs index 84957060c..84957060c 100644 --- a/tests/auto/language/testdata/erroneous/modules/prefix1/prefix1.qbs +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/prefix1.qbs diff --git a/tests/auto/language/testdata/erroneous/modules/prefix1/suffix/suffix.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/suffix/suffix.qbs index 218a4feb7..218a4feb7 100644 --- a/tests/auto/language/testdata/erroneous/modules/prefix1/suffix/suffix.qbs +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix1/suffix/suffix.qbs diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix2/prefix2.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix2/prefix2.qbs new file mode 100644 index 000000000..a5aaa6f8b --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix2/prefix2.qbs @@ -0,0 +1,3 @@ +Module { + Depends { name: "prefix2.suffix" } +} diff --git a/tests/auto/language/testdata/module-name-collisions/modules/prefix2/suffix/suffix.qbs b/tests/auto/language/testdata/module-name-collisions/modules/prefix2/suffix/suffix.qbs new file mode 100644 index 000000000..84957060c --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/modules/prefix2/suffix/suffix.qbs @@ -0,0 +1,2 @@ +Module { +} diff --git a/tests/auto/language/testdata/module-name-collisions/no-collision1.qbs b/tests/auto/language/testdata/module-name-collisions/no-collision1.qbs new file mode 100644 index 000000000..e5a94ad66 --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/no-collision1.qbs @@ -0,0 +1,4 @@ +Product { + Depends { name: "prefix1.middle1.suffix1" } + Depends { name: "prefix1.middle1.suffix2" } +} diff --git a/tests/auto/language/testdata/module-name-collisions/no-collision2.qbs b/tests/auto/language/testdata/module-name-collisions/no-collision2.qbs new file mode 100644 index 000000000..664ec1729 --- /dev/null +++ b/tests/auto/language/testdata/module-name-collisions/no-collision2.qbs @@ -0,0 +1,4 @@ +Product { + Depends { name: "prefix1.middle1" } + Depends { name: "prefix1.middle2.suffix" } +} diff --git a/tests/auto/language/testdata/erroneous/same-module-prefix1.qbs b/tests/auto/language/testdata/module-name-collisions/simple-collision1.qbs index 8aba31c2a..8aba31c2a 100644 --- a/tests/auto/language/testdata/erroneous/same-module-prefix1.qbs +++ b/tests/auto/language/testdata/module-name-collisions/simple-collision1.qbs diff --git a/tests/auto/language/testdata/erroneous/same-module-prefix2.qbs b/tests/auto/language/testdata/module-name-collisions/simple-collision2.qbs index 6679091c2..6679091c2 100644 --- a/tests/auto/language/testdata/erroneous/same-module-prefix2.qbs +++ b/tests/auto/language/testdata/module-name-collisions/simple-collision2.qbs diff --git a/tests/auto/language/testdata/module-parameters/module-parameters.qbs b/tests/auto/language/testdata/module-parameters/module-parameters.qbs new file mode 100644 index 000000000..48169d601 --- /dev/null +++ b/tests/auto/language/testdata/module-parameters/module-parameters.qbs @@ -0,0 +1,35 @@ +Project { + property bool overrideFromModule + property bool overrideFromExport + property bool overrideFromProduct + + Product { + name: "dep" + Export { + Depends { + name: "higher"; + condition: project.overrideFromExport + lower.param: "fromExportDepends" + } + Parameters { lower.param: "fromParameters" } + } + } + Product { + name: "main" + + Depends { + name: "dep" + condition: project.overrideFromProduct + lower.param: "fromProductDepends" + } + Depends { + name: "higher" + condition: project.overrideFromProduct + lower.param: "fromProductDepends" + } + Depends { name: "dep"; condition: !project.overrideFromProduct } + Depends { name: "higher"; condition: !project.overrideFromProduct } + Depends { name: "highest" } + Depends { name: "broken"; required: false } + } +} diff --git a/tests/auto/language/testdata/module-parameters/modules/broken/broken.qbs b/tests/auto/language/testdata/module-parameters/modules/broken/broken.qbs new file mode 100644 index 000000000..ae7b4c4ef --- /dev/null +++ b/tests/auto/language/testdata/module-parameters/modules/broken/broken.qbs @@ -0,0 +1,4 @@ +Module { + Depends { name: "higher"; lower.param: "shouldNeverAppear" } + validate: { throw "As the name indicates, this module is broken."; } +} diff --git a/tests/auto/language/testdata/module-parameters/modules/higher/higher.qbs b/tests/auto/language/testdata/module-parameters/modules/higher/higher.qbs new file mode 100644 index 000000000..006e05a93 --- /dev/null +++ b/tests/auto/language/testdata/module-parameters/modules/higher/higher.qbs @@ -0,0 +1,4 @@ +Module { + Depends { name: "lower" } + Parameters { lower.param: "fromParameters" } +} diff --git a/tests/auto/language/testdata/module-parameters/modules/highest/highest.qbs b/tests/auto/language/testdata/module-parameters/modules/highest/highest.qbs new file mode 100644 index 000000000..83b0a0a03 --- /dev/null +++ b/tests/auto/language/testdata/module-parameters/modules/highest/highest.qbs @@ -0,0 +1,7 @@ +Module { + Depends { + name: "higher" + condition: project.overrideFromModule + lower.param: "fromModuleDepends" + } +} diff --git a/tests/auto/language/testdata/module-parameters/modules/lower/lower.qbs b/tests/auto/language/testdata/module-parameters/modules/lower/lower.qbs new file mode 100644 index 000000000..11436ecd8 --- /dev/null +++ b/tests/auto/language/testdata/module-parameters/modules/lower/lower.qbs @@ -0,0 +1,3 @@ +Module { + Parameter { property string param: "origin" } +} diff --git a/tests/auto/language/testdata/modulepropertiesingroups.qbs b/tests/auto/language/testdata/modulepropertiesingroups.qbs index e3857bdf4..49f24c0ca 100644 --- a/tests/auto/language/testdata/modulepropertiesingroups.qbs +++ b/tests/auto/language/testdata/modulepropertiesingroups.qbs @@ -80,4 +80,13 @@ Project { } } } + + Product { + name: "module-property-in-group-condition" + Depends { name: "cpp" } + Group { + condition: qbs.architecture === "x86_64" + cpp.includePaths: "." + } + } } diff --git a/tests/auto/language/testdata/modules/broken/broken.qbs b/tests/auto/language/testdata/modules/broken/broken.qbs index b960117cf..a80547340 100644 --- a/tests/auto/language/testdata/modules/broken/broken.qbs +++ b/tests/auto/language/testdata/modules/broken/broken.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Probe { id: theProbe diff --git a/tests/auto/language/testdata/modules/dummy/dummy.qbs b/tests/auto/language/testdata/modules/dummy/dummy.qbs index b1791ac96..623abc413 100644 --- a/tests/auto/language/testdata/modules/dummy/dummy.qbs +++ b/tests/auto/language/testdata/modules/dummy/dummy.qbs @@ -16,7 +16,7 @@ DummyBase { property string zort: "zort in dummy" property pathList includePaths property path somePath - property stringList listProp: product.type.contains("blubb") ? ["123"] : ["456"] + property stringList listProp: product.type.includes("blubb") ? ["123"] : ["456"] property bool controllingProp: false property stringList listProp2: controllingProp diff --git a/tests/auto/language/testdata/modules/dummyqt/core/dummycore.qbs b/tests/auto/language/testdata/modules/dummyqt/core/dummycore.qbs index 746c7e37b..2764af9c2 100644 --- a/tests/auto/language/testdata/modules/dummyqt/core/dummycore.qbs +++ b/tests/auto/language/testdata/modules/dummyqt/core/dummycore.qbs @@ -1,11 +1,10 @@ Module { - id: qtcore property int versionMajor: 5 property int versionMinor: 0 property int versionPatch: 0 property string version: versionMajor.toString() + "." + versionMinor.toString() + "." + versionPatch.toString() property string coreProperty: "coreProperty" - property string coreVersion: qtcore.version + property string coreVersion: version property string zort: "zort in dummyqt.core" Depends { name: "dummy" } diff --git a/tests/auto/language/testdata/erroneous/modules/module-with-product-dependency/module-with-product-dependency.qbs b/tests/auto/language/testdata/modules/module-with-product-dependency/module-with-product-dependency.qbs index 5781bd6de..5781bd6de 100644 --- a/tests/auto/language/testdata/erroneous/modules/module-with-product-dependency/module-with-product-dependency.qbs +++ b/tests/auto/language/testdata/modules/module-with-product-dependency/module-with-product-dependency.qbs diff --git a/tests/auto/language/testdata/modules/multiple_backends/backend1.qbs b/tests/auto/language/testdata/modules/multiple_backends/backend1.qbs index 794c67827..4f78a89ae 100644 --- a/tests/auto/language/testdata/modules/multiple_backends/backend1.qbs +++ b/tests/auto/language/testdata/modules/multiple_backends/backend1.qbs @@ -1,4 +1,4 @@ Module { - condition: qbs.targetOS.contains("os1") + condition: qbs.targetOS.includes("os1") property string prop: "backend 1" } diff --git a/tests/auto/language/testdata/modules/multiple_backends/backend2.qbs b/tests/auto/language/testdata/modules/multiple_backends/backend2.qbs index 2073c4d0b..e7a44d4c7 100644 --- a/tests/auto/language/testdata/modules/multiple_backends/backend2.qbs +++ b/tests/auto/language/testdata/modules/multiple_backends/backend2.qbs @@ -1,5 +1,5 @@ Module { - condition: qbs.targetOS.contains("os2") + condition: qbs.targetOS.includes("os2") property string prop: "backend 2" property string backend2Prop } diff --git a/tests/auto/language/testdata/modules/multiple_backends/backend3.qbs b/tests/auto/language/testdata/modules/multiple_backends/backend3.qbs index 16228108b..762c12f20 100644 --- a/tests/auto/language/testdata/modules/multiple_backends/backend3.qbs +++ b/tests/auto/language/testdata/modules/multiple_backends/backend3.qbs @@ -1,5 +1,5 @@ Module { - condition: qbs.targetOS.contains("os2") && qbs.toolchain.contains("tc") + condition: qbs.targetOS.includes("os2") && qbs.toolchain.includes("tc") priority: 1 property string backend3Prop } diff --git a/tests/auto/language/testdata/multiplexed-exports.qbs b/tests/auto/language/testdata/multiplexed-exports.qbs index f98ceff95..3252145f1 100644 --- a/tests/auto/language/testdata/multiplexed-exports.qbs +++ b/tests/auto/language/testdata/multiplexed-exports.qbs @@ -6,7 +6,7 @@ Project { property string includeDir: qbs.buildVariant === "debug" ? "/d" : "/r" Export { Depends { name: "cpp" } - cpp.includePaths: product.includeDir + cpp.includePaths: exportingProduct.includeDir } } Product { diff --git a/tests/auto/language/testdata/probes-and-multiplexing.qbs b/tests/auto/language/testdata/probes-and-multiplexing.qbs new file mode 100644 index 000000000..38de08aee --- /dev/null +++ b/tests/auto/language/testdata/probes-and-multiplexing.qbs @@ -0,0 +1,15 @@ +Product { + multiplexByQbsProperties: "architectures" + qbs.architectures: ["x86", "x86_64", "arm"] + property string archFromProbe: theProbe.archOut + Probe { + id: theProbe + property string archIn: qbs.architecture + property string archOut + configure: { archOut = archIn; } + } + Group { + name: "theGroup" + qbs.sysroot: "/" + theProbe.archOut + } +} diff --git a/tests/auto/language/testdata/profilevaluesandoverriddenvalues.qbs b/tests/auto/language/testdata/profilevaluesandoverriddenvalues.qbs index 3aaa0cfa9..a0f189403 100644 --- a/tests/auto/language/testdata/profilevaluesandoverriddenvalues.qbs +++ b/tests/auto/language/testdata/profilevaluesandoverriddenvalues.qbs @@ -1,5 +1,5 @@ Project { - Application { + Product { name: "product1" property bool dummyProp: { if (!(dummy.cFlags instanceof Array)) diff --git a/tests/auto/language/testdata/qbs-properties-in-project-condition.qbs b/tests/auto/language/testdata/qbs-properties-in-project-condition.qbs index 31f648233..9d27df254 100644 --- a/tests/auto/language/testdata/qbs-properties-in-project-condition.qbs +++ b/tests/auto/language/testdata/qbs-properties-in-project-condition.qbs @@ -1,5 +1,5 @@ Project { - condition: qbs.targetOS.contains("whatever") + condition: qbs.targetOS.includes("whatever") Product { name: "never reached" diff --git a/tests/auto/language/testdata/rfc1034identifier.qbs b/tests/auto/language/testdata/rfc1034identifier.qbs index 4d320f899..e52dcc6b2 100644 --- a/tests/auto/language/testdata/rfc1034identifier.qbs +++ b/tests/auto/language/testdata/rfc1034identifier.qbs @@ -3,7 +3,7 @@ import qbs.Utilities CppApplication { name: Utilities.rfc1034Identifier("this!has@special#characters$uh-oh,Undersc0r3s_Are.Bad") Properties { - condition: qbs.targetOS.contains("darwin") + condition: qbs.targetOS.includes("darwin") bundle.infoPlist: { return {"CFBundleIdentifier": "$(PRODUCT_NAME:rfc1034identifier)"}; } } } diff --git a/tests/auto/language/testdata/subdir/exports-mylib.qbs b/tests/auto/language/testdata/subdir/exports-mylib.qbs index 92f39483a..68ea30384 100644 --- a/tests/auto/language/testdata/subdir/exports-mylib.qbs +++ b/tests/auto/language/testdata/subdir/exports-mylib.qbs @@ -8,8 +8,8 @@ StaticLibrary { Export { Depends { name: "dummy" } Depends { name: "mylib2" } - dummy.defines: [product.definePrefix + product.name.toUpperCase()] + dummy.defines: [exportingProduct.definePrefix + exportingProduct.name.toUpperCase()] dummy.includePaths: ["./lib"] - dummy.somePath: product.aPath + dummy.somePath: exportingProduct.aPath } } diff --git a/tests/auto/language/testdata/subdir2/exports-mylib2.qbs b/tests/auto/language/testdata/subdir2/exports-mylib2.qbs index ac8b9ebe4..b16b47821 100644 --- a/tests/auto/language/testdata/subdir2/exports-mylib2.qbs +++ b/tests/auto/language/testdata/subdir2/exports-mylib2.qbs @@ -5,7 +5,7 @@ StaticLibrary { property string definePrefix: "USE_" Export { Depends { name: "dummy" } - dummy.defines: [product.definePrefix + product.name.toUpperCase()] + dummy.defines: [exportingProduct.definePrefix + exportingProduct.name.toUpperCase()] dummy.includePaths: ["./lib"] } } diff --git a/tests/auto/language/testdata/suppressed-and-non-suppressed-errors.qbs b/tests/auto/language/testdata/suppressed-and-non-suppressed-errors.qbs index 4d5219157..684cc67b3 100644 --- a/tests/auto/language/testdata/suppressed-and-non-suppressed-errors.qbs +++ b/tests/auto/language/testdata/suppressed-and-non-suppressed-errors.qbs @@ -1,5 +1,5 @@ Project { - CppApplication { + Product { name: "mysterious creature" files: ["easter bunny"] } diff --git a/tests/auto/language/testdata/throw.qbs b/tests/auto/language/testdata/throw.qbs new file mode 100644 index 000000000..e9a97efb5 --- /dev/null +++ b/tests/auto/language/testdata/throw.qbs @@ -0,0 +1,16 @@ +Project { + property string throwType + property bool dummy: { + if (throwType === "bool") + throw true; + if (throwType === "int") + throw 43; + if (throwType === "string") + throw "an error"; + if (throwType === "list") + throw ["an", "error"]; + if (throwType === "object") + throw { result: "crash", reason: "overheating" }; + throw "type missing"; + } +} diff --git a/tests/auto/language/testdata/use-internal-profile.qbs b/tests/auto/language/testdata/use-internal-profile.qbs new file mode 100644 index 000000000..c2e20ff19 --- /dev/null +++ b/tests/auto/language/testdata/use-internal-profile.qbs @@ -0,0 +1,13 @@ +Project { + name: "theproject" + + Profile { + name: "theprofile" + dummy.defines: name + } + + Product { + name: "theproduct" + Depends { name: "dummy" } + } +}
\ No newline at end of file |