Commit Graph

49 Commits

Author SHA1 Message Date
hjk
ae11f30b20 ProjectExplorer: Proliferate FilePath
DeployableFile and fallout.

Change-Id: I9a9c56e4a4ebf8f68df70d65da2e699efedfe907
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 05:42:13 +00:00
hjk
6bc5b70f1d Test: Simplify TestConfiguration::completeTestInformation check
Change-Id: Ia1550b644ef0dcbabecd734f50580d4648474f90
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 12:05:57 +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
ce449e4219 ProjectExplorer: Remove BuildTargetInfoList wrapper class
Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-14 13:30:34 +00:00
hjk
424267979d AutoTest: Simplify some RunConfiguration use
Change-Id: I8ed2ddb7f0ee683a96787c71a6627755d83c3e5f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-13 10:52:01 +00:00
hjk
ea9dad4719 ProjectExplorer: Introduce Target::buildTarget(buildKey)
A convenience wrapper for

   applicationTargets().buildTargetInfo(buildKey),

the only context using the BuildTargetInfoList member.

Also, only one of the free comparison functions is ever used,
only in one place. Inline it there.

Change-Id: I7565e9d51d429af34352649e235243e5b3328fe9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-20 11:27:16 +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
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +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
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
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
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
4b0a4c1660 AutoTest: Fix build key handling
The build system targets no more contain the additional
pipe character. This patch fixes some 'guessed config'
warnings.
The check for the build key can now also be done
without restriction as it is unique nowadays not only
for Qbs builds.

Change-Id: Ic4e62d678c2188d0591c618cdcc156580b40b834
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-31 07:34:47 +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
d9dfddac73 AutoTest: Simplify determination of RunConfiguration
Since bc698d4ce6 the build system targets / build keys are
unique on their own.
Simplify the completion of test configurations and improve
readability.

Change-Id: I258e8a35a4740dd58b1365498ca399258092e0e3
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 12:04:45 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
Christian Stenger
6a470f0a70 AutoTest: Do not overwrite already found build system targets
Especially when using CMake based projects in combination with GTest
we might have lots of build targets defined inside the same
'project file'. Overwriting the already assigned content is purely
wrong. Instead handle each found build system target on its own.

Task-number: QTCREATORBUG-17882
Task-number: QTCREATORBUG-18932
Change-Id: I3297a9e1da8ae4186fd4267e3485368b1a059314
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-19 08:25:47 +00:00
Christian Stenger
cf5d8509aa AutoTest: Avoid replacing a correct executable
If we already had a correct executable we might end up using
the wrong one when trying to complete the configuration again.
So, if the former configuration already had an executable set
do not try to complete the configuration again.

Change-Id: I270be71d87b311c6a5eaad14e0d5a2de60353e5d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-10-06 08:48:13 +00:00
Christian Stenger
1e8d030284 AutoTest: Ask for runnable if determination failed
There are several complex project layouts that lead to failing
to determine the correct runnable for tests.
If this happens prompt the user for the runnable to use instead
of performing wild guesses or blindly using a wrong one.

Task-number: QTCREATORBUG-17882
Task-number: QTCREATORBUG-18922
Task-number: QTCREATORBUG-18932
Change-Id: I1575f310c450e56c087f1e689d0fc7dfb0cd0bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-09-26 07:33:32 +00:00
Christian Stenger
9dc8b54cdb AutoTest: Early return if fail to get local executable
If we have not found a local executable any further processing
is not necessary as the outcome will be the same: we will not
be able to start the test runnable.

Change-Id: Iaa4bbd533ced6184148f941c1cba394f9f47554d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-09-26 07:01:04 +00:00
Christian Stenger
090dea66ee AutoTest: Use single build target as fallback
If we cannot find the respective build target to execute
tests, but we only have a single build target then
we now assume that this will be the right one.

Change-Id: I0f7c3c4f371bce3a7f328e7c28dc61cadf7f6e9e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-09-26 07:00:57 +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
Christian Stenger
1acf748f5f AutoTest: Use StandardRunnable inside TestConfiguration
Replace some members by a single one.
By using the StandardRunnable we automatically get more
information that can be used later (arguments, device).

Change-Id: Id2afb6dffc27d97da568372f6ee13c7181fc393a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-12 09:17:48 +00:00
Christian Stenger
60ccbac5dd AutoTest: Add minimal logging to TestConfiguration
This might help to figure out what is wrong if we are
not able to determine which run configuration must be
used or if this determination goes wrong.

Task-number: QTCREATORBUG-17882
Change-Id: I6f1dc573b4a8c07035fa521d056ccde890f07142
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-08-07 12:25:42 +00:00
Christian Stenger
27cb331b4b AutoTest: Avoid guessing run configuration
Base the selection of the run configuration on the executable
we have gotten already from the BuildTargetInfo and take
deployment information into account.

This also reverts cce1e130 partially and avoids
stuffing unrelated information into the buildsystemtarget.

Change-Id: I3de6e910a5fd1092d428ec4afc33c4ca62daaa25
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-31 06:11:35 +00:00
Christian Stenger
6ab1da8b78 AutoTest: Fix finding runconfig for multiple build targets
As we are still constructing build system target to compare with
on the test runner's side instead of getting the complete
information from the run configuration we ended up using the wrong
one in several circumstances. Avoid this by using the executable
information we already got.

Task-number: QTCREATORBUG-17783
Change-Id: I40431bef228f7070109297873c472fea410dbd16
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-26 13:34:16 +00:00
Christian Stenger
cce1e130d7 AutoTest: Fix handling of multiple build targets
If project files are not mapped 1:1 to targets the result
of the chosen executable was more or less random.
Try to handle multiple targets as correct as possible by
checking for build targets already where we still know
which files are part of the respective test cases.

