Make it possible to mix synchronous and asynchronous calls
inside task tree.
Basically, it's a shortcut for:
bool syncMethod();
Group {
OnGroupSetup([syncMethod] { return syncMethod()
? TaskAction::StopWithDone
: TaskAction::StopWithError; })
}
Please note: similarly to Group, Sync isn't counted as a task
inside taskCount() and doesn't emit TaskTree::progressValueChanged()
when finished. It's being considered as a simple handler
that doesn't last long and shouldn't block the GUI thread.
Otherwise, use AsyncTask instead.
Change-Id: If71c5da2f9b202a69c41a555cc93d314476952f4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Variant 2:
Inside this test the process 2 should finish first, then synchonously:
- process 3 should exit setup with error
- process 1 should be stopped as a consequence of error inside the group
- processes 4 and 5 should be skipped
Variant 3:
This test ensures process 1 doesn't invoke its done handler,
being ready while sleeping in process 2 done handler.
Inside this test the process 2 should finish first, then synchonously:
- process 3 should exit setup with error
- process 1 should be stopped as a consequence of error inside the group
- process 4 should be skipped
- the first child group of root should finish with error
- process 5 should be started (because of root's continueOnError policy)
Change-Id: Ie34737244c7da4334a6cbbae4f0ddba99503d09c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Get rid of std::bind.
Enclose each data tag of processTree inside its own block,
so that "root" and "log" names are unique within each block.
This makes each block look like a pattern with filled data up.
Introduce TestData structure, so that it's harder now to mix
the order of test data in new rows.
Introduce some enums instead of bools to make more meaning
on the returned data.
Change-Id: Iffe49cf1c7f912378467ab9f9c1256003dba7b9c
Reviewed-by: hjk <hjk@qt.io>
Don't define 2 separate group setup items. Make OnGroupSetup
be able to handle also dynamic setup - like it's done with
CustomTask's setup handler.
Change-Id: I43e135f268ea96419b44ef5a4325707a124b4921
Reviewed-by: hjk <hjk@qt.io>
Use TaskAction for dynamic group setup. Get rid of possibility
of selecting group's children to be started inside group setup.
Use dynamic children's setup instead, so that each individual child
may decide itself whether it wants to be started or not.
Change-Id: Ie31f707791db0dc26be92663ca6238b8e49c3b98
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Before it was possible to dynamically setup groups only.
This functionalily is probably good enough to replace
Group's DynamicSetup, as it seems much more convenient.
Change-Id: I56080f0ffa844847ca955cf52ccb07f3b4e4c731
Reviewed-by: hjk <hjk@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Remove storage() test case, as Storage functionality is fully
tested in processTree().
Change-Id: I05c199cf4cfa2a77493ce54df267b8ed1c2804bc
Reviewed-by: hjk <hjk@qt.io>
Storage handlers make it possible to pass initial data
into task tree and make it possible to retrieve the output
data from task tree after the task tree finished.
Change-Id: I0bcc12f5e552f55c1d5d89b81521ae9cb7b8b124
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Detect, if test has timed out before checking other results.
When the test timed out, the task tree may still be running.
This helps in analyzing the test failures inside precheck
button.
Change-Id: Iccad85dbb8b3d621165ab8b0c5a1b82a1d6808cb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The Storage item makes it possible to define the whole
subtree as a self-contained, full-functional recipe, without a need
for passing (together with recipe) a one-use only (disposable)
pointer to storage object.
That's the last closing element of making the idea of pure,
value-based recipe real. It makes the TaskTree machinery ultimately
powerful.
Change-Id: Icd81bdd3e94251e8b241b2b550957d566fa4ab75
Reviewed-by: hjk <hjk@qt.io>
Now it's possible to nest TaskTrees. A nested TaskTree
is seen as one, singular task inside parent tree.
Change-Id: Iad95de39c7b79580e0b589c222594de91d5b51a1
Reviewed-by: hjk <hjk@qt.io>
The progressMaximum is the number of tasks in tree.
The progressValueChanged signal is emitted whenever task is done
(advance by one) or when some number of tasks were skipped or stopped
due to workflow policy or dynamic setup group handler.
Change-Id: I403059a6466ae0534ef647c3c1c61c0318f10325
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
DynamicSetup enables finishing group (with Done or Error)
immediately before the group was even started.
The handler is invoked dynamically, just before starting
the group. The handler may also allow for running only
selected children and omitting others, so it may serve as
dynamic condition or dynamic multiplexer. This can be achieved
by modifying QSet<int> childrenToRun field inside returned
GroupConfig and setting the policy to ContinueSelected.
Change-Id: I15bddbb866a89ae9f783c59cc4bca89dd6a81c75
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
The TaskTree class is responsible for running async task tree
structure defined in a declarative way.
Change-Id: Ieaf706c7d2efdc8b431a17b2db8b28bf4b7c38e5
Reviewed-by: hjk <hjk@qt.io>