Commit Graph

8032 Commits

Author SHA1 Message Date
Jarek Kobus
1bf2c447d3 Process: Add a test for starting unexisting process
With different combinations of processImpl and eventLoopMode.

Change-Id: I7a066741f46bc51c1d670527e03358cd77d6b29e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-13 13:38:59 +00:00
Jarek Kobus
7802e475ce Process: Fix EventLoopMode::On
Queue the call to start() so that it's executed after the nested
event loop is started, otherwise it fails on Windows with QProcessImpl.

Fixes: QTCREATORBUG-30066
Change-Id: Ibb17ef0f668f52c05b26a521e18c94e637992ba5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-13 13:38:49 +00:00
Jarek Kobus
85a27b3ddd TaskTree: Implement progress reporting for LoopRepeat
When a number of repeats is known in advance,
make the progress reporting aware of it.

Add a test for it.

Change-Id: I676a4aa9eb469cfe40a2729d231c706dff3ca07c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-13 03:02:41 +00:00
Jarek Kobus
ae57346f30 TrafficLight: Undecorate strings in order to compile against Qt 6.2
Change-Id: Iac3a65cca5b07f405fb64fe4cefc7cdf3d509759
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-13 02:41:23 +00:00
Jarek Kobus
db43e5d679 TaskTree: Introduce LoopUntil
In order to conform better with LoopRepeat and LoopForever.

Change-Id: Ic14cd072dc04951c0b142fd7379daf5541823a9a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-12 18:16:03 +00:00
Robert Löhning
db930b3c61 SquishTests: Update expected tree in tst_opencreator_qbs
Change-Id: I0b28b49bf2351ad37daf9702aaa1386b0c3514be
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-12 16:31:58 +00:00
Alessandro Portale
2a2772ba40 Utils: Add test case eventLoopMode to tst_Process
On Windows, Process::runBlocking(EventLoopMode::On) and
ProcessImpl::QProcess fails with ProcessResult::StartFailed.

Task-number: QTCREATORBUG-30066
Change-Id: I25317300023f4f7c16a8a62c4c3f1048482735a4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-12 10:02:25 +00:00
Jarek Kobus
1f41e408e0 TaskTree: Simplify recipe in ImageScaling example
Change-Id: Ieda5a7b06098cc2b90c69db79b7a002345a68f44
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-11 11:51:30 +00:00
Jarek Kobus
7c0b831391 TaskTree: Implement TrafficLight example
Import from:
https://github.com/qt/qtscxml/tree/dev/examples/scxml/trafficlight-common
and implement it in terms of TaskTree.
The recipe() corresponds to trafficlight.scxml file and implements
the business logic.

Used components: TimeoutTask and BarrierTask.

Change-Id: Ifc08b947388abed8cfc85ba082aaa0b18da0a1d7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-11 11:36:06 +00:00
Jarek Kobus
e8904041c2 TaskTree: Introduce Forever group
Rename Forever -> LoopForever, Repeat -> LoopRepeat.

Change-Id: Ic999c876762d2b092f23ae88ea6de341b68a1fc2
Reviewed-by: hjk <hjk@qt.io>
2024-01-11 11:34:43 +00:00
Jarek Kobus
9dd3ab12f5 tst_settings.cpp: Get rid of Utils namespace specifier
We are already using namespace Utils in this file.

Change-Id: I6e2f431029bbc27f425be2ad618a98733b618222
Reviewed-by: hjk <hjk@qt.io>
2024-01-11 10:53:18 +00:00
Eike Ziller
3e40f227f5 Merge remote-tracking branch 'origin/12.0'
Change-Id: I70bcac4195095a7646dcdc31532d8f61b643d869
2024-01-10 16:06:29 +01:00
Jarek Kobus
bc2faebe02 TaskTree: Reuse Repeat element in DataExchange example
Update the location of the target url so that it points to the
TaskTree wiki image.