Task-number: QTCREATORBUG-17783
Task-number: QTCREATORBUG-18357
Change-Id: I82dcc26bf52c9918e2727b439a719af08879ef49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:14:55 +00:00
Christian Stenger
f173dc82df AutoTest: Provide more details on failure or guess
If a test case cannot be started or does crash while executing
these information might help to sort out configuration problems.

Change-Id: I406d5e69475d05931d4c4c4738f8528c6d74c585
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-12 11:57:36 +00:00
Christian Stenger
e0cb69745b AutoTest: Fix handling of Qbs when searching for BuildTargetInfo
Amends 124efb32 - this special handling got lost between patch sets.

Change-Id: Ic94145d3310668f1c63abe5443e0d833850227a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-29 12:39:09 +00:00
Christian Stenger
124efb32f5 AutoTest: Re-do completeTestInformation()
Use information provided by the codemodel and the run configurations
as much as possible to avoid guessing.
This also fixes running CMake based tests from within the
AutoTest plugin.

Task-number: QTCREATORBUG-17882
Change-Id: I5639fa947fa602b76faf50e9b58d7a74af4e1f9c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-28 05:06:55 +00:00
Christian Stenger
74fb4bb014 AutoTest: Use better names and remove unused code
Change-Id: Ifb7f252e7c3fd020537eb46c62d8f5700b8a55ef
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-02-24 09:36:28 +00:00
Nikolai Kosjar
02d8e2af1b CppTools: Clean up ProjectInfo
Change-Id: I5d0db45d9fdb624bb6cc55d7f04061d553f13bce
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 09:15:25 +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
b0bf07c64a AutoTest: Modernize code a bit
Change-Id: Ie56f6e5cb8a4f1962bd8df5e57214911ae609921
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-29 12:27:14 +00:00
Orgad Shaneh
37a90653f9 Autotest: Replace macro usage with HostOsInfo
Change-Id: I5f9626ff13d49611b2dd000ba0311823a18b5867
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-12 07:34:29 +00:00
Christian Stenger
cbd4f80279 AutoTest: Fix setting working directory
If there is no working directory explicitly set inside the run
configuration we end up using the current working directory of
Qt Creator.
We normally get an empty string if not having modified the respective
target ourselves although you can see a default working directory when
opening the respective target for the first time.

Task-number: QTCREATORBUG-16715
Change-Id: I6e16fd4f9b15759793653a6c229c44a1be2b7739
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-08 11:11:13 +00:00
Christian Stenger
8c42cd9e23 AutoTest: Fix retrieval of executable
Respect different location if tests are installed
before executing.

Task-number: QTCREATORBUG-16638
Change-Id: I2d154e26cdd0f28bd51e7a885c5486d36af38a68
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-28 09:21:41 +00:00
David Schulz
3ecbce9b84 AutoTest: Allow guessing configuration for debugging
Guess the config if no matching run target was found.

Change-Id: If70881cd64ab6523bbca13b1c8c18d63e9fcdeb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 07:25:40 +00:00
Christian Stenger
8562abbb56 AutoTest: Avoid crash when accessing uninitialized runnable
Change-Id: I87bbf5b824a693a2c8d653bf5093e088f01b84b5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-23 07:11:02 +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
2f8b4b3fbf AutoTest: Move test framework related code...
...into files and respective sub folders.

Change-Id: Ic80d693bd73993a6e74b6d422349e47276e8cb6e
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-01 11:37:32 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Christian Stenger
c2a7ad6b41 AutoTest: Fix creation of target file path for Qbs projects
Task-number: QTCREATORBUG-16323
Change-Id: I3ac59d830c098e9e7fe0d6f7dc75078f339adb6d
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-23 07:11:45 +00:00
Christian Stenger
f429b95b0e AutoTest: Separate test configurations
Change-Id: I573b703b4f9ec246cf429d2602b6dc0b8174b50f
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-19 12:10:38 +00:00
Christian Stenger
cacc5bfb9b AutoTest: Fix basic CMake support...
...at least for C++ based auto tests.

Qt Quick Tests are out of scope for this issue as this
would need too much additional tweaking for several parts
of the plugin.

Task-number: QTCREATORBUG-15813
Change-Id: I440a8b1f8e6deb9e6acf2e82d0831fb002c10390
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-07 14:20:57 +00:00
Christian Stenger
36f6a5580f AutoTest: Unify handling of test tree items...
...and let specialized items handle its specialization by itself.

Change-Id: I988ce3c610bef68933b9102bb39ae4723add3a99
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-26 09:40:16 +00:00
Christian Stenger
09bc4baf3c AutoTest: Fix source file construction on Windows
Task-number: QTCREATORBUG-15667
Change-Id: I4d0e81a39a5031403d77fb3e2179ed17451346b4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-01-28 07:03:53 +00:00
hjk
9ae2ce7629 ProjectExplorer: Drop LocalApplicationRunConfiguration
The functionality can be provided by producing a suitable Runnable
in the derived classes directly.

Change-Id: I7b8e8fe33fffd2b00176b6cf6633eca4e152e466
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-26 10:09:29 +00:00
Christian Stenger
15b4e6fc91 Delete unneeded and prepare directory structure...
...to get plugin's repository more easily integrated
into QC's repository.

Change-Id: I10243bb4283623ae951e799feacaa15915678e04
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-22 14:07:19 +00:00