Commit Graph

115 Commits

Author SHA1 Message Date
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
Eike Ziller
8f89c9a846 Merge remote-tracking branch 'origin/4.12'
Change-Id: I04d9cc69a07d4d07b1bf1df57681d6a68587d7ba
2020-03-06 09:44:11 +01:00
Christian Stenger
afffbe01aa AutoTest: Fix leaking of project settings
Make sure project settings will be destructed
correctly.

Change-Id: I633bf744eb2e0835fe89e3a9f3c2f7293c5f5275
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-05 14:32:55 +00:00
hjk
722705e1e7 AutoTest: Use normal object for settings
Ownership is clear here.

However, since this is accessed via the static plugin interface,
this needed some change that access.

Change-Id: I9488a242442303dee89006240f787677afab730a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-02 09:56:10 +00:00
hjk
df7400b686 ProjectExplorer: Disentangle ProjectExplorer::updateRunActions
This enforces a linear pass through

  [static] ProjectExplorerPlugin::updateRunActions
  ProjectExplorerPluginPrivate::doUpdateRunAction
  [emit] ProjectExplorerPluginPrivate::runActionsUpdated

instead of the previous direct emission of the signal from
user code and connecting also the internal update to it.

This is meant to simplify reasoning about execution order and
maybe to help elimimating double executation.

Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:32:58 +00:00
hjk
299d34d547 Remove apparently unneeded QtPlugin includes
Change-Id: I511c0318a72dbf2a92e4749dee02eabfc9826139
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-12 16:03:37 +00:00
Alessandro Portale
4d3fd8706b Autotest: Use correct Icon for "Run Test Under Cursor" action
The "TOOLBAR" version is too bright and has a shadow (in non-dark
modes).

Change-Id: Ic7e8500fd9ecad4465bf2d9dfba53c0bf6538a66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-18 07:14:01 +00:00
Christian Stenger
49942bc06a AutoTest: Re-order responsibilities
Keep the timer for syncing frameworks where it
is really used, do not create functions that are
not necessary at all.

Change-Id: Ie0a49a2611dc67510b72562455ea2a1af7b1c538
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-06 10:07:01 +00:00
Christian Stenger
df93c6c5a7 AutoTest: Pimpl plugin
Change-Id: I36c1ec242e29b9d06c1c2304960b445833fb9ebb
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:01 +00:00
Christian Stenger
43e27f76b3 AutoTest: Add project based {en|dis}abling of test frameworks
Provide integration into the 'Project' view which allows to set
some settings on a per project base.
For now only enabling or disabling of test frameworks.

Task-number: QTCREATORBUG-16704
Change-Id: Iedd9a300164931e07a21cbb4e5a222be3266c81e
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-02 05:49:52 +00:00
hjk
7ab6783e24 Standardize on int for line and column values
Recently tons of warnings show up for presumably "problematic"
singned <-> unsigned and size conversions.

The Qt side uses 'int', and that's the biggest 'integration surface'
for us, so instead of establishing some internal boundary between
signed and unsigned areas, push that boundary out of creator core code,
and use 'int' everywhere.

Because it reduces friction further, also do it in libcplusplus.

Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-26 09:23:48 +00:00
David Schulz
fe61cd6a9e Test: Fix double semicolon
Change-Id: I8f858ef2345f19a0067cbfb4437cb432360e490d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-10 05:49:16 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Eike Ziller
e0b0a08e50 ExtensionSystem: Move away from QList
Qt 6 API will move away from it.
Use QVector for API and some std container for internal things.

Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 14:21:00 +00:00
Christian Stenger
339f26aec1 AutoTest: Add basic boost test support
Provide experimental support for Boost UTF.
This patch adds the basic implementation for
 * parsing the code for Boost tests
 * executing the found tests
 * displaying respective results

This is just a basic and limited support which
needs to be enhanced and improved later on.

Task-number: QTCREATORBUG-21169
Change-Id: Ie0da5f51f90fb1fa7217eac461ebfc5214395ef6
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-20 13:09:08 +00:00
Christian Stenger
6dee2dc019 AutoTest: Make automatic popup of results pane configurable
Let the test results pane automatically popup before the
first test result is added to indicate running the tests
has started.
Beside this provide settings for enabling or disabling
the popup of the results pane on start or finish of a
test run and make it possible to limit the automatic
popup on finish to failed test runs.