Task-number: QTCREATORBUG-30081
Change-Id: Ic1c715c268b9e14711bc98415e747de8b75ed2dc
Reviewed-by: hjk <hjk@qt.io>
2024-01-10 10:45:21 +00:00
Jarek Kobus
ff46a9a8ef TaskTree: Reuse Repeat element in ImageScaling example
Task-number: QTCREATORBUG-30081
Change-Id: I281b6fe45c62045686ee215a5e03a5d8917a0282
Reviewed-by: hjk <hjk@qt.io>
2024-01-10 10:42:47 +00:00
Jarek Kobus
3f1a381c58 TaskTree: Add tests for Loop functionality
Task-number: QTCREATORBUG-30081
Change-Id: I999a5ea1fc887a2a5de6497acc3642abb187ef74
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-10 09:46:58 +00:00
Jarek Kobus
ebaa13e277 TaskTree: Fix typo in test cases
Change-Id: Ie65e68b61643a8de8eec8d039cd4f874ec6fdd1f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-10 07:58:15 +00:00
Robert Löhning
72c0ff37fc SquishTests: Expect symlinked compilers
e.g. /usr/bin/clang links to ../lib/llvm-14/bin/clang
on Ubuntu 22.04.

Change-Id: I6facd3126045036124e6c79ee83bc7575cbb02d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-09 13:33:12 +00:00
Jarek Kobus
24649c4980 TaskTree: Add a test for nested cancel
Change-Id: I5d4d329e6c069e744d25d6f94e1d33b53f288f13
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-01-08 08:42:00 +00:00
Jarek Kobus
16b40c5bb6 TaskTree: Fix stop() method
Reset internal data after a call to stop().
Add a test for restarting the task tree.

Change-Id: Iedf11d97c33c9001c818078abc816e3c483c42b8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-08 08:09:25 +00:00
Jarek Kobus
23ed1977da TaskTree: Keep a stack of active storages
Make it possible to run a nested task tree containing
the common storage from the outer task tree's handler.
This means we need to manage the stack of active storages
per thread.

Add a test for it.

This addresses the 4th point in the report below.

Task-number: QTCREATORBUG-29103
Change-Id: Ib0f925048197625a0eb9f83f262c7256a5756cc8
Reviewed-by: hjk <hjk@qt.io>
2024-01-08 07:08:30 +00:00
Jarek Kobus
2fca517068 Process test: Fix flakiness on linux / mac (2nd try)
It looks like when the running process outputs the newlines,
reading it may be split into separate chunks.

Avoid newlines in this test and use std::flush instead.

Amends bc3e30e7ec

Change-Id: I46be774b5509a1f0f60b289f6b6ffc9b46955b8f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-05 13:05:51 +00:00
Jarek Kobus
bc3e30e7ec Process test: Fix flakiness on linux / mac
Since it's not clear why the flakiness existed, leave a TODO note.

Change-Id: Ief1104870c008e056d5b87880b508fd66266bce4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-01-04 20:44:38 +00:00
David Schulz
5117ca3280 Debugger: Adjust lldbbridge and test for lldb on windows
Since frame 0 points to the Windows DebugBreak function it does not hold
any usable locals, so we have to pass the correct frame to the
lldbbridge test infrastructure in order to get usable data.

Change-Id: I2595be87a718d73fda3429017efd564e5d0ed9be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-03 10:06:21 +00:00
Jarek Kobus
7d3f50f784 TaskTree: Remove explicit List element
Replace it with additional GroupItem's c'tors.

This addresses the 27th point in the report below.

Task-number: QTCREATORBUG-28741
Change-Id: I7f0620993e7c9bf61868e7bc7b112eea4dae6471
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-12-22 09:32:26 +00:00
David Schulz
4b088bd226 Debugger: simpify cdb test setup
Change-Id: I196cee8fa6b35b78dae0b2e7db2c708736b39daa
Reviewed-by: hjk <hjk@qt.io>
2023-12-22 09:27:23 +00:00
Cristian Adam
aec3e7dbf2 Debugger: Enable lldb with MSVC binaries
This commit will enable running of tst_dumpers on Windows using a MSVC
setup and lldb.exe as debugger.

