Commit Graph

3090 Commits

Author SHA1 Message Date
Jarek Kobus
c098b261dc TaskTree: Refactor Group internal data
Introduce the GroupData structure. In this way it's easily
possible to add extra properties of already used types, e.g. int.

It's also possible to easily create elements with multiple
properties.

Simplify internal TaskItem::Type enum.

Get rid of special ParallelLimit and Workflow elements.
Provide global parallelLimit() and workflowPolicy() functions.

Make global items (e.g. parallel, stopOnDone, etc...) const.

Change-Id: Ic5628255b542fd6c5a5565b055ff11804c8d7b68
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 15:30:15 +00:00
Jarek Kobus
0793b945f3 TaskTree: Replace usages of OnGroup... with onGroup... functions
Change-Id: I06ce6c917ac28b6362ad2cdef42355e5aa28f4eb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 15:29:55 +00:00
Jarek Kobus
7501d7587f TaskTree: Introduce WorkflowPolicy::StopOnFinished
The policy is useful mainly in parallel mode.
It stops executing the Group when any task finishes.
It reports the task's result.

Change-Id: I7aa98365cdc4c1eb869ab419d42d0cc5438d43bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 08:40:24 +00:00
Jarek Kobus
f0acaecc63 tst_Async: Reuse TaskTree:runBlocking()
Change-Id: Ia5dd76bed15014d920e44f51de1774323be0b9a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-19 07:19:46 +00:00
Jarek Kobus
6a8e8f5fbd tst_Tasking: Reuse TaskTree:runBlocking()
Get rid of the OnStart enum - that's checked indirectly
through the runBlocking() call.

Change-Id: I190de0f911c68195c31e722bcb1823b678cb0bd4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-19 07:19:33 +00:00
Christian Stenger
23b0082b20 Tests: Build text tests with Qbs as well
Amends 1a98dda5c4.

Change-Id: If563437141ac75bb2b72a9d550d1fb507a89e63c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-17 13:36:18 +00:00
David Schulz
b2e30e7ef8 Utils: add Position::fromCursor with tests
Change-Id: I1cd989eaf7e75bc04f171989f9f9fe932402abef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-17 12:53:22 +00:00
Christian Stenger
a468bc2f02 Fix Qbs build
Amends f84199f8b7 and
reverts 796cfceb3a.

Change-Id: I7eb686c012bd99cddf36aa16219e3f33de2b15b2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-17 10:36:29 +00:00
hjk
8f5703a7b9 Tests: Add a test to feed shells via stdin
Change-Id: I7e19537d0a3015aeb329849758cc92da17a67606
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-17 08:21:09 +00:00
Christian Stenger
796cfceb3a Tests: Fix Qbs build
Amends f84199f8b7.

Change-Id: I6a233aca13f9908451748c20c1804fa2851043aa
Reviewed-by: hjk <hjk@qt.io>
2023-05-17 08:17:12 +00:00
Jarek Kobus
f84199f8b7 Solutions: Long live Solutions!
Short live Tasking in Solutions!

Add src/libs/solutions/README.md with the motivation and hints.

Move TaskTree and Barrier from Utils into Tasking object lib,
the first solution in Solutions project.

Tasking: Some more work is still required for adapting auto and
manual tests. Currently they use Async task, which stayed in Utils.
For Qt purposed we most probably need to have a clone of
Async task inside the Tasking namespace that is more Qt-like
(no Utils::FutureSynchronizer, no priority field,
global QThreadPool instead of a custom one for Creator).

Change-Id: I5d10a2d68170ffa467d8c299be5995b9aa4f8f77
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 06:29:03 +00:00
David Schulz
9758e71458 Utils: add tests for Position::fromPositionInDocument
Change-Id: I2b530cf62a4defe0292c51834b1e5093a7d5e55f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-16 10:30:15 +00:00
David Schulz
479d7e3732 Utils: remove duplicated test
Change-Id: I0391feb848af09295afd9d3e84e25337023c24b6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-16 08:55:21 +00:00
David Schulz
b4734ff727 Utils: add tests for Position::fromFileName
Change-Id: I321b91567e47e08883c7b991cd24d02bb8a9b9c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-16 08:24:28 +00:00
David Schulz
1a98dda5c4 Utils: fix Text::Range length and remove mid
Those functions are based on the assumption that the passed text starts
at the begin position, which was good enough for search results, but if
used in other parts of the codebase it might give unwanted results.
Calculate the length of the range now as expected and subtract the
beginning lines.
In order to still got the correct results for the text result texts
modify the result range to always start at the first line before
calculating the length of the range.
Also add tests for the modified functionality

