aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/corelib/language/moduleloader.cpp6
-rw-r--r--tests/auto/api/testdata/project-with-probe-and-profile-item/project-with-probe-and-profile-item.qbs19
-rw-r--r--tests/auto/api/tst_api.cpp6
-rw-r--r--tests/auto/api/tst_api.h1
4 files changed, 29 insertions, 3 deletions
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 67d60e05d..9c8f9da1d 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -688,6 +688,9 @@ void ModuleLoader::handleProject(ModuleLoaderResult *loadResult,
m_qbsVersion.toString()));
}
+ resolveProbes(&dummyProductContext, projectItem);
+ projectContext.topLevelProject->probes << dummyProductContext.info.probes;
+
handleProfileItems(projectItem, &projectContext);
QList<Item *> multiplexedProducts;
@@ -699,9 +702,6 @@ void ModuleLoader::handleProject(ModuleLoaderResult *loadResult,
for (Item * const additionalProductItem : qAsConst(multiplexedProducts))
Item::addChild(projectItem, additionalProductItem);
- resolveProbes(&dummyProductContext, projectItem);
- projectContext.topLevelProject->probes << dummyProductContext.info.probes;
-
const QList<Item *> originalChildren = projectItem->children();
for (Item * const child : originalChildren) {
switch (child->type()) {
diff --git a/tests/auto/api/testdata/project-with-probe-and-profile-item/project-with-probe-and-profile-item.qbs b/tests/auto/api/testdata/project-with-probe-and-profile-item/project-with-probe-and-profile-item.qbs
new file mode 100644
index 000000000..d7dc02cc2
--- /dev/null
+++ b/tests/auto/api/testdata/project-with-probe-and-profile-item/project-with-probe-and-profile-item.qbs
@@ -0,0 +1,19 @@
+Project {
+
+ property bool probesEvaluated: probe.found
+
+ Probe {
+ id: probe
+ configure: {
+ found = true;
+ }
+ }
+
+ Profile {
+ name: "the-profile"
+ cpp.includePaths: {
+ if (!probesEvaluated)
+ throw "project-level probes not evaluated";
+ }
+ }
+}
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index 05cfc728f..235f2ac04 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -2374,6 +2374,12 @@ void TestApi::projectWithPropertiesItem()
VERIFY_NO_ERROR(errorInfo);
}
+void TestApi::projectWithProbeAndProfileItem()
+{
+ const qbs::ErrorInfo errorInfo = doBuildProject("project-with-probe-and-profile-item");
+ VERIFY_NO_ERROR(errorInfo);
+}
+
void TestApi::propertiesBlocks()
{
const qbs::ErrorInfo errorInfo = doBuildProject("properties-blocks");
diff --git a/tests/auto/api/tst_api.h b/tests/auto/api/tst_api.h
index ce1678133..aa00ddc99 100644
--- a/tests/auto/api/tst_api.h
+++ b/tests/auto/api/tst_api.h
@@ -122,6 +122,7 @@ private slots:
void projectLocking();
void projectPropertiesByName();
void projectWithPropertiesItem();
+ void projectWithProbeAndProfileItem();
void propertiesBlocks();
void rc();
void referencedFileErrors();