diff options
author | Jochen Ulrich <jochenulrich@t-online.de> | 2019-07-08 00:10:04 +0200 |
---|---|---|
committer | Jochen Ulrich <jochenulrich@t-online.de> | 2019-08-01 19:35:31 +0000 |
commit | 923f98062b4297970f382da91256c21d47b01a5e (patch) | |
tree | ef825940015e78e81acc1897339913f017af1d3b /src/lib/corelib/buildgraph/abstractcommandexecutor.h | |
parent | 6a672fe58fe18b2f2e74c41048d4c15b8395440a (diff) |
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 'src/lib/corelib/buildgraph/abstractcommandexecutor.h')
-rw-r--r-- | src/lib/corelib/buildgraph/abstractcommandexecutor.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/corelib/buildgraph/abstractcommandexecutor.h b/src/lib/corelib/buildgraph/abstractcommandexecutor.h index 60b2b40b2..c0f149622 100644 --- a/src/lib/corelib/buildgraph/abstractcommandexecutor.h +++ b/src/lib/corelib/buildgraph/abstractcommandexecutor.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 Jochen Ulrich <jochenulrich@t-online.de> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qbs. @@ -45,6 +46,7 @@ #include <tools/error.h> #include <QtCore/qobject.h> +#include <QtCore/qtimer.h> namespace qbs { class ErrorInfo; @@ -64,7 +66,7 @@ public: void setDryRunEnabled(bool enabled) { m_dryRun = enabled; } void setEchoMode(CommandEchoMode echoMode) { m_echoMode = echoMode; } - virtual void cancel() = 0; + virtual void cancel(const qbs::ErrorInfo &reason = {}) = 0; void start(Transformer *transformer, AbstractCommand *cmd); @@ -83,7 +85,9 @@ protected: private: virtual void doSetup() { }; - virtual void doStart() = 0; + virtual bool doStart() = 0; + + void startTimeout(); private: AbstractCommand *m_command; @@ -91,6 +95,7 @@ private: ScriptEngine *m_mainThreadScriptEngine; bool m_dryRun; Internal::Logger m_logger; + QTimer m_watchdog; }; } // namespace Internal |