Change-Id: I7ccd75b642dda6dd4f738877cbe3543d46c03652
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-12 11:03:33 +00:00
Jarek Kobus
97a66067bb TaskTree: Prepare for de-utils-ization - part 2
Move TaskTree into Tasking namespace.
Move Tasking namespace out of Utils namespace.

Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 08:09:19 +00:00
David Schulz
5b0c3258bb Utils: Make column of LineColumn consistently 0-based
Change-Id: I4ab153d1c55653936efbcdc13ac04463185930e0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-11 05:53:49 +00:00
Marcus Tillmanns
fc95d7a737 Utils: Improve FilePath::sort
Remove the conversion to/from QString for sorting.

Change-Id: I89921328b6d9e952c802d41998495bd2ffbb9f99
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 08:56:32 +00:00
Jarek Kobus
c68a013a3e Tasking::Tree: Rename Tree into TaskTreeTask
Task-number: QTCREATORBUG-29102
Change-Id: I70073bcb44a712c427c8c5aea42c48dbc30eebe0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:45 +00:00
Jarek Kobus
c75b59f9b4 Process: Rename QtcProcessPrivate -> ProcessPrivate
Rename the logging category for Process.
Fix inline comments accordingly.
Adapt warning/debug messages accordingly.

Change-Id: I2b1f0f558701def3afa3c1b04adf629833dba9e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:22 +00:00
Jarek Kobus
936086745a FileSearch: Get rid of FileSearchResult
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.

Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 11:03:48 +00:00
hjk
41b6ecf502 Fix environment auto test
Amends 1e1befd9eb.

Change-Id: Iecd06ee06081057208a2b3387d618142dc74d0bd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-08 12:03:52 +00:00
Semih Yavuz
cd73f8c6b8 qmljsreformatter: don't default foreach type to "in"
Fixes: QTCREATORBUG-29123
Change-Id: I4d3a611c359946c4483388cbf18a0b6f16d0a8d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-08 07:39:26 +00:00
Alessandro Portale
1e1befd9eb Proliferate pathListSeparator()
Change-Id: I546107af6a88ad5901659a0a64485e4ebca3a164
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 15:17:10 +00:00
Jarek Kobus
af32b0ce44 Tests: Rename tst_AsyncTask -> tst_Async
Follows 187a7640de

Change-Id: I58e6afbc0cbdea37c405b11e133d794a91f09fc6
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 12:35:56 +00:00
Jarek Kobus
abce79939a Tests: Rename tst_QtcProcess -> tst_Process
Follows 470c95c94b

Change-Id: Ie26b5677d28e645ab27aeebf5976b5507385716a
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 12:35:50 +00:00
Eike Ziller
7724f8653f Merge remote-tracking branch 'origin/10.0'
Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
2023-05-05 10:39:47 +02:00
Jarek Kobus
867b10a06b Remove unused includes of QFutureInterface
Change-Id: I70f5e842801b628c7f9ad4d433334ce04d4e648e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 06:50:36 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Jarek Kobus
82bc4870b3 Tasking::WaitForBarrier: Rename it into WaitForBarrierTask
Rename BarrierAdapter into BarrierTaskAdapter.

Task-number: QTCREATORBUG-29102
Change-Id: I003b09fd71af1bde870f761d365a8cea1858862a
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:07:51 +00:00
Jarek Kobus
187a7640de Tasking::Async: Rename Async into AsyncTask
Rename Utils::AsyncTask into Utils::Async.
Rename AsyncTaskBase into AsyncTask.

Task-number: QTCREATORBUG-29102
Change-Id: I3aa24d84138c19922d4f61b1c9cf15bc8989f60e
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:28 +00:00
Jarek Kobus
4b129df44f TaskTree: Enable the fluent interface for Tasks
Make it possible to use the default Task c'tor
and add selected handlers with onSetup/Done/Error()
methods.

Change-Id: I94f5806f347931faa07cff0ade620a3d30777cfe
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 07:05:28 +00:00
Christian Kandeler
8aecf0d749 Fix qbs build for QML test
Change-Id: I8df3988f574cc94c8bb441a54a1b861913029dfa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 11:17:36 +00:00
Eike Ziller
66c0c36bc1 Fix compiler warnings
Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 09:05:16 +00:00
Christian Stenger
3aefbb37b9 Tests: Fix qbs build
Amends 0b3a0dce88.

