Commit Graph

151 Commits

Author SHA1 Message Date
Christian Stenger
2c7e769e31 AutoTest: Clear up and generalize
Instead of transforming forth and back the output
try to handle the output once correctly and pass it
line-wise around.
This also ensures that we always get a single line
when appending the output which will be necessary
later on.

Change-Id: I3e9c6db5f81172997dfe566eee9a86bfe2f17a1f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-11-13 13:07:25 +00:00
Christian Stenger
3e56a2b81e AutoTest: Add some logging to test runner
This may help for issues which are not easily
reproducible.

Change-Id: If8063c51f69bd24f12afdcdd0648790f1a0668da
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-17 04:41:09 +00:00
Christian Stenger
a8cad2038e AutoTest: Tweak run after successful build
Make it possible to distinguish between all and selected
test cases also for the automatic run after build feature.

Change-Id: I91715a7ae4f09cea2e31844940a6b21ae9e62157
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-20 04:43:14 +00:00
Christian Stenger
265498cadc AutoTest: De-noise code a bit
Change-Id: I4585ebfb53623221c713ab0e8e254ba59a4e5920
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:28 +00:00
Christian Stenger
03b80025a9 AutoTest: Shuffle namespaces for clearer separation
Change-Id: I6ac440c6d72c3d0dbcd75907f8a6ae756f3cf5ee
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:16 +00:00
Christian Stenger
d12f90047a AutoTest: Allow run after build per project
It might make more sense to be able to enable this
per project instead of globally.

Task-number: QTCREATORBUG-16704
Change-Id: I2e29d3af62c428bcbb534b72b5eb13f1fbd83973
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-02 07:08:50 +00:00
Christian Stenger
51382a846d AutoTest: Add automatic run after build
Add an option to automatically run tests if the build
succeeded and the current project has tests.

Change-Id: I1fe028be84279b9b488f78590565c6d4b0449e34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-02 07:08:38 +00:00
hjk
d2a0b13252 AutoTest/ProjectExplorer: Move some unusual function towards only user
Change-Id: I1101a21871c8b1eac5c01afc033e5416850bc794
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 11:48:36 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
Christian Stenger
8f6d99dc29 AutoTest: Avoid unclosable progress bar widget
The progress bar widget gets automatically closed if the
underlying future reports that it has finished or got
canceled. This patch ensures to emit the respective signal.

Fixes: QTCREATORBUG-22699
Change-Id: I5c7d2169194e90165fb1c90831cf69c02e029268
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-11 13:55:09 +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
Marco Bubke
4bae5de36b Enable macro editing for the Clang indexer
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.

Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-13 16:51:48 +00:00
Christian Stenger
12038dd012 AutoTest: Enhance reporting passes and fails
Depending on the report and log level of Boost UTF
the number of test passes and fails might be wrong.
Circumvent by providing a way to report a summary.

Change-Id: I6d2cb7674550f10a0263e08d21cce42569f3d7a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-07 06:39:52 +00:00
Christian Stenger
cbab457cf4 AutoTest: Refactor TestResult
* use enum class
* remove superfluous enum value
* remove superfluous subclass
* remove superfluous constructors
* simplify handling

Change-Id: Iecf11e62eb842c9d455d9238939244496f6b66f4
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-04-26 12:19:05 +00:00
Christian Stenger
19f2da8048 AutoTest: Redo reporting of disabled tests
Provide a proper way of reporting disabled tests instead
of the hacky one.

Change-Id: Id3a775d57ac20c9db8ad0f504cb708021117aa2f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-04-03 08:11:57 +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
hjk
efb7d8deb7 ProjectExplorer: Split RunControl constructor
Into a trivial bit and two setters. Plan is to use it only with information
that is truly there (e.g. kit/device only) at the user side without having
to invent a RunConfiguration "handle".

Also remove some dead code in the test runner.

Change-Id: I987881e41722178b14b91f973b84cbdb67a9f85e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:38:45 +00:00
hjk
582f72f433 ProjectExplorer: Simplify RunControl::appendMessage
Use a signal directly now, the users know the caller.

