summaryrefslogtreecommitdiff
path: root/share/qbs
diff options
context:
space:
mode:
authorJochen Ulrich <jochenulrich@t-online.de>2019-07-08 00:10:04 +0200
committerJochen Ulrich <jochenulrich@t-online.de>2019-08-01 19:35:31 +0000
commit923f98062b4297970f382da91256c21d47b01a5e (patch)
treeef825940015e78e81acc1897339913f017af1d3b /share/qbs
parent6a672fe58fe18b2f2e74c41048d4c15b8395440a (diff)
downloadqbs-923f98062b4297970f382da91256c21d47b01a5e.tar.gz
Add command and AutotestRunner timeout
Task-number: QBS-1454 Change-Id: I6e2514d10cca0cba0a14456ecd2abfb495539ee4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'share/qbs')
-rw-r--r--share/qbs/imports/qbs/base/AutotestRunner.qbs6
-rw-r--r--share/qbs/modules/autotest/autotest.qbs1
2 files changed, 7 insertions, 0 deletions
diff --git a/share/qbs/imports/qbs/base/AutotestRunner.qbs b/share/qbs/imports/qbs/base/AutotestRunner.qbs
index ab9ba15f7..b9adee88d 100644
--- a/share/qbs/imports/qbs/base/AutotestRunner.qbs
+++ b/share/qbs/imports/qbs/base/AutotestRunner.qbs
@@ -42,6 +42,7 @@ Product {
property stringList wrapper: []
property string workingDir
property stringList auxiliaryInputs
+ property int timeout: -1
Depends {
productTypes: "autotest"
@@ -74,6 +75,7 @@ Product {
: FileInfo.path(commandFilePath);
var arguments = product.arguments;
var allowFailure = false;
+ var timeout = product.timeout;
if (input.autotest) {
// FIXME: We'd like to let the user override with an empty list, but
// qbscore turns undefined lists into empty ones at the moment.
@@ -83,6 +85,9 @@ Product {
if (input.autotest.workingDir)
workingDir = input.autotest.workingDir;
allowFailure = input.autotest.allowFailure;
+
+ if (input.autotest.timeout !== undefined)
+ timeout = input.autotest.timeout;
}
var fullCommandLine = product.wrapper
.concat([commandFilePath])
@@ -91,6 +96,7 @@ Product {
cmd.description = "Running test " + input.fileName;
cmd.environment = product.environment;
cmd.workingDirectory = workingDir;
+ cmd.timeout = timeout;
if (allowFailure)
cmd.maxExitCode = 32767;
return cmd;
diff --git a/share/qbs/modules/autotest/autotest.qbs b/share/qbs/modules/autotest/autotest.qbs
index ba280169e..c8a1c5180 100644
--- a/share/qbs/modules/autotest/autotest.qbs
+++ b/share/qbs/modules/autotest/autotest.qbs
@@ -2,4 +2,5 @@ Module {
property stringList arguments
property bool allowFailure: false
property string workingDir
+ property int timeout
}