Change-Id: I89a301a8780f17c3197ffe99a6cfc9a61d5961b3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-02 07:00:07 +00:00
Jarek Kobus
ce1a9b5990 TaskTree: Add tests for new functionality enabled by Barrier
Test, that it's possible to distribute the barrier advance
in multiple tasks.

The barrier passes after the both advances are triggered.

Change-Id: Ica58f9657ecdf1ba45e1059ea47be0453948e7b9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 06:54:28 +00:00
Jarek Kobus
c4acd5ce4c TaskTree: Refactor barrier tests
A preparation step before adding new barrier tests.

Change-Id: I83aa8a7788859f98c98885384b52dc3377e01916
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 06:54:20 +00:00
Jarek Kobus
36dad70ab0 TaskTree: Replace the usages of old WaitFor with new Barrier
Adapt the TaskTree tests and the usage in FileStreamer.
The FileStreamer may be tested by running the
FileSystemAccessTest.

Change-Id: I1d8086dd359c458b7bdd3d4d47cf249184b04c65
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 06:53:59 +00:00
Jarek Kobus
0b3a0dce88 TaskTree: Rewrite tests to use AsyncTask
Instead of using QtcProcess. In this way the tests may be
executed much faster, since there is no need to start
qtcreator_processlauncher.

This should limit the CI failures caused by timeout when
executing these tests.

Remove testapp, unneeded now.

Change-Id: I80775276c2aaec7c2d463b1ac25010efa942b258
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 04:51:42 +00:00
Jarek Kobus
df5e3c587a TaskTree: Enhance Sync's function
Make it possible to pass a void returning function to the
Sync constructor. In this case it's assumed that function
returns true by default and finishes successfully.

Add some helpful error messages when requirements for the
passed function are not met.

Change-Id: I8be75acd277d06e87db3c87a6eb96173aa9cd890
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-04-27 08:11:24 +00:00
Jarek Kobus
36eab77c61 tst_taskTree: Add more tests for WaitFor/Condition/Activator
Change-Id: I662d56c3b943a4df8b4c12da95eb57fbca9e3048
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-27 06:08:22 +00:00
Jarek Kobus
070bfe9387 FutureSynchronizer: Change the default value of cancelOnWait to true
The "false" default wasn't really useful.

This changes the default value to the following usages:

1. AndroidDeployQtStep
   Introduced in 91f136ef3a
   The synchronizer was used to cancel the running tasks inside
   the doCancel(), so the similar behavior should be expected
   when destructing the AndroidDeployQtStep.

2. GitClient
   Introduced in f3106ebafe
   Is used only inside the last line of
   GitSubmitEditor::updateFileModel(). The running function
   (CommitDataFetchResult::fetch) doesn't take QPromise<>,
   so it can't detect if the future was canceled or not.
   In this case this change is no-op.

3. ExtraCompiler
   Introduced in c99ce1f455
   The intention was to make it cancellable and finish
   early on cancel.

4. PluginManager global future synchronizer
   Introduced in 72bddf9f51
   The intention was to make it cancellable and finish
   early on cancel.

The relevant places in code are marked explicitly for
points: 1, 2 and 3.

Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-26 08:17:27 +00:00
hjk
3edc491b2a Utils: Simplify SettingsAccessor constructors
Use setters instead.

Change-Id: I912234fa832eeb80519740ca011921f1e71d70b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-26 06:32:52 +00:00
hjk
aeac83af78 Utils: Collapse the two SettingsAccessor constructor hierarchies
Change-Id: I7b659c9e3c66700cfc92f9cfbd9df0535a1ca655
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-26 06:24:19 +00:00
hjk
b4a6af026e Utils: Remove displayName from SettingsAccessors
It was not used.

Change-Id: I7c0927698bf31548ec076c39881561d72e8495e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-26 06:23:21 +00:00
Semih Yavuz
21ca06fc7c Codeformatter: Support indenting of type annotated function
Fixes: QTCREATORBUG-29046
Change-Id: Ie4a4d85b7aa00ddf4dd3ea4bade6ffa57af7b4e0
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-04-20 12:55:40 +00:00
Jarek Kobus
837967a77a tst_RunExtensions: Move onResultReady test into tst_AsyncTask
Change-Id: I73e2cc62be207adbfb2a4e4ce1367140986cc8b3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-17 09:18:47 +00:00
Jarek Kobus
7ab0fd56ae RunExtensions: Move onResultReady and onFinished into asynctask.h
Change-Id: I96dbf5b0253251224ae678172cd5fca12b34326a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-17 09:10:33 +00:00