Change-Id: Ib2ff4dbe3047eddf2a060eef060b487a4c17e78c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 12:27:20 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Christian Stenger
1cfaa828a8 AutoTest: Fix outputparser
This patch amends 3056105c66. This patch fixes
handling of output while debugging and appending
to the "real" output if the user interacts with
the output while the test is running.

Change-Id: I1db54382f1df3e2b9a5a860002aac8fb208ee5b9
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-11-08 06:33:09 +00:00
Robert Loehning
29978ceac0 AutoTest: Generate string properly
Word order might be different in other languages

Change-Id: If0f02ab768529887904a4cbed379d3061b9b659a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-23 11:23:17 +00:00
Christian Stenger
f350c4d1d4 AutoTest: Replace some scary wording
Change-Id: If8c45824c80ed6dd2da5874af56e61ab7abb3305
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-21 07:40:17 +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
ac9f1f798c Merge remote-tracking branch 'origin/4.7'
Change-Id: Ifb51ca9893549c478e99c9fc3ea6c32d5d5a28a2
2018-09-07 14:39:42 +02:00
Christian Stenger
58c0325b9d AutoTest: Fix handling cancellation for timeout
If the timeout triggered a cancellation of a test run the
testrunner missed to inform the progress manager about this.
This in turn resulted in a sticky progress widget which even
could pile up with further progress widgets.
Fix this by explicitly informing the progress manager of the
cancellation.

Change-Id: Ie19a1aa998e19f911cd0dd856008552baaffeb9b
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-04 11:43:33 +00:00
Christian Stenger
d058dcc326 AutoTest: Filter out interfering environment variables
If there are environment variables that might interfere with
the test process filter them out before setting the environment
for the test process as they can - in the worst case - even
lead to being not able to execute the test application at all.

Task-number: QTCREATORBUG-21012
Change-Id: I4a2059cf527395498824a0914fd6c3203eca9bcf
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-04 06:06:33 +00:00
Christian Stenger
735aeb3e38 AutoTest: Fix usage of line widget
Adding the same widget to two different layouts obviously
does not work. Create two separate widgets for this.

Change-Id: I1c598d7ac45b7a13cea129a444697d64a607f243
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:04:33 +00:00
Christian Stenger
0ab5402d4c AutoTest: Small refactoring
Rename function and parameter to better reflect what it is
and remove code that has been superseded some time ago.

Change-Id: Id7af2e916217b4da6c96f75bbe036fdc4b8d9ddc
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:04:24 +00:00
Eike Ziller
847787f146 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp

Change-Id: I72882df605bc3fc8a8d20118fd4e49207ac92664
2018-08-07 09:42:02 +02:00
Christian Stenger
c1f78335e0 AutoTest: Disconnect signal after being processed
When debugging a test the run control outlives the connection
and the signal can be triggered again and again which results
in warnings on the command line. Do not rely on run control
handling things for us, instead disconnect the signal after it
had been processed.

Change-Id: I704fd110bce3b387ee419a3f83bf904f2687a435
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-06 12:39:17 +00:00
Christian Stenger
18617668a0 AutoTest: Avoid crash in illegal state
While debugging tests we rely on some states of the debugger.
If anything goes wrong we might end in an illegal state on
our side as well. This would then result in a crash.
Avoid nullptr access and try to recover from illegal state.

Change-Id: If8ca396a6e456d2f37777eba86f320643fbcd275
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-06 12:39:09 +00:00
Christian Stenger
1d894c0f7a AutoTest: Code cosmetics
* use nullptr
* override
* remove old style casts
* fix most of the code model warnings

Change-Id: Ia08e846f9326ae28ca7e7d66748e25a8b817b9b1
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-07-20 08:34:48 +00:00
Alessandro Portale
ad474f5fcb Fix: member initializer for 'm_fooBar' is redundant
warning: member initializer for 'm_isValid' is redundant
[modernize-use-default-member-init]

