Commit Graph

153 Commits

Author SHA1 Message Date
Jarek Kobus
1d69f943aa Tasking::Process: Rename Process into ProcessTask
Rename QtcProcessAdapter into ProcessTaskAdapter.

Task-number: QTCREATORBUG-29102
Change-Id: I1902c7176da75db60d70125f505084a2ea5ba774
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:24 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
Eike Ziller
380f7622de Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/debugger/watchhandler.cpp

Change-Id: If759b6260dfa008738d3a0ce543eb0eead8a8bba
2023-02-27 09:48:12 +01:00
Christian Stenger
ac2d5d761d AutoTest: Fix handling of test results
Broke with d05c5b7d07. The id is
used to identify the application running a test or a global
message like some warnings or the information regarding the
current running test.
Fixes its usage and its display inside the results pane.

In the amended patch the assumption that if the m_id is empty
it corresponds to nullptr TestResultPtr was apparently wrong.
This patch fixes it so that the default c'tor of TestResult
always creates an invalid result, so that it corresponds now
to nullptr TestResultPtr.

Amends d05c5b7d07

Change-Id: I9949aec3fc2b7354de149433b7127933f2d9bf21
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-24 08:38:54 +00:00
Jarek Kobus
4f70aa7052 TestRunner: Reuse TaskTree
Get rid of QFutureInterface argument from
ITestConfiguration::createOutputReader() and from
TestOutputReader c'tor.

The fine-grained progress reporting was broken anyway:

1. The assumption was that testCaseCount was meant to be
   the total number of test functions executed. It didn't
   include the initTestCase() and cleanupTestCase(),
   while those were reported on runtime apparently
   (and exceeding the max progress by 2).
2. In case of tst_qtcprocess, when the whole test was run,
   the testCaseCount reported 41, while the real
   number of functions was 26 (+2 = 28 for init/cleanup).
3. While the max progress was set to testCaseCount initially,
   the corresponding FutureProgress rendered the progress
   always in 0-100 range, what didn't match the reality.

Instead, rely on TaskTree progress, which resolution
is per test as a whole. So, when executing a series
of tests this should scale fine. In addition, the
progress advances fluently according to the expected
run time - with 10 seconds hardcoded.

The original code locations, where progress was bumped,
are left with a TODO comment for any possible future tweaks.
Like in case of result reporting, fine-grained progress
reporting may be implemented by providing additional signal,
so there is no need for QFutureInterface inside
TestOutputReader.

Change-Id: Idc11d55e3a49dac8d1788948b9a82f68199203c6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-03 08:15:58 +00:00
Jarek Kobus
49f3b8efd7 ITestConfiguration: Introduce testExecutable() helper
Reuse it in TestRunner.

Change-Id: I59ffd256a7e84f0d0726261496d73bc4f622d666
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 12:37:54 +00:00
Jarek Kobus
51fed728e1 TestOutputReader: Report results directly through a signal
Instead of using future interface. The advantage is that
signal is delivered synchronously now, in contrary to when
future interface was used - it was queued into main event
loop.

Change-Id: Ic3d521c324c56b249515713c39bd09b9a924b6d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 09:52:09 +00:00
Jarek Kobus
d05c5b7d07 AutoTest: Use TestResult as value type
Don't construct it on heap and don't use shared pointer for it.

Change-Id: I51c9da405ed14d24b5f20242b4d049f9e2958f09
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 09:51:34 +00:00
Jarek Kobus
7e815270f1 TestRunner: Get rid of unneeded Utils:: prefix
We are using Utils namespace in this file already.

Change-Id: Ib4b36782b3272eb4974d8dada4518b0d4eec2f21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-18 14:01:57 +00:00
Jarek Kobus
39940a7200 TestRunner: Use QList instead of QQueue
There is not a big benefit when using QQueue - QQueue::dequeue()
has its counterpart in QList::takeFirst(). Using list makes
it possible to assign another list into m_selectedTests.
Make use of QList API consistent in this file (use isEmpty(), first()).

Change-Id: I4a320469f5b44c61f8c51196c104a6ca0d0534e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-18 14:01:32 +00:00
Jarek Kobus
fdebf0343d TestRunner: Merge 2 public methods into one
Merge setSelectedTests() and prepareToRunTests() into runTests().

