Commit Graph

114 Commits

Author SHA1 Message Date
Christian Stenger
ca0c3bc55c AutoTest: Extract helper function for re-use
Change-Id: I38993e28090ff68803bfc417d1590e1b2eb97bbe
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-04-29 09:56:47 +00:00
hjk
17055f2e18 Core: Add a MenuBuilder
Use it in the AutoTest as example.

Change-Id: I357faba71f685ea05206a7e1ca93069a88787823
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-02-01 06:59:09 +00:00
hjk
45a62e785a AutoTest: Use setupFunction for TestSettingsPage
Change-Id: Ib592b3fd92480a5e712cf7cd69d4b5c899a1f216
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-29 09:15:32 +00:00
hjk
45bb4a5f76 Autotest: Move unit plugin test creation closer to the tested code
The current pattern.

Change-Id: I52354584734755b3b0f3d2c9596801dc050300fc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-19 12:33:33 +00:00
hjk
3e3cf3f8a4 AutoTest: Hide plugin class definition in the .cpp
It's not meant to be accessed from the outside.

Change-Id: I0652ec8309e678a9b28e05acab6d0f77a0b13639
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-12 08:41:43 +00:00
hjk
00815e006d AutoTest: Use new setup pattern for TestNavigationWidgetFactory
Change-Id: I2d2c6f2a3dc8b416dae2e041f358a3f412216d4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-10 08:22:40 +00:00
hjk
ea090adcdb AutoTest: More ActionBuilder polish
Change-Id: Ic7ba4ea43887c0589055df8e84c047242aea0809
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-12-19 15:27:33 +00:00
hjk
f2d4d62fed Autotest: New-new ActionBuilder setup
Change-Id: Id4bc4422da62b7017cfc54c16bd6dbc4852de276
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-12-19 15:02:17 +00:00
hjk
b442ca3873 Core: Rename ActionBuilder::setOn* to addOn*
There could be multiple connections.

Change-Id: I7dbca9d24599f776b7d1f1bfa11826e3eeb5640a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-13 13:00:00 +00:00
hjk
e17f0b6164 Core: Rename ActionBuilder::setContainer to addToContainer
An action/command can be used in several places.

Change-Id: Ifa26f64f7d200d93ada13f272de0fa833f886997
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-13 08:37:10 +00:00
Christian Stenger
bc64be06d7 AutoTest: Provide locator for finding data tags
Makes it possible to jump to Qt Test data tags using the locator.

Change-Id: I9b4590b0520a59675cd05055ee07918aa0dcf08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-05 14:45:00 +00:00
hjk
f1f4df29b5 Autotest: Use new construction pattern for project panel factory
Change-Id: I09abb1d5dbb07a700053077b03e65a3dce4b3f1f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-16 09:49:32 +00:00
hjk
82c77b1304 AutoTest: Use ActionBuilder
Change-Id: If109c8b6916bb59ec5c7d58b50dc9a61ca1b4a96
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-13 07:28:20 +00:00
Marcus Tillmanns
824fee183c Fix setEnabler / readSettings order
BaseAspect::setEnabler requires the settings to be read already.
This is because readSettings() does not emit "valueChanged", and so
the connections from the enabler to the target are not triggered.

Change-Id: I0c95e2b516cd03c1dbad653288b44510ec7ea800
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-07 08:54:34 +00:00
Christian Kandeler
3861608c63 AutoTest: Create sub-menu for "run test under cursor" actions
No need to add all four variants to the top level of the context menu.

Change-Id: Iffed7abdf06be5d6811b4dde83f27aa865627134
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-22 07:53:57 +00:00
Christian Stenger
e26fee092b AutoTest: Allow temporarily disabling of functionality
Especially when touching headers included centrally while
refactoring bigger projects the retriggered parsing of
large (depending) parts of the project can become rather
annoying.
Adds an action for immediate disabling parsing and
respectively other test related functions.

Change-Id: I553615cce90bc88d636a4519718887306ee5215b
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-30 12:21:53 +00:00
Jarek Kobus
121d73b30f Utils: Rename ProjectExplorer::Runnable into Utils::ProcessRunData
Move it into Utils lib.

Change-Id: I3b6c16d18439cabddf59afc03116f13c1970102c
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 07:44:34 +00:00
hjk
3ad3b6a975 AutoTest: Dissolve TestFrameworkManager
It's a handful functions around two independent lists.

Change-Id: I0a7015deef27a77d4e67488e1f9b6c7a8d71133b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-28 10:08:32 +00:00
hjk
323f29a3bd AutoTest: Merge settings and tools hierarchies [2/2]
Renaming files to match class names.

Change-Id: I3d75a79a5ad8e9d1c132530cbcc6973efc6dbadf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-12 13:08:28 +00:00
hjk
0b83f110f4 CppEditor: Make a few CppModelManager functions static
... to simplify code using it.

Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-12 13:08:09 +00:00
hjk
14e18fc92f AutoTest: Merge settings and tools hierarchies [1/2]
Currently living in the settings files to keep changes small,
will be renamed in a second step.

This allows the settings aspects to be used in their short form
and overall removes some indirections.

Change-Id: I099369b62239aed8192613a04bca958a660c36c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-12 12:12:17 +00:00
hjk
694d81ad63 Autotest: Adapt to changed settings access pattern again
Settings are created on first access now, even though this
doesn't matter much here as this happens unconditionally in
AutotestPluginPrivate ctor via m_frameworkManager.synchronizeSettings()

Change-Id: I340927cf107d7e4b2268e842d23f1a89898e8a92
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-10 08:13:37 +00:00
hjk
91513a53dd Utils: Make aspect settings access implicit
Generally, aspects should use fromMap/toMap, but some older pages
use {from,to}Settings with always the same ICore::settings().

