Commit Graph

62 Commits

Author SHA1 Message Date
Eike Ziller
8452264a18 CppTools: Move QtVersion and BuildTargetType
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.

BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).

Removes dependency on ProjectPart from RawProjectPart.

Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-10 07:31:21 +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
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
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
Christian Stenger
6189745a3b AutoTest: Adapt Type enum
Follow the official terms used by the test frameworks.
In detail this means Google test now uses TestSuite and TestCase
and the value for a normal function has been simplified to
TestFunction.
Beside the visual change there is no change in functionality.

Change-Id: Idf541d07fa3469e04a699d46f4625ff9075d5b6f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-23 12:20:05 +00:00
Christian Stenger
efa7a5a4d4 AutoTest: Add suite layer for tests
Test suites are used in several test frameworks. To avoid
fiddling around with the types and their meaning on the
frameworks side just add another type (TestSuite) that can
be used.
Frameworks can use or ignore this type as it is done already
for other types.

Change-Id: I6c2a312a32ce5716f55b49303e2b1a0f6f8e8da4
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-16 07:41:38 +00:00
Eike Ziller
db9837fa6c Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/clangtools/clangtoolruncontrol.cpp
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: Ib1e8abf066898b50c90fc1ccba4697fe983e8a8f
2018-08-15 13:53:28 +02:00
Christian Stenger
164d6ce7e0 AutoTest: Fix and unify handling of group nodes
QtTest had been forgotten to handle correctly as well. So, it
was possible to have several levels of grouping which had not
been handled correctly.
By (current) definition we handle only one level of grouping,
so prohibit more for QtTest tree items as well.
Basically move the check into a separate function and use this
beforehand instead of creating a nullptr.

Change-Id: Icbf02eae67e89464f371eb349eecf2976636d05f
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-07 11:01:51 +00:00
David Schulz
141f19a652 Utils: move code model icons to utils
In preperation for the language server protocol support.

Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-06 13:22:47 +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
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
Christian Stenger
95446fb614 AutoTest: Use TypedTreeItem for test tree items
Change-Id: I739b6aefc868550b01c7421b4b304293564bb7b6
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-20 06:52:46 +00:00
Christian Stenger
96ccb95e6f AutoTest: Avoid unneeded duplication on rebuild
When the rebuild of the tree model has been triggered
due to switching between grouping by filter or directory
it could happen that some children did not get merged
into others due to (insignificant) differences.
Avoid this visual duplication by finding items similar
to the one to be added and if there is one re-use this
instead.

Change-Id: Ife49593638e0af23ffc7353e305be4ea25eb2180
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-16 07:47: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
Christian Stenger
2945865516 AutoTest: Provide possibility to copy tree items
This allows to create a copy of an item. Basically it will
copy its member objects, but it does not copy its children.
Preparation for extending grouping support for GTest.

Change-Id: I75f92be53ff4191cacea2944b31641a9292d1e58
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-11 08:24:47 +00:00
Alessandro Portale
0ecd543614 AutoTest: Use a prefix in autotest.qrc
Since all resources in Qt Creator get merged together at runtime, they
should be prefixed with the library/plugin name.

Change-Id: Ie411388ed72f099647b25787a140feff1828d3f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-04 13:27:45 +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
Christian Stenger
23e48fe207 AutoTest: Fix marking for removal
If marking a test case for removal by file it could be
possible that children of this test case are not marked
because of being located inside a different file.
When performing sweep the test case and the not marked
children would be gone as the test case is marked and
so sweep would not look into the children.
This currently can only happen for gtest based test
cases as registering the tests is different and the test
case stores here the path of the first found test set.

Change-Id: I712054534307ee2839894c5148ae04b86b9df967
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-07 14:26:14 +00:00
Christian Stenger
5ef822da9f AutoTest: Redo check state handling
Simplify and re-arrange to avoid wrong indirections and
unnecessary delegation.
Beside this ensure correct check states of group nodes
when adding them.

Change-Id: I24a32249d785e48c9d27111d062c2a06a17327ef
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-25 10:16:09 +00:00
Christian Stenger
4eabcda3a1 AutoTest: Allow grouping of test cases
Grouping of test cases can now get enabled for each
registered framework.
For now grouping happens only folder based.

Task-number: QTCREATORBUG-17979
Change-Id: Ic0e5c0ecc76998a1aedea8aa0845f6d9b53fb179
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-15 13:21:44 +00:00
Ivan Donchevskii
8efb598e60 TextEditor: move Link class to separate header in Utils
Link is a common class and is used across the plugins.

Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-27 13:57:02 +00:00
Christian Stenger
fe5ab8da81 AutoTest: Fix retrieval of build system target
If we failed to find a project part for the respective file
it is most likely that we had a header with declarations only
but we can still find depending targets for this file.

Task-number: QTCREATORBUG-18922
Change-Id: I80d0af569bbd6c2a41bf498fb55283704f16439c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-17 05:39:32 +00:00
Christian Stenger
3c602b32d4 AutoTest: Try harder to find relevant build targets
If there are tests defined or registered inside libraries
we ended up trying to execute the library or nothing at all.
If possible try to find correct build targets for such cases.