Change-Id: I908c41483f05eeaec186f362391941a797d66e6a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-18 13:50:37 +00:00
Jarek Kobus
c9f5098c07 AutoTest: Rename outputReader() into createOutputReader()
Make it clear it's a factory method that creates new instances
of objects, not a simple getter.

Change-Id: I0b44506a27a0353bc524831c305f947510f59e98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-18 13:50:20 +00:00
Jarek Kobus
9438575beb ProjectExplorer: Move settings structures out of Internal namespace
There is a public exported API that returns these structures,
and different plugins use it, so there is not point in keeping
them inside Internal namespace.

Remove some unused includes.

Change-Id: Ia9d3fc83738c38ae37f04ae0f518ec5d972c9d85
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-13 15:06:19 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Jarek Kobus
9e571931d0 AutoTest: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Glue lambda brackets with parameters brackets.

Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 09:32:42 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
5dcfbe6c52 Autotest: Use more FilePath
Change-Id: I15de1121305f245274d74b4116786f6f07ffa3c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-23 07:25:16 +00:00
Alessandro Portale
912b016ab0 Utils: Add "Layouting::HorizontalRule" LayoutItem
We have many horizontal separator lines in the UI, which are each time
repetitively created from a QFrame with some flags set. With the .ui
inlining, we will have more of these separators coming.

This change intoduces a Layouting::HorizontalRule LayoutItem and
replaces various existing QFarme separators with it.

Change-Id: I60bad89e2a2b777fbd2f9d0cf872af81e41dcfd7
Reviewed-by: hjk <hjk@qt.io>
2022-08-29 15:30:25 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
960e99ecb1 Autotest: Convert to Tr::tr
Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-01 12:16:41 +00:00
Jarek Kobus
4a9fe3e709 TestRunner: Don't call blocking waitForStarted()
Handle failed to start case inside done() handler.

Change-Id: Id138f0ef1fc58b6e335e08d8222e99c29c06b942
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-04 12:40:16 +00:00
Jarek Kobus
425a0c8835 AutoTest: Connect to done() signal instead of finished()
QtcProcess::done() is also emitted when process failed to start.

Change-Id: I08f6f104014d1c90c0f761de352dada620207d86
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 12:51:42 +00:00
Christian Stenger
b28f907114 AutoTest: Use QtcProcess for test runner
Change-Id: I29b15a08a260aaf8d2c4071d5ea71d49902d8ef6
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-14 13:33:20 +00:00
hjk
a579fa52ee ProjectExplorer: Rename some RunControl functions
Change-Id: Ia86a50100ddfd465d548863ae8d58033a5dbafc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-02 08:10:28 +00:00
Christian Stenger
17ef9bc35c AutoTest: Ensure test runner does not get stuck
If we fail to start the executable or the executable is missing
we need to ensure the runner continues by cleaning up and
scheduling the next test if there are more.

Fixes: QTCREATORBUG-27285
Change-Id: Ia89374d7105f2fd6a42fa3fa018f14677e30ad1b
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-03-31 13:03:45 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
Christian Stenger
5525f2b112 AutoTest: Use Utils::FilePath for files and directories
Still some missing bits as some QString members had different meanings
depending on their context.

Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c
Reviewed-by: hjk <hjk@qt.io>
2021-05-27 12:24:05 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
Bernhard Beschow
2d92ae391a AutoTest: Prefer ITestBase::type() to ITestBase::asTest*()
The casting provided by the asTest*() methods isn't made use of here, so
using the "data-oriented" type() method seems more expressive.

Change-Id: Ia3e1a28d126f096afed54eeb0d884c52332f4350
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-09 22:38:20 +00:00
David Schulz
7853c6ba4d AutoTest: add ITestBase::type() for better readability
Change-Id: I67133f4940329483f2d8d25d1212f4e07f57d39d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 05:15:15 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Christian Stenger
5d1c789c27 AutoTest: Introduce TestToolConfiguration
Preparation for having code based and build system based
test items.

Task-number: QTCREATORBUG-23332
Change-Id: I4d21142d74b40b988d82c69d02f5c6633c8cebe4
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:56 +00:00
Christian Stenger
e95041c054 AutoTest: Guard against nullptr access
Change-Id: I0378b043ed240533ce6f4b341705dc84d6ede7eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:17 +00:00
Christian Stenger
239a59c596 AutoTest: Introduce ITestConfiguration
Preparation for an additional simpler test configuration
which needs to have the same common base.

