diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-08 14:55:29 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-06-08 15:13:47 +0200 |
commit | 073fda0ab536b5610ff1b9191db582791552509e (patch) | |
tree | 16f0bbacc116e93778e9490ba2c2d9efff738d35 /tests/auto/blackbox/testdata | |
parent | 9349866b37118db9179d1f0689e872ca1260f040 (diff) | |
parent | 5f71b2220f9ff6838799c407972309bff1e8fc96 (diff) |
Merge 1.12 into master
Change-Id: I0c914674c0728a7f7bc70fd9608914b95ef55a30
Diffstat (limited to 'tests/auto/blackbox/testdata')
18 files changed, 290 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs b/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs new file mode 100644 index 000000000..8aef7b9b6 --- /dev/null +++ b/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs @@ -0,0 +1,42 @@ +import qbs + +Project { + Product { + name: "p1" + type: "p1" + Rule { + alwaysRun: true + multiplex: true + Artifact { + fileTags: "p1" + filePath: "p1-dummy" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() {}; + return cmd; + } + } + } + Product { + name: "p2" + type: "p2" + Depends { name: "p1" } + Rule { + requiresInputs: false + multiplex: true + inputsFromDependencies: "p1" + Artifact { + fileTags: "p2" + filePath: "p2-dummy" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() {}; + return cmd; + } + } + } +} diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib.pc b/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib.pc new file mode 100644 index 000000000..6a83a6b37 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib.pc @@ -0,0 +1,10 @@ +prefix=/opt/the firstlib + +Name: TheFirstLib +Description: TheFirstLib +Version: 1.0 +URL: http://www.example.com/thefirstlib +Cflags: -DTheFirstLib -I"${prefix}/include" -pthread -DHAVE_INDUSTRIAL_STRENGTH_HAIR_DRYER -I/otherdir/include1 -I/otherdir/include2 +Libs: -L"${prefix}/lib" -lTheFirstLib -pthread +Requires: Qt5Core +Requires.private: SomeHelper diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib_windows.pc b/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib_windows.pc new file mode 100644 index 000000000..3c730a0ad --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/TheFirstLib_windows.pc @@ -0,0 +1,10 @@ +prefix=/opt/the firstlib + +Name: TheFirstLib +Description: TheFirstLib +Version: 1.0 +URL: http://www.example.com/thefirstlib +Cflags: -DTheFirstLib -I"${prefix}/include" -DHAVE_INDUSTRIAL_STRENGTH_HAIR_DRYER -I/otherdir/include1 -I/otherdir/include2 +Libs: -L"${prefix}/lib" -lTheFirstLib +Requires: Qt5Core +Requires.private: SomeHelper diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/TheSecondLib.pc b/tests/auto/blackbox/testdata/exports-pkgconfig/TheSecondLib.pc new file mode 100644 index 000000000..6c54b451e --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/TheSecondLib.pc @@ -0,0 +1,9 @@ +config1=a b +config2=c + +Name: TheSecondLib +Description: The second lib +Version: 2.0 +Cflags: -I/opt/thesecondlib/include +Libs: -L/opt/thesecondlib/lib -lTheSecondLib +Requires: TheFirstLib diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/boringstaticlib.cpp b/tests/auto/blackbox/testdata/exports-pkgconfig/boringstaticlib.cpp new file mode 100644 index 000000000..559a0ecfa --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/boringstaticlib.cpp @@ -0,0 +1 @@ +int calculateLuckyNumber() { return 12 * 13; } diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs new file mode 100644 index 000000000..674f78c94 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs @@ -0,0 +1,124 @@ +import qbs +import qbs.FileInfo + +Project { + Product { + name: "dummy" + Export { Depends { name: "TheFirstLib" } } + } + + Product { + name: "SomeHelper" + Depends { name: "Exporter.pkgconfig" } + Exporter.pkgconfig.versionEntry: "1.0" + } + StaticLibrary { + Depends { name: "cpp" } + name: "BoringStaticLib" + files: ["boringstaticlib.cpp"] + Export { + Depends { name: "cpp" } + cpp.defines: ["HAVE_INDUSTRIAL_STRENGTH_HAIR_DRYER"] + } + } + DynamicLibrary { + name: "TheFirstLib" + version: "1.0" + + Depends { name: "SomeHelper" } + Depends { name: "Exporter.pkgconfig" } + Exporter.pkgconfig.excludedDependencies: ["Qt.core", "helper3"] + Exporter.pkgconfig.requiresEntry: "Qt5Core" + Exporter.pkgconfig.urlEntry: "http://www.example.com/thefirstlib" + + Depends { name: "cpp" } + cpp.defines: ["FIRSTLIB"] + + qbs.installPrefix: "/opt/the firstlib" + + Export { + prefixMapping: [{prefix: "/somedir", replacement: "/otherdir"}] + Depends { name: "BoringStaticLib" } + Depends { name: "cpp" } + Depends { name: "Qt.core"; required: false } + Depends { name: "helper1" } + Depends { name: "helper3" } + property bool someCondition: qbs.hostOS.contains("windows") // hostOS for easier testing + property bool someOtherCondition: someCondition + Properties { + condition: !someOtherCondition + cpp.driverFlags: ["-pthread"] + } + cpp.defines: product.name + cpp.includePaths: [FileInfo.joinPaths(product.qbs.installPrefix, "include")] + Qt.core.mocName: "muck" + } + + Group { + fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] + qbs.install: true + qbs.installDir: "lib" + } + + Group { + name: "api_headers" + files: ["firstlib.h"] + qbs.install: true + qbs.installDir: "include" + } + + files: ["firstlib.cpp"] + } + DynamicLibrary { + name: "TheSecondLib" + version: "2.0" + + Depends { name: "Exporter.pkgconfig" } + Exporter.pkgconfig.descriptionEntry: "The second lib" + Exporter.pkgconfig.transformFunction: (function(product, moduleName, propertyName, value) { + if (moduleName === "cpp" && propertyName === "includePaths") + return value.filter(function(p) { return p !== product.sourceDirectory; }); + return value; + }) + Exporter.pkgconfig.customVariables: ({config1: "a b", config2: "c"}) + + Depends { name: "cpp" } + cpp.defines: ["SECONDLIB"] + + qbs.installPrefix: "" + + Depends { name: "TheFirstLib" } + + Export { + Depends { name: "TheFirstLib" } + Depends { name: "dummy" } + Depends { name: "cpp" } + cpp.includePaths: ["/opt/thesecondlib/include", product.sourceDirectory] + property string hurz: importingProduct.name + + Rule { + property int n: 5 + Artifact { + filePath: "dummy" + fileTags: ["d1", "d2"] + cpp.warningsAreErrors: true + } + } + } + + Group { + fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] + qbs.install: true + qbs.installDir: "/opt/thesecondlib/lib" + } + + Group { + name: "api_headers" + files: ["secondlib.h"] + qbs.install: true + qbs.installDir: "/opt/thesecondlib/include" + } + + files: ["secondlib.cpp"] + } +} diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.cpp b/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.cpp new file mode 100644 index 000000000..ab48afc94 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.cpp @@ -0,0 +1,3 @@ +#include "firstlib.h" + +void firstLib() { } diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.h b/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.h new file mode 100644 index 000000000..1ccfb0868 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/firstlib.h @@ -0,0 +1,9 @@ +#include "../dllexport.h" + +#ifdef FIRSTLIB +# define FIRSTLIB_EXPORT DLL_EXPORT +#else +# define FIRSTLIB_EXPORT DLL_IMPORT +#endif + +FIRSTLIB_EXPORT void firstLib(); diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs new file mode 100644 index 000000000..b753ec295 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs @@ -0,0 +1,7 @@ +import qbs + +Module { + Depends { name: "cpp" } + Depends { name: "helper2" } + cpp.includePaths: "/somedir/include1" +} diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs new file mode 100644 index 000000000..9d24a812d --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs @@ -0,0 +1,6 @@ +import qbs + +Module { + Depends { name: "cpp" } + cpp.includePaths: "/somedir/include2" +} diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs new file mode 100644 index 000000000..452191994 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs @@ -0,0 +1,6 @@ +import qbs + +Module { + Depends { name: "cpp" } + cpp.includePaths: "/somedir/include3" +} diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.cpp b/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.cpp new file mode 100644 index 000000000..e1782f576 --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.cpp @@ -0,0 +1,7 @@ +#include "secondlib.h" + +#ifndef HAVE_INDUSTRIAL_STRENGTH_HAIR_DRYER +# error I CANT LIVE WITHOUT IT! +#endif + +void secondLib() { } diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.h b/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.h new file mode 100644 index 000000000..78b52f7fe --- /dev/null +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/secondlib.h @@ -0,0 +1,9 @@ +#include "../dllexport.h" + +#ifdef SECONDLIB +# define SECONDLIB_EXPORT DLL_EXPORT +#else +# define SECONDLIB_EXPORT DLL_IMPORT +#endif + +SECONDLIB_EXPORT void secondLib(); diff --git a/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs b/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs new file mode 100644 index 000000000..2bff00f35 --- /dev/null +++ b/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs @@ -0,0 +1,23 @@ +import qbs +import MyImport + +Product { + type: "outtype" + property var importValue: MyImport + Rule { + multiplex: true + Artifact { + fileTags: "outtype" + filePath: "dummy" + } + prepare: { + var cmd = new JavaScriptCommand; + cmd.silent = true; + cmd.sourceCode = function() { + console.info("key 1 = " + product.importValue.key1); + console.info("key 2 = " + product.importValue.key2); + }; + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/import-assignment/imports/MyImport/myimport.js b/tests/auto/blackbox/testdata/import-assignment/imports/MyImport/myimport.js new file mode 100644 index 000000000..5befd5151 --- /dev/null +++ b/tests/auto/blackbox/testdata/import-assignment/imports/MyImport/myimport.js @@ -0,0 +1,2 @@ +var key1 = "value1"; +var key2 = "value2"; diff --git a/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs b/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs new file mode 100644 index 000000000..660c088a0 --- /dev/null +++ b/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs @@ -0,0 +1,13 @@ +import qbs + +Product { + name: "p" + multiplexByQbsProperties: "buildVariants" + qbs.buildVariants: ["debug", "release"] + Export { + Probe { + id: dummy + configure: { found = true; } + } + } +} diff --git a/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs b/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs index 049ade899..44d8013b9 100644 --- a/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs +++ b/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs @@ -25,6 +25,14 @@ Project { condition: tcProbe.found name:"app" Depends { name: "lib" } + Depends { name: "staticlib" } files: ["main.cpp"] } + StaticLibrary { + condition: tcProbe.found + name: "staticlib" + Depends { name: "lib" } + Depends { name: "cpp" } + files: "staticlib.cpp" + } } diff --git a/tests/auto/blackbox/testdata/smart-relinking/staticlib.cpp b/tests/auto/blackbox/testdata/smart-relinking/staticlib.cpp new file mode 100644 index 000000000..24fd8c6e9 --- /dev/null +++ b/tests/auto/blackbox/testdata/smart-relinking/staticlib.cpp @@ -0,0 +1 @@ +static void myFunc() {} |