summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2022-02-21 21:46:43 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2022-02-28 12:26:23 +0000
commit5b1892618c09cf1068495e355b8e8a3868263361 (patch)
tree94e10da4c3287478274ac274adaf5e8c109e10bd
parente378b8a0d1141b68bc9a8017b043ee2abcd53afb (diff)
downloadqbs-5b1892618c09cf1068495e355b8e8a3868263361.tar.gz
baremetal: Add test to check the Digital Mars compiler probe
Change-Id: If43314a34cbae3b66d6221cb21e6ba32e4aaae38 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/imports/qbs/ModUtils/utils.js2
-rw-r--r--tests/auto/blackbox/testdata-baremetal/toolchain-probe/probes/dmc.qbs31
-rw-r--r--tests/auto/blackbox/testdata-baremetal/toolchain-probe/toolchain-probe.qbs1
3 files changed, 34 insertions, 0 deletions
diff --git a/share/qbs/imports/qbs/ModUtils/utils.js b/share/qbs/imports/qbs/ModUtils/utils.js
index 5e5cb63ea..dfb1f7639 100644
--- a/share/qbs/imports/qbs/ModUtils/utils.js
+++ b/share/qbs/imports/qbs/ModUtils/utils.js
@@ -543,6 +543,8 @@ function guessArchitecture(m) {
} else if (hasAnyOf(m, ["_M_IX86"])) {
var code = parseInt(m["_M_IX86"]);
architecture = (code < 300) ? "x86_16" : "x86";
+ } else if (hasAnyOf(m, ["_M_I86"])) {
+ architecture = "x86_16";
} else if (hasAnyOf(m, ["__x86_64", "__x86_64__", "__amd64", "_M_X64", "_M_AMD64"])) {
architecture = "x86_64";
if (hasAnyOf(m, ["__x86_64h", "__x86_64h__"]))
diff --git a/tests/auto/blackbox/testdata-baremetal/toolchain-probe/probes/dmc.qbs b/tests/auto/blackbox/testdata-baremetal/toolchain-probe/probes/dmc.qbs
new file mode 100644
index 000000000..13f751669
--- /dev/null
+++ b/tests/auto/blackbox/testdata-baremetal/toolchain-probe/probes/dmc.qbs
@@ -0,0 +1,31 @@
+import qbs.Probes
+
+Product {
+ id: product
+ condition: qbs.toolchainType === "dmc"
+
+ Depends { name: "cpp" }
+
+ Probes.DmcProbe {
+ id: probe
+ compilerFilePath: cpp.compilerPath
+ enableDefinesByLanguage: cpp.enableCompilerDefinesByLanguage
+ _targetPlatform: qbs.targetPlatform
+ _targetArchitecture: qbs.architecture
+ _targetExtender: cpp.extenderName
+ }
+
+ property bool dummy: {
+ if (!product.condition)
+ return;
+ if (!probe.found
+ || !probe.compilerDefinesByLanguage
+ || !probe.includePaths
+ || (probe.includePaths.length === 0)
+ || (qbs.architecture !== probe.architecture)
+ || (qbs.targetPlatform !== probe.targetPlatform)) {
+ console.info("broken probe: %%" + qbs.toolchainType + "%%, %%"
+ + qbs.architecture + "%%");
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata-baremetal/toolchain-probe/toolchain-probe.qbs b/tests/auto/blackbox/testdata-baremetal/toolchain-probe/toolchain-probe.qbs
index 5628e9b07..ebbf27535 100644
--- a/tests/auto/blackbox/testdata-baremetal/toolchain-probe/toolchain-probe.qbs
+++ b/tests/auto/blackbox/testdata-baremetal/toolchain-probe/toolchain-probe.qbs
@@ -1,5 +1,6 @@
Project {
references: [
+ "probes/dmc.qbs",
"probes/watcom.qbs",
]
}