forked from qt-creator/qt-creator
TaskTree: Introduce Timeout task
By default, when finished, it returns success. In order to convert it into failing task, enclose it inside a Group with finishAllAndError. Reuse it in tasking tests. Task-number: QTCREATORBUG-28741 Change-Id: Ic81203203e0b139d4f9bfd553279ecb01cd303f4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -1848,4 +1848,14 @@ void TaskTreeTaskAdapter::start()
|
||||
task()->start();
|
||||
}
|
||||
|
||||
TimeoutTaskAdapter::TimeoutTaskAdapter()
|
||||
{
|
||||
*task() = std::chrono::milliseconds::zero();
|
||||
}
|
||||
|
||||
void TimeoutTaskAdapter::start()
|
||||
{
|
||||
QTimer::singleShot(*task(), this, [this] { emit done(true); });
|
||||
}
|
||||
|
||||
} // namespace Tasking
|
||||
|
||||
Reference in New Issue
Block a user