aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-06-08 18:20:03 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2019-06-26 15:25:30 +0000
commit06f46da6c31de7d5b767da38713b11b1a117b34e (patch)
treeb23b248961c0d71943a3978969cdd1bd19361de1 /tests
parentd214864b666d3551fe25a648b82832fcbd241b2e (diff)
Add PathProbe::candidateFilter property
This property can be used to check if candidate conforms with some conditions. For example, an architecture of a shared library candidate should match the current qbs.architecture. Also, this will allow to implement support for the "text based stub libraries" (yaml files that point to a real library in a system) on macOS - instead of checking real file architecture, it should be read from .tbd file Change-Id: Ie84a3e70d883dec949440358e2f08213a8501982 Reviewed-by: Qbs CI Bot <travis-bot@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/path-probe/BaseApp.qbs2
-rw-r--r--tests/auto/blackbox/testdata/path-probe/candidate-filter.qbs12
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp1
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs b/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs
index 944a95a93..84c00c240 100644
--- a/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs
+++ b/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs
@@ -37,6 +37,7 @@ CppApplication {
property varList inputNameSuffixes
property pathList inputSearchPaths
property var inputNameFilter
+ property var inputCandidateFilter
property stringList outputFilePaths
@@ -46,6 +47,7 @@ CppApplication {
names: inputNames
nameSuffixes: inputNameSuffixes
nameFilter: inputNameFilter
+ candidateFilter: inputCandidateFilter
searchPaths: inputSearchPaths
}
diff --git a/tests/auto/blackbox/testdata/path-probe/candidate-filter.qbs b/tests/auto/blackbox/testdata/path-probe/candidate-filter.qbs
new file mode 100644
index 000000000..a65256a68
--- /dev/null
+++ b/tests/auto/blackbox/testdata/path-probe/candidate-filter.qbs
@@ -0,0 +1,12 @@
+import qbs.FileInfo
+
+BaseApp {
+ inputNames: ["tool.1", "tool.2"]
+ inputSearchPaths: "bin"
+ outputFilePaths: ["bin/tool.2"]
+ inputCandidateFilter: {
+ return function(f) {
+ return FileInfo.fileName(f) == "tool.2";
+ }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index c6acffcc9..534922112 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -2735,6 +2735,7 @@ void TestBlackbox::pathProbe_data()
QTest::newRow("mult-files-suffixes") << QString("mult-files-suffixes.qbs") << true;
QTest::newRow("mult-files-mult-suffixes") << QString("mult-files-mult-suffixes.qbs") << true;
QTest::newRow("name-filter") << QString("name-filter.qbs") << true;
+ QTest::newRow("candidate-filter") << QString("candidate-filter.qbs") << true;
}
void TestBlackbox::pathProbe()