diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-06-22 13:36:04 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-06-22 12:22:15 +0000 |
commit | 5d4996442f9f03ecba3f4e96c9ceb5eb42a0bb18 (patch) | |
tree | e0b878a984e45e5bdfa07b36a8271dbddeb3cda0 /tests/auto/shared.h | |
parent | 16432be9afc39372b7c35a4fb2929b5835c067e0 (diff) |
Autotests: Provide a means to specify the timeout via the environment
There are some exceedingly slow test machines for which sometimes even
our generous default timeout is not enough.
Change-Id: I278f3e3c6c85ed65ba24312e0788aa4bfa323dd2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests/auto/shared.h')
-rw-r--r-- | tests/auto/shared.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/shared.h b/tests/auto/shared.h index 9c9c10df0..36a15ca74 100644 --- a/tests/auto/shared.h +++ b/tests/auto/shared.h @@ -44,6 +44,15 @@ #include <memory> +inline int testTimeoutInMsecs() +{ + bool ok; + int timeoutInSecs = qEnvironmentVariableIntValue("QBS_AUTOTEST_TIMEOUT", &ok); + if (!ok) + timeoutInSecs = 600; + return timeoutInSecs * 1000; +} + using SettingsPtr = std::unique_ptr<qbs::Settings>; inline SettingsPtr settings() { |