aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-07-20 22:30:40 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-07-21 10:20:15 +0000
commitcf6faffcf26cdeb5139d64d976a971770ffdd0ee (patch)
treeac9557385d3ab21deaf6325c41ca596d4800fbda
parentc578df3a8c77f981fbeaad11ccb7a24df7922f8b (diff)
Add XFAIL'ing autotest for probes in multiplexed products
In all product instances, the same Probe item from the original Product item is used, because the Probes are looked up via the per-file id scope. It seems this has never worked correctly. Change-Id: I23294cb638e60c0f7c50b20d4270caa8d0af55c4 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--tests/auto/language/testdata/probes-and-multiplexing.qbs11
-rw-r--r--tests/auto/language/tst_language.cpp23
-rw-r--r--tests/auto/language/tst_language.h1
3 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/language/testdata/probes-and-multiplexing.qbs b/tests/auto/language/testdata/probes-and-multiplexing.qbs
new file mode 100644
index 000000000..0bc835b2d
--- /dev/null
+++ b/tests/auto/language/testdata/probes-and-multiplexing.qbs
@@ -0,0 +1,11 @@
+Product {
+ multiplexByQbsProperties: "architectures"
+ qbs.architectures: ["x86", "x86_64", "arm"]
+ property string archFromProbe: theProbe.archOut
+ Probe {
+ id: theProbe
+ property string archIn: qbs.architecture
+ property string archOut
+ configure: { archOut = archIn; }
+ }
+}
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index 9a97afbc2..4d4d9faa1 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -2402,6 +2402,29 @@ void TestLanguage::pathProperties()
QCOMPARE(exceptionCaught, false);
}
+void TestLanguage::probesAndMultiplexing()
+{
+ bool exceptionCaught = false;
+ try {
+ resolveProject("probes-and-multiplexing.qbs");
+ QVERIFY(project);
+ QCOMPARE(int(project->products.size()), 3);
+ QStringList architectures{"x86", "x86_64", "arm"};
+ for (const ResolvedProductPtr &product : project->products) {
+ const QString arch = product->moduleProperties->moduleProperty("qbs", "architecture")
+ .toString();
+ QVERIFY2(architectures.removeOne(arch), qPrintable(arch));
+ if (arch != "x86")
+ QEXPECT_FAIL("", "FIXME: Add items for ids as in ModuleInstantiator", Continue);
+ QCOMPARE(product->productProperties.value("archFromProbe").toString(), arch);
+ }
+ } catch (const ErrorInfo &e) {
+ exceptionCaught = true;
+ qDebug() << e.toString();
+ }
+ QCOMPARE(exceptionCaught, false);
+}
+
void TestLanguage::profileValuesAndOverriddenValues()
{
bool exceptionCaught = false;
diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h
index 3820e3f7c..708c79cce 100644
--- a/tests/auto/language/tst_language.h
+++ b/tests/auto/language/tst_language.h
@@ -138,6 +138,7 @@ private slots:
void overriddenVariantProperty();
void parameterTypes();
void pathProperties();
+ void probesAndMultiplexing();
void productConditions();
void productDirectories();
void profileValuesAndOverriddenValues();