diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-02-26 21:52:43 +0100 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-02-27 12:12:11 +0000 |
commit | b8d463545037f031f7038eb8c34c92b14bfdade9 (patch) | |
tree | 60e4a001165f82c37892f1e11b2fd06d0393e410 /tests | |
parent | 63d10ed08d65d0259c0781af1dd3c964d75a8a85 (diff) |
Fix the error when the last module candidate is not a module
Previously, if the last module candidate was not a module item, the
value of triedToLoadModule was set to 'false'. However, we could try to
load the one of the previous candidates which means that
triedToLoadModule should be set to 'true'
Change-Id: I03278d51804568ebbd4dee93313c16517fd774e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
6 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/last-module-candidate-broken/last-module-candidate-broken.qbs b/tests/auto/blackbox/testdata/last-module-candidate-broken/last-module-candidate-broken.qbs new file mode 100644 index 000000000..db7dc2265 --- /dev/null +++ b/tests/auto/blackbox/testdata/last-module-candidate-broken/last-module-candidate-broken.qbs @@ -0,0 +1,5 @@ +CppApplication { + qbsSearchPaths: "qbs" + Depends { name: "Foo" } + files: "main.cpp" +} diff --git a/tests/auto/blackbox/testdata/last-module-candidate-broken/main.cpp b/tests/auto/blackbox/testdata/last-module-candidate-broken/main.cpp new file mode 100644 index 000000000..76e819701 --- /dev/null +++ b/tests/auto/blackbox/testdata/last-module-candidate-broken/main.cpp @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo1.qbs b/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo1.qbs new file mode 100644 index 000000000..ba08b862b --- /dev/null +++ b/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo1.qbs @@ -0,0 +1,3 @@ +Module { + condition: false +} diff --git a/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo2.qbs b/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo2.qbs new file mode 100644 index 000000000..0bc383b86 --- /dev/null +++ b/tests/auto/blackbox/testdata/last-module-candidate-broken/qbs/modules/Foo/Foo2.qbs @@ -0,0 +1,2 @@ +Group { +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 86108716e..39f89855d 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -4398,6 +4398,15 @@ void TestBlackbox::jsExtensionsBinaryFile() QCOMPARE(data.at(7), char(0xFF)); } +void TestBlackbox::lastModuleCandidateBroken() +{ + QDir::setCurrent(testDataDir + "/last-module-candidate-broken"); + QbsRunParameters params; + params.expectFailure = true; + QVERIFY(runQbs(params) != 0); + QVERIFY2(m_qbsStderr.contains("Module Foo could not be loaded"), m_qbsStderr); +} + void TestBlackbox::ld() { QDir::setCurrent(testDataDir + "/ld"); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index d70c03c8f..54fa9c90e 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -166,6 +166,7 @@ private slots: void jsExtensionsTemporaryDir(); void jsExtensionsTextFile(); void jsExtensionsBinaryFile(); + void lastModuleCandidateBroken(); void ld(); void linkerMode(); void linkerVariant_data(); |