Change-Id: I1800ed5d7301f1aea99eba6ef588a204697bd569
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:04 +00:00
Christian Stenger
ac14a1e038 AutoTest: Clean up header mess
Better decoupling and reduced binary size.

Change-Id: I4f6239979d9d7dae4ad92f19ec8420be38372c07
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 08:24:01 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Christian Stenger
5f22126a79 AutoTest: Support gathering failed tests
Mark test tree items as failed for the last run
to be able to re-run them in an easier way.

Change-Id: I7ea3dcd16e5a02797d41f13e02b2fa95b857cf5e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-16 06:53:54 +00:00
Christian Stenger
745beb7634 AutoTest: Fix possible nullptr access
If the process of the test executable cannot be started
for whatever reason we will not have an active run
configuration or output reader.

Change-Id: I50146a2c8228ad39574e007ae2659465122ad20b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-15 12:59:05 +00:00
Alessandro Portale
bb89b80097 AutoTest: performance-for-range-copy
Change-Id: I60e79aec1fe2813867d8ff46cec7d39b848d0020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 07:01:10 +00:00
hjk
f3c1751965 Autotest: Move Test{FrameWorkManager,Runner} singletons
Make them plugin-pimpl data members, removing some indirections.

Change-Id: Ie441ac94a27f07342513b0b5b1437ccfe4b5d7d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-26 16:46:17 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Christian Kandeler
9348ac5fec Utils: Remove the *SameLine OutputFormat enums
Presumably, they were intended for output that shouldn't get an
automatic newline, but if there ever was such a thing as automatic
newlines, it must have evaporated over time. All users of
OutputFormatter provide a newline if they want one.

Change-Id: Ibd219b7305fd503ce075d6f77930d2b538d5e2e8
Reviewed-by: hjk <hjk@qt.io>
2020-03-18 13:52:17 +00:00
Christian Stenger
5a562bd9b1 AutoTest: Fix possible crash
Re-triggering runOrDebugTests() should be done
only once to avoid the test runner interfering
itself and crashing QC.
Amends 0f60f120d2.

Change-Id: I49f666f2c96730729ef54d8d8781d4058b3e0cca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-18 09:08:32 +00:00
Christian Stenger
0f60f120d2 AutoTest: Handle async updates of executable information
When opening or creating a project for the first time the
executable path of the application targets may be empty
until the build system has updated this after the first
successful build.
This update happens asynchronously, so we might need to
postpone the test execution a bit and wait for the
respective update.

Change-Id: I63b5c45f6ecb194020ea36bbb5c9486a4dcc004c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-17 14:32:02 +00:00
Christian Stenger
769bd017b9 AutoTest: Remove unreachable code
Change-Id: I98d3d21fe8239f376e0c2619b10bc5b44267cb0e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-11 11:39:31 +00:00
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.

AA_DisableWindowContextHelpButton was added in Qt 5.10.

Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 13:26:44 +00:00
Christian Kandeler
5cebf2a79a ProjectExplorer: Move some build-related code to BuildManager
The projectexplorer.cpp file is a huge mixed bag, which could use some
cleaning up. The queue() function is very much related to the
BuildManager, so move it there.

Change-Id: Ibc6425cc27d44514803a5e7c6139f83ddd760382
Reviewed-by: hjk <hjk@qt.io>
2019-12-19 17:35:46 +00:00
Eike Ziller
3b583061a2 Merge remote-tracking branch 'origin/4.11'
Change-Id: I066040bd5e762d580c8a903122f451f2193df186
2019-12-19 12:21:00 +01:00
Christian Stenger
62fd368473 AutoTest: Fix stopping test debug run
If the Debugger gets into a corrupted state and is not
stopable cleanly we do not get the stopped signal.
This in turn leaves the test runner in an inconsistent
state which cannot be reset except with a restart of Qt Creator.

Fixes: QTCREATORBUG-23298
Change-Id: I9d7e7cbc847f8883d2e750f4436c5ef281106d3a
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-12-19 10:13:28 +00:00