Change-Id: Ib22735536effd9f2330b39a7d2830c97839eb21f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-03-20 05:49:33 +00:00
Christian Stenger
6f73b3b175 AutoTest: Limit test execution under cursor
Run and debug under cursor simply used the literal under
the cursor to find matching test cases or functions. This
obviously finds more than the test under cursor.
This patch limits this behavior by taking current file
and line number into account as well.
If the action gets triggered on a test definition then
the found tests are limited to this position.
If the literal under cursor does not belong to the
definition of the test (declaration, string, comment) the
original behavior gets triggered.

Fixes: QTCREATORBUG-21093
Change-Id: I051d25c1d18e819caf2950b5c62d51e6d70d1b22
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-17 07:02:56 +00:00
Christian Stenger
bab836c009 AutoTest: Provide way to remember last chosen run configurations
In some special setups it is almost impossible to get the right
executable or run configuration. For bigger projects this can
become a pain point when trying to execute tests and always
getting asked which one to run.
So, allow remembering the choice and use it if appropriate.
The cached information is not stored permanently.

Resetting of the cached information can also be triggered by
switching or closing the current project and inside the settings.

Task-number: QTCREATORBUG-20859
Change-Id: If416ea0ae9ad3548daca2ffcf5888fd568fd2622
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-21 06:52:39 +00:00
Eike Ziller
7b6ea357f6 Avoid shortcuts with "Alt" on macOS
On macOS shortcuts with "Alt" are used for entering special
characters, where "special" depends on keyboard layout and can
mean e.g. '|' or '~'.

Task-number: QTCREATORBUG-20873
Change-Id: Ifa70b95381ef48d2ba3b15a528a5dcfe43d53bfd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:52:44 +00:00
Christian Stenger
59f864a758 AutoTest: Silence soft assert
Change-Id: I6aa2490971fcf4fbbbbc0bad570406e349029b32
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-23 11:26:18 +00:00
Sergey Morozov
57edd22d11 AutoTest: Add action to run all tests from current file
Run specific test functions since one test case can be implemented in multiple files.

Task-number: QTCREATORBUG-20329
Change-Id: I07f435c264f18e9608caa5b7ee20dff2d33ee9c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-15 14:41:53 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Christian Stenger
51cc3957b4 AutoTest: Replace expensive function call
Depending on the underlying project manager it can be
pretty expensive calling PE::canRunStartupProject().
AutoTest plugin used this to determine whether its
global actions should be enabled or not and updating
these actions is triggered for too many causes.

Replace this function call by some simple checks that
have almost no cost to avoid blocking UI.

Task-number: QTCREATORBUG-20175
Change-Id: I0e3cce683f33abe82bf1354ec5276250f5e30068
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-09 10:38:23 +00:00
Pawel Rutka
c8f1da095d AutoTest: Add possibility to trigger test run from source
Change-Id: Iceed69747de64d76f34451d41f719c8dbdd81e44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-16 10:50:21 +00:00
Eike Ziller
205c930592 Merge remote-tracking branch 'origin/4.6'
Change-Id: I63f8aebb201936f671b1486ff9420f67e5e3fafc
2018-03-01 15:46:37 +01:00
Christian Stenger
79e1a8a042 AutoTest: Correct enabled state of context menu items
Permanently enable (De)Select All and allow triggering a
rescan also if there is a build running.

Task-number: QTCREATORBUG-19940
Change-Id: Ia0e8a5da135c3c59aba4ab179ae2970c25d470f3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-28 14:02:41 +00:00
Christian Stenger
0bd6f712f0 AutoTest: Access plugin singleton through static functions
It's the more common pattern nowadays, and cheaper.

Change-Id: If6217b2a820fbfa6f088fd9349225f5f8488f593
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-01 09:51:54 +00:00
Christian Stenger
56fbeb8a68 AutoTest: Avoid global object pool
Instead of adding internal objects to the global
object pool keep them to handle their destruction.

Change-Id: Ie6217b2a820fbfa6f088fd9349225f5f8488f593
Reviewed-by: hjk <hjk@qt.io>
2018-02-01 09:23:14 +00:00
Christian Stenger
dc1e6519a6 AutoTest: Consolidate handling of global menu items
Change-Id: I6ad07775d63206864ec330ad87d3b65e5ecaf76c
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-19 08:57:31 +00:00
Christian Stenger
8288eadac6 AutoTest: Unify handling of run modes
Move used enums more central to avoid duplicating
information and unify their usages.

Change-Id: I33e9bdc11f7da16ecabf03991b5a5f550a53bdad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-09-18 10:01:18 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00