In case of loading a Creator project, after the Scanning
For Tests finished, the scanForTests() called by
TestCodeParser::onFinished() freezed the main thread for
about 1 second. In this case requestRemoval() signal was
emitted nearly 1000 times.
Optimize the internals:
1. Don't emit requestRemoval() for every single file but
emit it just once passing a QSet<FilePath> instead.
2. Adapt some other callees and callers to work on
QSet<FilePath> instead on a single FilePath.
This change constraints the freeze to about 2 ms.
Change-Id: If23b85b495c125d82eb3c8b5a6912349df122745
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
..and debug under cursor for QtTest and GTest.
Depending on the information coming from the code model
we may be able to get a correct scope even when standing
inside the function that is defining the test.
This makes more sense than the original behavior which
made it a hard requirement to stand on a literal to
run or debug a test under cursor.
But as the codemodel does not provide usable information
for all frameworks keep the original behavior as fallback.
Task-number: QTCREATORBUG-28752
Change-Id: I13ea7b0ad1e8207da6cb884d212667c4c657957c
Reviewed-by: David Schulz <david.schulz@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Still some missing bits as some QString members had different meanings
depending on their context.
Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c
Reviewed-by: hjk <hjk@qt.io>
Makes TestTreeItem programming language agnostic.
By moving the "query" methods to CppTools, the cohesion within these
methods is improved, i.e. information crosses the AutoTest <-> CppTools
border fewer times. Furthermore, it allows the CppTools plugin to see
how its data is being used, allowing it to optimize its queries
behind the scenes.
Change-Id: I0a60140abaca1193d500605dfa2812b4d937d94c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Ensures that the static_cast<>() in framework() always succeeds.
Change-Id: I6aff0cf12a565bd6f9791c67979698729d7143e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
Preparation for having separated test tree items with a
common base.
Change-Id: I3735f582cc96910e971f5a41c799cc0729a10a58
Reviewed-by: David Schulz <david.schulz@qt.io>
...and respectively inside the parse results which hold the
information that are used to create the items.
Change-Id: I78f7b5632df5d449d39fa03ffbf48036a138e337
Reviewed-by: David Schulz <david.schulz@qt.io>
Mark test tree items as failed for the last run
to be able to re-run them in an easier way.
Change-Id: I7ea3dcd16e5a02797d41f13e02b2fa95b857cf5e
Reviewed-by: David Schulz <david.schulz@qt.io>
... and TestConfiguration. This allows dropping code that
reconstruct framework ids and framework lookup by id.
Change-Id: I0bb1e6e135376e21f96b9fab7971aa097787e483
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
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>
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>
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>
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>
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>
In preperation for the language server protocol support.
Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
Link is a common class and is used across the plugins.
Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
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>
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>
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>
This allows (de)selecting of all test cases of a specific test
framework.
Change-Id: I21357d3dbcfce73387f157b1b40686f437fa260b
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
* remove unnecessary QLatin1String where possible
* foreach
* nullptr
* bad naming of static members
Change-Id: If0f7c6839be4d2efbfef6f7f0775d2034775bd90
Reviewed-by: David Schulz <david.schulz@qt.io>