aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/imports/qbs/base
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-07-05 11:09:57 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-07-05 12:51:12 +0000
commitd7fb2f24e251c058bdab17bbd737639d9a1c8efd (patch)
tree1f63503607e600cd83ed0cf9bfd8c6d5264575ec /share/qbs/imports/qbs/base
parent1086fb5afeb5194b4cc692f177898b2fe123efc7 (diff)
AutotestRunner: Run installed test executables from install location
Task-number: QBS-993 Change-Id: Iee1aed8c67b32c2c41cd2e9617406b567d960410 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share/qbs/imports/qbs/base')
-rw-r--r--share/qbs/imports/qbs/base/AutotestRunner.qbs14
1 files changed, 13 insertions, 1 deletions
diff --git a/share/qbs/imports/qbs/base/AutotestRunner.qbs b/share/qbs/imports/qbs/base/AutotestRunner.qbs
index b5b43e3fd..121493de8 100644
--- a/share/qbs/imports/qbs/base/AutotestRunner.qbs
+++ b/share/qbs/imports/qbs/base/AutotestRunner.qbs
@@ -29,6 +29,8 @@
****************************************************************************/
import qbs
+import qbs.File
+import qbs.FileInfo
import qbs.ModUtils
import qbs.Utilities
@@ -52,8 +54,18 @@ Product {
alwaysUpdated: false
}
prepare: {
+ var commandFilePath;
+ var installed = input.moduleProperty("qbs", "install");
+ if (installed) {
+ commandFilePath = FileInfo.joinPaths(input.moduleProperty("qbs", "installRoot"),
+ input.moduleProperty("qbs", "installPrefix"),
+ input.moduleProperty("qbs", "installDir"),
+ input.fileName);
+ }
+ if (!commandFilePath || !File.exists(commandFilePath))
+ commandFilePath = input.filePath;
var fullCommandLine = product.wrapper
- .concat([input.filePath])
+ .concat([commandFilePath])
.concat(product.arguments);
var cmd = new Command(fullCommandLine[0], fullCommandLine.slice(1));
cmd.description = "Running test " + input.fileName;