aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2024-01-11 20:16:04 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2024-01-15 13:44:49 +0000
commit54a38fe94362eff0514e935cf6d2ba61e2e0a45b (patch)
tree245000dd8f4fd13681c792f61b17317728e96dfb /tests/auto
parentaa044048f0b3573ddda09d1b7a4483af9eed3de4 (diff)
Fix qbspkgconfig Qt provider in case there is no Qt
Our tests did not cover the case when there is obviously no Qt that come from this provider. Add this case and check that we only get the error about missing module but no error come from the provider. Fixes: QBS-1777 Change-Id: Id3e80fd54e1519c91be37346276fd781d9f81b0a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.cpp14
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp
index d0f0a3831..b083a97e8 100644
--- a/tests/auto/blackbox/tst_blackboxqt.cpp
+++ b/tests/auto/blackbox/tst_blackboxqt.cpp
@@ -396,6 +396,20 @@ void TestBlackboxQt::pkgconfigQt_data()
<< QStringList({"moduleProviders.qbspkgconfig.sysroot:/some/fake/sysroot"}) << false;
}
+void TestBlackboxQt::pkgconfigNoQt()
+{
+ QDir::setCurrent(testDataDir + "/pkgconfig-qt");
+ rmDirR(relativeBuildDir());
+ QbsRunParameters params("build", {"-f", "pkgconfig-qt.qbs"});
+ params.arguments << "moduleProviders.qbspkgconfig.libDirs:nonexistent";
+ params.expectFailure = true;
+
+ QCOMPARE(runQbs(params) == 0, false);
+ QVERIFY2(m_qbsStderr.contains("Dependency 'Qt.core' not found for product 'p'"), m_qbsStderr);
+ // QBS-1777: basic check for JS exceptions in case of missing Qt
+ QVERIFY2(!m_qbsStderr.contains("Error executing provider for module 'Qt.core'"), m_qbsStderr);
+}
+
void TestBlackboxQt::pluginMetaData()
{
QDir::setCurrent(testDataDir + "/plugin-meta-data");
diff --git a/tests/auto/blackbox/tst_blackboxqt.h b/tests/auto/blackbox/tst_blackboxqt.h
index 270ca3ec0..da395b7d4 100644
--- a/tests/auto/blackbox/tst_blackboxqt.h
+++ b/tests/auto/blackbox/tst_blackboxqt.h
@@ -62,6 +62,7 @@ private slots:
void pkgconfig();
void pkgconfigQt();
void pkgconfigQt_data();
+ void pkgconfigNoQt();
void pluginMetaData();
void pluginSupport_data();
void pluginSupport();