Change-Id: I58e9edb7f858e3e5407ece6fcb8782f5a129acd0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-26 07:00:48 +00:00
Christian Stenger
e255baaa8f CppTools: Add target type information to project part
Let project managers store information whether a project part
belongs to an executable or a library and use this information
inside the AutoTest plugin.
This information will help to determine which targets are
relevant for the execution of tests.

Change-Id: I93b42797bf55225425398dc83aecea3c99eea290
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-18 10:01:30 +00:00
Christian Stenger
60de0b7405 AutoTest: Do not blindly mark tree items for removal
If we want to mark test tree items because of their file name
explicitly for removal we must not mark its children
recursively without looking at their content. (Grand-)Children
might have a different file and won't get updated ('unmarked')
when just parsing single files which in turn would lead to
sweeping them after parsing.

Task-number: QTCREATORBUG-18689
Change-Id: Ic28dda5652899308a71d2bd3c28a7fde89a08a0e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-08-25 07:16:36 +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
ba1a657227 AutoTest: Make test tree root items checkable
This allows (de)selecting of all test cases of a specific test
framework.

Change-Id: I21357d3dbcfce73387f157b1b40686f437fa260b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-29 10:20:13 +00:00
Orgad Shaneh
687466ac47 Merge remote-tracking branch 'origin/4.3'
Change-Id: I126f3a05212a3d5df78812e66285bc9e8078360b
2017-06-20 11:32:02 +03: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
a9d511ff7d AutoTest: Unify TestTreeItem::modify*() functions
Change-Id: Ia234fb6a8a8466c039060f6f00b1a5e3dea2af9e
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-02 10:14:28 +00:00
Christian Stenger
cccc6b37ec AutoTest: Remove not needed code
As this functionality had been simplified GTest* classes had been
ignored. Continue the simplification and finally remove now useless
code and file.

Change-Id: I89170cd5f05bb93bf30a05fdbf5370012bc9741a
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-19 10:02:55 +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
4ae49fb856 AutoTest: Make data tags checkable
Change-Id: I9a1e8c9524a3f8beb3851646fb7b6bf7c8cac557
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-12 06:47:40 +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
Robert Loehning
04003d81b0 AutoTest: Improve string for translation
Change-Id: I2cb2ed0ade1a7bfa3b07855b8114aa1fd1de2d62
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-08 10:44:32 +00:00
Orgad Shaneh
82c6eedfae Autotest: Remove use of deprecated Qt::ItemIsTristate
Change-Id: I66fd41e3b63ef43359ba4dea61f7bc9bd0b683f4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-04 07:21:12 +00:00
hjk
e48451b0a3 TreeModel: Consolidate child()/childAt() and rowCount()/childCount()
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.

Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 13:39:15 +00:00
hjk
b281d6dad7 TreeModel: Introduce a StaticTreeItem
This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.

Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-15 08:55:16 +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
Christian Stenger
ef2f37f6d5 AutoTest: Decouple item and model once more
Change-Id: I301f17dd8be7feb9dc61f483277a4835aea937af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-27 11:24:27 +00:00
Christian Stenger
aaf7181c0d AutoTest: Fix execution of test sets
Broken by 842ab2a551

Change-Id: If34eb0ae726f172b049473b8dd1c92e7b771968c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-27 06:01:51 +00:00
Christian Stenger
317a1d14d7 AutoTest: Unify test parse result implementations
This is also necessary for a uniform handling while adding or
updating test tree items, which in turn makes it possible to
separate model and items once more.

Change-Id: I84ff558d23490c8734b22062f00e03e8c06d6720
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-27 06:01:44 +00:00
Christian Stenger
70394b29af AutoTest: Make delegate independent from sub-classes...
...of TestTreeItem.

Change-Id: Ieacaeff64dced5e2a4dd3bd3a853cfb1081f5146
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-19 12:10:48 +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
0496473c55 AutoTest: More separation of test tree item and model
Change-Id: Icb096a1af749e74a3f47bc5235a4c0f0c2ce6023
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-18 11:13:20 +00:00
Christian Stenger
b58a10dfff AutoTest: Split off TestParseResult...
...to allow different approaches for different test frameworks.

Change-Id: I16f101fb3f702a0db00cffe33e0d83cd4ea28c99
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-12 13:48:43 +00:00
Christian Stenger
842ab2a551 AutoTest: Move functionality from model to item classes
Another preparation for having a consistent interface later on.

Change-Id: I573e45101016048de916f4d321b326a24efbe4ee
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-12 13:31:22 +00:00
Takumi ASAKI
8d3e0a1017 AutoTest: tr()-Fixes
Do not use QObject::tr().

Change-Id: If92f36166f29defd3501410efeed8e6f68dc896d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-03 13:28:26 +00:00
Alessandro Portale
574ab3c07b AutoTest: Remove duplicated icons
This change makes AutoTest reuse the equivalent icons from CPlusPlus.

Change-Id: I01f8c30798c7f1b622469ae1f25418e9d1bd8a93
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-07 13:15:06 +00:00
Francois Ferrand
3d82a67484 Autotests: emit testTreeModelChanged when new tests are added.
The signal used to be emitted only on reset or when tests are actually removed during sweep phase:
thus the 'run tests' button in test panel stayed disabled if the panel was opened while tests were
scanned.

Change-Id: I274c9d03f1e1140c8aa375f92465c5a0c866cd62
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-14 12:39:36 +00:00