aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-02-02 05:18:00 +0100
committerIvan Komissarov <ABBAPOH@gmail.com>2020-02-03 13:54:34 +0000
commit7811e70970294ff4c4c1fd76221727696e479cfb (patch)
treefc56ec9280490dbbf46a40ca5ece6b16c2cc6f3a /share
parentc5fc7db1cd5c3149aae8e7bc40e89e6d188f9dc8 (diff)
Improve TestBlackbox::pathProbe
Add checks for the candidatePaths and the single file API. Also, this includes a behavior change - if multiple selectors are present, the filePath/fileName/path probe properties are not set up - this is because it is not clear how they should be set up in case when the first file in selectors is found, but the second is not (and thus probe.found is false). In case of multiple selectors, user should use probe.allResults but not the single file API. Change-Id: Ib56faf0de93d3ec9fc49f5dbc9d51d4b36831a2d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/imports/qbs/Probes/PathProbe.qbs12
1 files changed, 7 insertions, 5 deletions
diff --git a/share/qbs/imports/qbs/Probes/PathProbe.qbs b/share/qbs/imports/qbs/Probes/PathProbe.qbs
index d0edea682..424a621c6 100644
--- a/share/qbs/imports/qbs/Probes/PathProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/PathProbe.qbs
@@ -70,10 +70,12 @@ Probe {
found = results.found;
allResults = results.files;
- var result = allResults[0];
- candidatePaths = result.candidatePaths;
- path = result.path;
- filePath = result.filePath;
- fileName = result.fileName;
+ if (allResults.length === 1) {
+ var result = allResults[0];
+ candidatePaths = result.candidatePaths;
+ path = result.path;
+ filePath = result.filePath;
+ fileName = result.fileName;
+ }
}
}