To make that less intrusive on the user code side, make that globally
implicit.

Task-number: QTCREATORBUG-29167
Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-07 09:02:29 +00:00
Leena Miettinen
0814677b4c Autotest: Fix UI text capitalization and punctuation
Change-Id: I7ca8adec90ad93c9724126b170dcea895266e38c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-19 12:31:08 +00:00
hjk
30af7a9503 AutoTests: Aspectify parts of main settings
Change-Id: I407b5102e1f2a6647f6fdca01a61dfa422c5d3ee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-12 14:54: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
hjk
c0cce829b5 AutoTest: Use new test object setup
Change-Id: Icf750f084d8c2b5c34e62dfedd62bc785406d590
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-14 10:24:30 +00:00
Christian Stenger
d2656c60e6 AutoTest: Widen scope for run under cursor
..and debug under cursor for QtTest and GTest.

Depending on the information coming from the code model
we may be able to get a correct scope even when standing
inside the function that is defining the test.
This makes more sense than the original behavior which
made it a hard requirement to stand on a literal to
run or debug a test under cursor.
But as the codemodel does not provide usable information
for all frameworks keep the original behavior as fallback.

Task-number: QTCREATORBUG-28752
Change-Id: I13ea7b0ad1e8207da6cb884d212667c4c657957c
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-07 13:56:07 +00:00
Christian Stenger
9277bb5111 AutoTest: Extract function to get active frameworks
For later re-use.

Change-Id: I87cf6db4de861b626e4669351df3f5119952328f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-07 13:56:01 +00:00
Jarek Kobus
bc3ebef7ce AutoTest: Use using namespace Utils more often
Change-Id: I9d20cd3496c4719d58a977f8fd53253c86d55463
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 09:51:55 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +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
David Schulz
fce9583fd3 Autotest: adjust actions tooltip case
Change-Id: Icc788866dc85cc780482d7a08df56b6d762ccad5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-11 10:18:42 +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
Jarek Kobus
ecf83d667c AutoTestUnitTests: Remove TestStringTable scenario
Instead, we should provide tst_StringTable that would
run GC, make a sleep inside GC being run in other thread
and execute destructor of StringTable in main thread.
In this case the test should ensure that destructor of
StringTable waits for its internal thread to finish.

Amends 7a02b39f26

Change-Id: I017b5a8f98b41ef6884c43d319858dcb16f17fba
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 14:46:24 +00:00
Christian Stenger
ad072db2b6 AutoTest: Improve run and debug under cursor
Especially when running tests that are not macro-based
(e.g. QTest) it could happen that more functions had been
executed as the filtering only applied when the cursor
was located at the definition of the function.
Try further filtering using the code model to avoid running
functions that match by name, but are located in a different
class.

Fixes: QTCREATORBUG-28496
Change-Id: I6c543f028aa20a75cc091e8db87207c41be580aa
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-01 05:51:01 +00:00
Jarek Kobus
ccb2317a16 Android: Fix clazy "Mixing iterators with const_iterators" warnings
Change-Id: I90fd2c10240a367ef546f9b48b2a2f784f00f4e0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 07:09:10 +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
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
4ad8fb80c6 Utils: More forward declarations / drop unused headers [H-K]
Round 1 - focus on headers.
For classes with initial in range [H-K].
Try to keep the same separators between different kind of headers.

Change-Id: Iefb032953743be41a847ee011c30527edfa425d8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-25 07:14:04 +00:00
Jarek Kobus
6cd736fe6c Remove algorithm.h from buildtargetinfo.h
Change-Id: I777212fb94d46c1c71f017288b7e38dd5db62a91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-18 08:38:05 +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
Petar Perisin
d005e71da0 Autotest: Add more "without deployment" actions
When debugging tests, if there was no change in code, user should be
able to just rerun tests of his choice. However, currently there are not
so many options to just rerun tests without the build.
This patch adds more options to run tests without deployment, which can
speed up development in some environments

Change-Id: I9f998fee90f2e61a1623bd0840a9d5ddf8eb58d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 10:21:58 +00:00
Bernhard Beschow
35021ec2da AutoTest: Turn pointer into value
... which avoids a raw pointer which needs additional "management".

Change-Id: I9c478b4043a563b00ced09de8366657eaf34c349
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 16:42:43 +00:00
Christian Kandeler
b1837036b3 Fix some warnings about unused lambda captures
Change-Id: Icfb1b963b3c55656c760497e4ae3ece2bdccbbc7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-24 12:07:31 +00:00
Jarek Kobus
5b0889777a Add a test for a crash in ModelManagerInterface
Task-number: QTCREATORBUG-25350
Change-Id: I4ea31e7936cc77dcd8f3fc494b5ecbd83858a766
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 12:42:53 +00:00
Jarek Kobus
a3b5306147 Add TestStringTable scenario
This scenario is used for testing against regression in StringTable.
If the scenario went OK, the creator finishes and doesn't crash.
Later, this scenario will be invoked from additional test, so that
the second instance of creator will run and the test will
check if the subprocess finished OK. So it's going to be combined
with autotests in the follow up patch.

In order to test it, run creator with the following command line:
"-settingspath ~/.config -scenario TestStringTable". Make sure,
that you point settingspath to creator settings which have
proper kit with a toolchain and Qt setup.

The regression may be tested by restoring the
src/plugins/cpptools/stringtable.cpp to the parent of
f4ab1279fd and by applying on top of it
this patch (simple conflict may need to be resolved). In this case
running this scenario ends up with a crash (so, it confirms this test
fails on the old code form before the fix).

Change-Id: Icbb56233495047fd68bfb605fcd088f352a16323
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-02 16:56: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