summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata/external-libs/external-libs.qbs62
-rw-r--r--tests/auto/blackbox/testdata/external-libs/lib1.cpp1
-rw-r--r--tests/auto/blackbox/testdata/external-libs/lib2.cpp3
-rw-r--r--tests/auto/blackbox/testdata/external-libs/main.cpp6
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp6
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
6 files changed, 79 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs
new file mode 100644
index 000000000..9a5bbdd6b
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs
@@ -0,0 +1,62 @@
+import qbs
+import qbs.TextFile
+
+Project {
+ property string libDir: sourceDirectory + "/libs"
+ StaticLibrary {
+ name: "lib1"
+ destinationDirectory: project.libDir
+ Depends { name: "cpp" }
+ files: ["lib1.cpp"]
+ }
+ StaticLibrary {
+ name: "lib2"
+ destinationDirectory: project.libDir
+ Depends { name: "cpp" }
+ Depends { name: "lib1" }
+ files: ["lib2.cpp"]
+ }
+ // TODO: Remove once we have parameterized dependencies
+ Product {
+ name: "barrier"
+ type: ["blubb"]
+ Depends { name: "lib1" }
+ Depends { name: "lib2" }
+ Rule {
+ multiplex: true
+ inputsFromDependencies: ["staticlibrary"]
+ Artifact {
+ filePath: "dummy"
+ fileTags: ["blubb"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.silent = true;
+ cmd.sourceCode = function() { }
+ return [cmd];
+ }
+ }
+ }
+ CppApplication {
+ Depends { name: "barrier" }
+ files: ["main.cpp"]
+ cpp.libraryPaths: [project.libDir]
+ cpp.staticLibraries: ["lib1", "lib2", "lib1"]
+ Rule {
+ inputsFromDependencies: ["blubb"]
+ Artifact {
+ filePath: "dummy.cpp"
+ fileTags: ["cpp"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.sourceCode = function() {
+ var f = new TextFile(output.filePath, TextFile.WriteOnly);
+ f.writeLine("void dummy() { }");
+ f.close();
+ };
+ return [cmd];
+ }
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/external-libs/lib1.cpp b/tests/auto/blackbox/testdata/external-libs/lib1.cpp
new file mode 100644
index 000000000..bb69fa422
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/lib1.cpp
@@ -0,0 +1 @@
+void func_lib1() { }
diff --git a/tests/auto/blackbox/testdata/external-libs/lib2.cpp b/tests/auto/blackbox/testdata/external-libs/lib2.cpp
new file mode 100644
index 000000000..e669a7f6c
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/lib2.cpp
@@ -0,0 +1,3 @@
+void func_lib1();
+
+void func_lib2() { func_lib1(); }
diff --git a/tests/auto/blackbox/testdata/external-libs/main.cpp b/tests/auto/blackbox/testdata/external-libs/main.cpp
new file mode 100644
index 000000000..9a6eab23e
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/main.cpp
@@ -0,0 +1,6 @@
+void func_lib2();
+
+int main()
+{
+ func_lib2();
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index fe405a502..444dcfd38 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -2791,6 +2791,12 @@ void TestBlackbox::exportToOutsideSearchPath()
"dependencies for product 'theProduct'"), m_qbsStderr.constData());
}
+void TestBlackbox::externalLibs()
+{
+ QDir::setCurrent(testDataDir + "/external-libs");
+ QCOMPARE(runQbs(), 0);
+}
+
void TestBlackbox::fileDependencies()
{
QDir::setCurrent(testDataDir + "/fileDependencies");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index a11f87343..7a4a0cb67 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -83,6 +83,7 @@ private slots:
void escapedLinkerFlags();
void exportRule();
void exportToOutsideSearchPath();
+ void externalLibs();
void fileDependencies();
void frameworkStructure();
void generatedArtifactAsInputToDynamicRule();