diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-01-30 13:47:57 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-01-31 13:50:19 +0000 |
commit | 1474042d931922b81d3a09e95c738e7feafa1a44 (patch) | |
tree | dd7ee4d8a718017d080449e8028a9a412cb59cc1 /tests | |
parent | d61c5f66ff507fb496aeafbae424e5f789afa26a (diff) |
Add failing test for QBS-1287
Change-Id: I6a3222228f822b88d860b5036f459f1a732dc6ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/plugin-dependency/helper1.cpp | 16 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/plugin-dependency/helper2.cpp (renamed from tests/auto/blackbox/testdata/plugin-dependency/helper.cpp) | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/plugin-dependency/main.cpp | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs | 20 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 7 |
5 files changed, 42 insertions, 9 deletions
diff --git a/tests/auto/blackbox/testdata/plugin-dependency/helper1.cpp b/tests/auto/blackbox/testdata/plugin-dependency/helper1.cpp new file mode 100644 index 000000000..72331da80 --- /dev/null +++ b/tests/auto/blackbox/testdata/plugin-dependency/helper1.cpp @@ -0,0 +1,16 @@ +#include <stdio.h> + +#if defined(_WIN32) || defined(WIN32) +# define EXPORT __declspec(dllexport) +#else +# define EXPORT +#endif + +#ifndef USING_HELPER2 +#error define USING_HELPER2 missing +#endif + +EXPORT void helper1_hello() +{ + puts("helper1 says hello!"); +} diff --git a/tests/auto/blackbox/testdata/plugin-dependency/helper.cpp b/tests/auto/blackbox/testdata/plugin-dependency/helper2.cpp index 3a7f851f4..46cca92df 100644 --- a/tests/auto/blackbox/testdata/plugin-dependency/helper.cpp +++ b/tests/auto/blackbox/testdata/plugin-dependency/helper2.cpp @@ -6,7 +6,7 @@ # define EXPORT #endif -EXPORT void helper_hello() +EXPORT void helper2_hello() { - puts("helper says hello!"); + puts("Hello from helper2!"); } diff --git a/tests/auto/blackbox/testdata/plugin-dependency/main.cpp b/tests/auto/blackbox/testdata/plugin-dependency/main.cpp index 048adf952..f1be3f5e2 100644 --- a/tests/auto/blackbox/testdata/plugin-dependency/main.cpp +++ b/tests/auto/blackbox/testdata/plugin-dependency/main.cpp @@ -6,12 +6,12 @@ IMPORT void plugin3_hello(); IMPORT void plugin4_hello(); -IMPORT void helper_hello(); +IMPORT void helper1_hello(); int main() { plugin3_hello(); plugin4_hello(); - helper_hello(); + helper1_hello(); return 0; } diff --git a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs index a12aceccd..3ae2f3c9a 100644 --- a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs +++ b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs @@ -15,7 +15,7 @@ Project { cpp.link: /*theCondition && */product.name === "myapp" // TODO: Make this work } Depends { name: "plugin4" } // supposed to be linked - Depends { name: "helper" } // supposed to be linked + Depends { name: "helper1" } // supposed to be linked } DynamicLibrary { name: "plugin1" @@ -54,8 +54,22 @@ Project { } } DynamicLibrary { - name: "helper" - files: ["helper.cpp"] + name: "helper1" + files: ["helper1.cpp"] Depends { name: "cpp" } + Depends { name: "helper2"; cpp.link: false } + Export { + Depends { name: "cpp" } + Depends { name: "helper2"; cpp.link: false } + } + } + DynamicLibrary { + name: "helper2" + files: ["helper2.cpp"] + Depends { name: "cpp" } + Export { + Depends { name: "cpp" } + cpp.defines: ["USING_HELPER2"] + } } } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index ddba191cb..fdccf7467 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2364,18 +2364,21 @@ void TestBlackbox::pluginDependency() { QDir::setCurrent(testDataDir + "/plugin-dependency"); - // Build the plugin. - QCOMPARE(runQbs(QStringList{"--products", "plugin1,plugin2,plugin3,plugin4"}), 0); + // Build the plugins and the helper2 lib. + QCOMPARE(runQbs(QStringList{"--products", "plugin1,plugin2,plugin3,plugin4,helper2"}), 0); QVERIFY(m_qbsStdout.contains("plugin1")); QVERIFY(m_qbsStdout.contains("plugin2")); QVERIFY(m_qbsStdout.contains("plugin3")); QVERIFY(m_qbsStdout.contains("plugin4")); + QVERIFY(m_qbsStdout.contains("helper2")); // Build the app. Plugins 1 and 2 must not be linked. Plugin 3 must be linked. QCOMPARE(runQbs(QStringList{"--command-echo-mode", "command-line"}), 0); QByteArray output = m_qbsStdout + '\n' + m_qbsStderr; QVERIFY(!output.contains("plugin1")); QVERIFY(!output.contains("plugin2")); + QEXPECT_FAIL("", "QBS-1287", Continue); + QVERIFY(!output.contains("helper2")); // Check that the build dependency still works. QCOMPARE(runQbs(QStringLiteral("clean")), 0); |