aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js2
-rw-r--r--share/qbs/module-providers/qbspkgconfig.qbs2
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.cpp14
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.h1
4 files changed, 17 insertions, 2 deletions
diff --git a/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js b/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
index ed75a027c..1fb3b26f5 100644
--- a/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
+++ b/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
@@ -87,7 +87,7 @@ function configure(
result.packages = [];
result.packagesByModuleName = {};
result.brokenPackages = [];
- result.qtInfos = {};
+ result.qtInfos = [];
var options = {};
options.libDirs = libDirs;
diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs
index 0c6c99293..45309c862 100644
--- a/share/qbs/module-providers/qbspkgconfig.qbs
+++ b/share/qbs/module-providers/qbspkgconfig.qbs
@@ -152,7 +152,7 @@ ModuleProvider {
if (moduleName.startsWith("Qt")) {
function setupQt(packageName, qtInfos) {
- if (qtInfos === undefined)
+ if (qtInfos === undefined || qtInfos.length === 0)
return [];
var qtProviderDir = FileInfo.joinPaths(path, "Qt");
return SetupQt.doSetup(packageName, qtInfos, outputBaseDir, qtProviderDir);
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();