aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-29 12:15:42 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-07-04 10:48:14 +0000
commitff47f16163125b22caa3750a0c2ea26bc0f6728b (patch)
treecf29d206948570047b38cac39c5d77498d8100b6 /tests
parentfed37117f456600bb29d0cd3df6f1ababdda6404 (diff)
ModuleLoader: Fix misleading error message
If a product could not get properly loaded and a per-product property override was given on the command line, we used to erroneously complain about the property override instead of reporting the real error. Change-Id: I1cbbc8ff9b6dcd453563c4745778576342862ca3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/no-such-profile/no-such-profile.qbs6
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp10
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/no-such-profile/no-such-profile.qbs b/tests/auto/blackbox/testdata/no-such-profile/no-such-profile.qbs
new file mode 100644
index 000000000..8e64ba478
--- /dev/null
+++ b/tests/auto/blackbox/testdata/no-such-profile/no-such-profile.qbs
@@ -0,0 +1,6 @@
+import qbs
+
+Product {
+ name: "theProduct"
+ property int p
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 64377dab8..fbcb9f446 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4287,6 +4287,16 @@ void TestBlackbox::noProfile()
QVERIFY2(m_qbsStdout.contains("profile: none"), m_qbsStdout.constData());
}
+void TestBlackbox::noSuchProfile()
+{
+ QDir::setCurrent(testDataDir + "/no-such-profile");
+ QbsRunParameters params(QStringList("products.theProduct.p:1"));
+ params.profile = "jibbetnich";
+ params.expectFailure = true;
+ QVERIFY(runQbs(params) != 0);
+ QVERIFY2(m_qbsStderr.contains("Profile 'jibbetnich' does not exist"), m_qbsStderr.constData());
+}
+
void TestBlackbox::nonBrokenFilesInBrokenProduct()
{
QDir::setCurrent(testDataDir + "/non-broken-files-in-broken-product");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 35ba2c5b7..87a6b1006 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -178,6 +178,7 @@ private slots:
void nestedProperties();
void newOutputArtifact();
void noProfile();
+ void noSuchProfile();
void nodejs();
void nonBrokenFilesInBrokenProduct();
void nonDefaultProduct();