Change-Id: Icd521e7d77054512bc0ed6b95cf08440320b0ce0
Reviewed-by: hjk <hjk@qt.io>
2018-07-12 08:19:00 +00:00
Christian Stenger
1b6a3fe493 AutoTest: Fix handling of test runs when project changes
If the startup project or the current active target changes
while tests are running strange things can happen as we rely
on these both being unchanged from triggering the run.
Explicitly check for these being unchanged and cancel the
test run if necessary.

Change-Id: I506c7b1c0ca4b6ea31559556f6141fe9276d0ad0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-21 10:24:29 +00:00
Christian Stenger
3568f23e7e AutoTest: Guard against nullptr access
Change-Id: I15e5d769b7a4b30421f52fbbe380ca7f19214b42
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-21 10:24:20 +00:00
Christian Stenger
ad8e67cea3 AutoTest: Code cosmetics
Change-Id: I49a73b83b1b6857c34913db8f7c6818cf7a1a129
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-19 07:40:09 +00:00
Christian Stenger
73d9c2fff3 AutoTest: Do not create marks twice
Reporting finished on the future will call onFinished()
due to respective connections.
Removing the additional explicit call to onFinished() to
avoid creating test marks twice.

Change-Id: I3d1a6b0b37bb5152c867a1c8fa488258c9b44268
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-19 07:39:49 +00:00
Christian Stenger
38bc2358ac AutoTest: Use same pattern across file
Latest refactoring brought up a new pattern for
creating and using the fake future.
Follow the same pattern at older occurrence.

Change-Id: I4db4b3e6b0558660ef416e4201a017acba3de538
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-28 06:39:35 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Christian Stenger
f129ed9d96 AutoTest: Fix timeout handling
Qt5.5 introduced a hard limit of 5 minutes for the test
case run.
If the timeout configured inside the settings is higher
and the test case runs longer than the the internal
default the test would crash ignoring the timeout set
by the user. Qt5.6.1 fixed this by adding a capability
to raise this limit.
Handle the hard limit used inside QTest appropriate.

Task-number: QTCREATORBUG-20439
Change-Id: I33f1d9bce4e503be7175228dde50b4484e57d337
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-18 12:33:44 +00:00
Christian Stenger
a1a78c4c69 AutoTest: Redo running tests
Removing the event loop and the costly internal
infinite loop to reduce CPU load.
We need an event loop for on-the-fly processing
of the results, but the main event loop is good
enough for this. There is no need to add another
one.
There is also no need to put all this into an
asynchronous job as all of this happens
asynchronously anyway by using signals and slots.

Task-number: QTCREATORBUG-20439
Change-Id: I126bf0c1be3e49fd0dd477e161e4fe7a10a080c9
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-18 12:33:37 +00:00
Christian Stenger
2557e685e5 AutoTest: Extract code into function
Part of a later refactoring.

Change-Id: I8321b344ff333195905be68131aab508d1a87aee
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-18 10:29:13 +00:00
Christian Stenger
21974a4bcb AutoTest: Simplify internal function
...and silence a krazy2 warning.

Change-Id: I72efc50baa53f03250813cae646da0f7c07a83f5
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-18 10:28:49 +00:00
Christian Stenger
e5e493c291 AutoTest: Fix construction of results tree
Set an appropriate identifier for the output reader
to ensure that children are correctly appended to their
parents.

Change-Id: Id51c16fdd2e50e1ba11d7fbd1f7abbef386bdae0
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-15 05:28:49 +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
383d53ddbd AutoTest: Fix debugging tests
Some special characters need to get masked if passed
on the commandline.

Task-number: QTCREATORBUG-19943
Change-Id: Ib20ccb33ee9fbb50819d3386905df536c5193b3c
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-28 13:48:26 +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
David Schulz
8accfddb17 AutoTest: Delegate reporting crashes to output reader
Let the output reader report crashes of the test
instead of just reporting crashes globally.
This allows to reflect the crash also inside summary items
to avoid having tests displayed as passed if no fail happened
until the crash.

Task-number: QTCREATORBUG-19565
Change-Id: Idd9fe28f7486cbb31b1aa6556530718a2278722f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-16 11:47:06 +00:00