Change-Id: I17611cc90ba2a04ec21aae11af16f1d0ff8e894f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-12-22 09:25:37 +00:00
Eike Ziller
7443ca977b Merge remote-tracking branch 'origin/12.0'
Change-Id: Iee11f97dbd0114957e856d02f0ad295813a05431
2023-12-20 16:05:55 +01:00
hjk
06545a3625 Debugger: Fix a (harmless) use after free in manual test
Change-Id: Ie7fdd9a5dbf3767faafead4ce85fb1c470e144cf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-20 08:31:22 +00:00
hjk
38d185e363 tests/unit/tests/mocks/sqlitereadstatementmock.h: Fix warning
sqlitereadstatementmock.h:267:25: note: default constructor of 'SqliteReadStatementMockBase' is implicitly deleted because field 'databaseMock' of reference type 'SqliteDatabaseMock &' would not be initialized
    SqliteDatabaseMock &databaseMock;
                        ^
sqlitereadstatementmock.h:31:37: note: replace 'default' with 'delete'
    SqliteReadStatementMockBase() = default;
                                    ^~~~~~~
                                    delete
1 warning generated.

Change-Id: Ia0f9a3f2e692585f509048d35fb01b380e2af035
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-18 13:27:56 +00:00
Artem Sokolovskii
d8561ccb2d SyntaxHighlighter: Fix tst_highlighter
Change-Id: I96c6c7b9843384d14bfa37b6bfdd494c881949af
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-12-18 09:00:57 +00:00
Robert Löhning
1f69ea54a0 SquishTests: Let tst_openqt_creator test for fixed bug again
This partially reverts commit f52c92bfe5.

Task-number: QTCREATORBUG-29923
Change-Id: I166aaca27cf8e27cb8555748c76ab163fabe7dcb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-15 10:08:57 +00:00
Robert Löhning
4dd44e01c2 SquishTests: Move definition of regexVerify() to where it's used
Change-Id: I1f06a36c62acbd6662737bdd6657981f3cf04c36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-14 15:10:30 +00:00
Tim Jenssen
d186d9df6a Merge remote-tracking branch 'origin/12.0' into qds/dev
Change-Id: I0a598ba1b4d57be361a7a203d0c39e99b5cd5fba
2023-12-13 14:53:17 +00:00
Eike Ziller
10e5a27c27 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp

Change-Id: If96d0f0a3d48c2581e765e4afb8b23924c48bdd6
2023-12-12 10:17:39 +01:00
Christian Stenger
1633d76b76 SquishTests: Allow designer test to progress further
Explicitly chose a newer kit as the kit we would use by default
lacks some compiler features on Windows.
This patch here only fixes the test crash when trying to access
a disabled menu item due to cmake dropping out with error when
parsing the project with the active kit.
Drive by change: removed workaround for fixed bug.

Change-Id: I783626f30d27ab1852536ae0d1f936ec8323feb8
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2023-12-11 14:03:13 +00:00
hjk
f97fd83fc9 Plugins: Add skeleton for new ExtensionManager plugin
This initial commit is merely a mockup of a ExtensionManager concept.

Change-Id: I19b2285667678a86097c043cc27a554545559eff
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-12-11 12:10:36 +00:00
Artem Sokolovskii
62ea85ee6a SyntaxHighlighter: Move SyntaxHighlighter to separate thread
This change involves the relocation of SyntaxHighlighter processing
to another thread. The core idea is to create a duplicate of the
original TextDocument using SyntaxHighlighterRunnerPrivate::cloneDocument.
A new SyntaxHighlighter is then instantiated by SyntaxHighLighterCreator
for the cloned document. The entire SyntaxHighLighterCreator class is
moved to a new thread, where it performs highlighting on the cloned
document. Upon completion of the highlighting process, the resultsReady
signal is emitted, and the updated highlighting data is applied to the
original document.

This shift of SyntaxHighlighter to another thread enhances the user
experience by preventing UI slowdowns during the highlighting process.

- Introduction of BaseSyntaxHighlighterRunner as an interface class for
future *SyntaxHighlighterRunner.
- Inclusion of DirectSyntaxHighlighterRunner class for performing
highlighting in the main thread, suitable for syntax highlighters
that cannot be moved to another thread.
- Introduction of ThreadedSyntaxHighlighterRunner class for highlighting
in a separate thread, preventing UI blocking during the process.
- Addition of Result data to the SyntaxHighlighter class to facilitate
data exchange between threads.

