Commit Graph

96 Commits

Author SHA1 Message Date
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
Bernhard Beschow
06dd646370 AutoTest: Only expose ITestTreeItem in TestTreeModel's public methods
Change-Id: Ide2513c838178b841763fe781478748a852a258c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:44:16 +00:00
Christian Stenger
a59e04b848 AutoTest: Provide basic ctest integration
This allows to have ctest based tests listed inside the test
integration and to run them.

Task-number: QTCREATORBUG-23332
Change-Id: I1cb855697d7bb4afcd7c887506abdea16c252cb0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 08:25:03 +00:00
Eike Ziller
eaefcbd8f0 Use new, more evocative MessageManager API
At various places where semantics doesn't change.

Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447
Reviewed-by: hjk <hjk@qt.io>
2020-12-16 09:30:44 +00:00
Alessandro Portale
8df758c45e AutoTest: Use separate icon variations for toolbar and menu
For the "Run" and "Run failed" actions.

Change-Id: I7fc537cbe0727038740f2c26478c30dc96babb66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 16:27:38 +00:00
Alessandro Portale
19e13ddd6b Utils: Add "Run File/Selected" icons and use them in ClangTools/AutoTest
In AutoTest, use the toolbar and menu variants accordingly.

Change-Id: I1405de1ace1efe6c3e51b17356a9e4dfb3b11dcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 16:27:28 +00:00
Christian Stenger
c217f0694d AutoTest: Allow registering ITestTools
Task-number: QTCREATORBUG-23332
Change-Id: I529b1cc1f110739c264c7a021aada063f697b1db
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-27 09:53:43 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01: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
Jarek Kobus
e97a267533 Don't create a temporary list of values for qDeleteAll
It's enough to pass QHash as an input for qDeleteAll,
it will delete all values and won't touch keys.

Change-Id: I9b00963888ac780f74eabdf59ad02890a042a0d2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:33 +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
Christian Stenger
f849bd1105 AutoTest: Support run failed
If the last run had failures and the test frameworks
support matching a test result to a test tree item
give the user an easy way to re-run all failed tests.

Change-Id: I4f3150ca8a6514c09cf7ca819f84e38c6419a310
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-16 06:54:02 +00:00
Christian Stenger
790757a8e8 AutoTest: Fix persisting of check states
Persistent settings cannot handle QVariantHash and when
reading the check state the meta type system seems to have
the need to have used the check state already before,
otherwise it will fail to convert until it uses it.
This happened e.g. when re-opening a project that had
former check states stored inside the project settings
directly from the Welcome page after starting QC.
Amends df49d6e40d.

Change-Id: Id2b85373c151efb5890fe5fb7392bdbc11adda50
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-19 13:55:29 +00:00
Christian Kandeler
02785342ac Fix some clang warnings about unused lambda captures
There are more, but we need to keep those because MSVC believes they are
required. This is the subset that satisifies both compilers.

Change-Id: I0b0a63d5496acc119a7f0513d3a1da0b76fa1fca
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-24 08:44:58 +00:00
Jochen Seemann
de38285bc3 AutoTest: add support for Catch framework
This adds a basic test and test output parser for the
Catch2 test framework.

Task-number: QTCREATORBUG-19740
Done-with: Christian Stenger <christian.stenger@qt.io>
Change-Id: Ic3322905ab82f414d2a26c325e130142233f72aa
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-09 12:46:37 +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
hjk
7158e67612 AutoTest: Move TestCodeParser and TestTreeModel ownership to plugin pimpl
Change-Id: I01b32aae894a4b419c8a067f604d5f04a2b14dfe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-20 13:13:52 +00:00
Christian Stenger
9471bd581e AutoTest: Remove back reference
There is no need for holding the q-pointer anymore.

Change-Id: I9de19238b0cf0d59cd1e88590b7b2dfaf28ff285
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-09 11:59:12 +00:00