Commit Graph

53 Commits

Author SHA1 Message Date
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
Christian Stenger
ea86ff5eb0 AutoTest: Avoid triggering run tests while building
Disable respective actions while a build is running to avoid strange
side-effects or race conditions.

Change-Id: Ifc8d1c9fc9fd4d705cabd148b145708e23029dba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-19 06:59:08 +00:00
Christian Stenger
b273d7be6a AutoTest: Ensure that removing and adding qml files is noticed
Task-number: QTCREATORBUG-17805
Change-Id: I068f6925fc39813a504205c4ef8e8b9f9e911189
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-07 09:57:53 +00:00
Christian Stenger
23398229e9 AutoTest: Modernize code
* remove unnecessary QLatin1String where possible
* foreach
* nullptr
* bad naming of static members

Change-Id: If0f7c6839be4d2efbfef6f7f0775d2034775bd90
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-02-17 08:01:36 +00:00
Christian Stenger
69a94c2c28 AutoTest: Always parse if plugin is enabled
Remove the 'Always parse' setting and respective special handling.
This simplifies the handling of parsing for tests and removes
strange special handling that was introduced in earlier versions
and led more to confusion on the user side.

Change-Id: Ia4d122ed448244f3cb3876dda9930864afde9c28
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-12 10:57:47 +00:00
Christian Stenger
f967545c5a AutoTest: Fix handling of enabled state for code parser
Avoid unintentional re-enabling of the code parser.
Handling of the enabled state broke several times before,
therefore separate it from other states of the parser to
avoid breaking it again when not taking enough care while
refactoring or adding features related to states.

Change-Id: If1eb0dd649225f10bfc3bf06f09851649da75983
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-14 09:57:25 +00:00
Christian Stenger
cbc4ee0af6 AutoTest: Fix enabled state of global Tests menu
If tests are running the Tests menu's (current) items are all disabled
which led to having the menu disabled as well.
Ensure to have the menu enabled regardless the sub items' state.

Change-Id: I561f1eb75637f03a27df012129455e06be38ea87
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-26 10:00:19 +00:00
Christian Stenger
18dc7a5de9 AutoTest: Move framework settings into framework manager
Change-Id: I9914291adb102de5136802eb3b6d12afb6276538
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 06:34:28 +00:00
Christian Stenger
48b2af5e77 AutoTest: Cancel possible running tasks on shutdown
If tasks are running while shutting down we might end up in a crash,
so cancel all tasks and handle possible invalid accesses of the
current running processing.

Change-Id: I69f7cac5f44390e322fa301af6d6794270c95c2a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-15 09:18:01 +00:00
Christian Stenger
5988fd0f5c AutoTest: Add minimum support for debugging tests
This adds another context menu entry for items on the test tree
to allow debugging of a single test.

Task-number: QTCREATORBUG-16070
Change-Id: I98f56b0f22c94ad71f0b91d690383043ed27f1c7
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-22 10:51:12 +00:00
Christian Stenger
8cba580343 AutoTest: Introduce active state for test frameworks
Change-Id: I0fddce91a239c0a51352a25e34a221fd8880b733
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-06-14 11:05:35 +00:00
Christian Stenger
5ef85949a8 AutoTest: Add test frame work handling
Mainly a preparation for enabling/disabling test frame works.

Change-Id: I0bbea7e055a607517ef8193587c229cadf0de027
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-09 11:50:26 +00:00
Christian Stenger
d198c4a22f AutoTest: Add Id to parsers and remove now useless enum
Preparation for introducing test frameworks.

Change-Id: Iefaa4ca9dd9af665444556afa9c6e326041cfd0f
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-07 09:12:12 +00:00