Task-number: QTCREATORBUG-28727
Change-Id: I4b6a38d15f5ec9b8828055d38d2a0c6f21a657b4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-12-11 09:55:02 +00:00
Eike Ziller
57d4ea4dcc Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/designer/formeditor.cpp
	src/plugins/git/gitplugin.cpp

Change-Id: I554a844fab4c55249a00f394f9ba174c7548dbbe
2023-12-11 09:28:21 +01:00
Alessandro Portale
608bb8cf3d Utils: Add StyleHelper::fontToCssProperties
This function takes a QFont and returns the relevant CSS properties as a
string. Using that CSS string in Qt's HTML supporting widgets ensures
the true to detail HTML rendering of text elements with those CSS
properties.

This change also adds an HTML sample to tst_manual_widgets_uifonts.

Change-Id: I7caf3214854f6ee62ae1211015572c640fc08dc8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-08 09:10:50 +00:00
Alessandro Portale
723ba0fc48 Utils: Add a manual test for StyleHelper::uiFont
Visualizes the predefined ui fonts.

Change-Id: Ic0af15ab149b213a59bf8e22cf7e17ab9042c54e
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-07 15:22:54 +00:00
Cristian Adam
6caf0f0d59 Testsleep: Fix CMake configuration error when test is disabled
If the user has a minimal configuration and the test is not enabled the
call to set_target_properties will fail because the target does not
exist.

Change-Id: I084c53e8d78d92547c1592edc0a19f48d4e76327
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-12-07 11:22:05 +00:00
Jarek Kobus
a737ddd931 Process: Use GeneralProcessBlockingImpl for QProcess implementation
This should fix the Process::waitForReadyRead() when the data
appeared on stdErr channel and not on stdOut channel.

Amends ec722b9132

Change-Id: Ib9f361f4d1602487bdbbb735e55d0ad24fb5e4c3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-12-07 10:47:59 +00:00
Jarek Kobus
db4486e915 Process: Add a test for waitForReadyRead on error channel
Currently it works only in case of ProcessLaucher implementation.
The issue with QProcess implementation is that we need to
select the active channel in advance with QProcess::setReadChannel(),
what really doesn't make sense, since we can't predict on which
channel we will receive the data.

Currently we don't have setReadChannel() method inside Process API.

Change-Id: I23592e37f2ed5e3326bead445a9c6c6500d0e615
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-12-07 10:47:50 +00:00
Jarek Kobus
2304dbb395 Process: Make multiRead test platform independent
Change-Id: Ife58e7b2a41ac35f8137acfc66ff827672f75de9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-12-07 10:47:45 +00:00
Jarek Kobus
1ea1ea7747 Process: Add a test for reading the errorChannel
Change-Id: I3b1d35c8ef2be91ddd1591a0fa2dafedc268f916
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-12-07 10:47:39 +00:00
Robert Löhning
f52c92bfe5 SquishTests: Update tst_openqt_creator
Task-number: QTCREATORBUG-29923
Change-Id: I59ccfca431ab4a0d7d5bb8be78c078e2e5d58825
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-07 07:52:58 +00:00
Eike Ziller
2e280e1c50 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/clangcodemodel/clangdfollowsymbol.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I45b7fee1a1d784c44f2139fb1ede69190d23d6fd
2023-12-06 16:50:15 +01:00
Robert Löhning
5c1b8dee32 SquishTests: Simplify and stabilize special handling of Mac menus
- Check condition only once
- Make sure correct length is being used

Change-Id: I8c9627d91b4f022d60bae039c0478248cc30d183
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-06 07:35:12 +00:00
Robert Löhning
c0d1975ff9 SquishTests: Fix fetching Jira status
Change-Id: If01b08673f88588eee9370488a429a6f633d93db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-04 17:49:18 +00:00
Marcus Tillmanns
0e59c9e4e1 Utils: Add "findOr(..., nullopt, ...)" function
findOr(nullopt) returns either a value or a std::nullopt for the first entry
in a container where the predicate returned true.

This makes it easy to write constructs like:

if (auto found = Utils::findOr(container, std::nullopt, [](auto){ ... condition ...}) {
...
}

Change-Id: I6f8f0f9c0d8486c32395123d8c2dcba427887189
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-04 10:24:17 +00:00