When reparsing while modifying a file it can happen that
the parse failed for some reason or did not provide full
information due to syntax errors the code model cannot cope
with.
This in turn can purge items from the test tree. Re-adding
the items in a later reparse had just added the item and
did not take care of (former) check states.
Add simple caching mechanism to keep track of check states
and use them if available.
Task-number: QTCREATORBUG-24099
Change-Id: I3ca04f5fd58810df71582972e6fe96a00cfc48f1
Reviewed-by: David Schulz <david.schulz@qt.io>
- sort frameworks at insertion time
- apply the 'static' pattern
- inline code from convenience functions that are only used once on
the caller side
Change-Id: Ic4a46ad9487c58b4dfd61658a6fccebb88a428a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Relying on the order of tests of the underlying tree
model is bad as we order the model for the user with a
QSortFilterProxyModel.
Using non-unique keys is not wise either.
Ensure the keys are unique to have reliable results.
Change-Id: I556371d018c16e7b03a8ec85d60afc850056a94a
Reviewed-by: David Schulz <david.schulz@qt.io>
Latest refactorings resulted in possible different orders
for the tree model as well as for the frameworks inside the
project wide settings.
Fix this by sorting explicitly and iterating over the list.
Change-Id: I9b673770b03732820f0ea4f902f3586abd07d51a
Reviewed-by: hjk <hjk@qt.io>
Broke while introducing TestSuite and following the
official terms.
Amends 6189745a3b.
Fixes: QTCREATORBUG-23068
Change-Id: I02a8c72debface1e15b2e1901ec6115e210a0312
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Instead of re-parsing all test frameworks trigger a reparse
just for the newly added as results for the other should not
have changed.
Change-Id: I6eb53da04bb927a884d6431e137bfe68f391f2ad
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
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>
And provide an accessor for the framework's priority which
will be needed later on.
Change-Id: I5a2480699d9467ee50e2cc44b9d4ff58f9e8da88
Reviewed-by: David Schulz <david.schulz@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>
To execute them you need - beside the former prerequisites -
either have boost installed installed at system level (UNIX)
or you must specify BOOST_INCLUDE_DIR as environment variable
otherwise the respective test will be skipped.
Change-Id: I6bd8472e554132ab05e58b56e3ccbd5e9dffada9
Reviewed-by: David Schulz <david.schulz@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>
The old approach was working due to the fact that all
test frameworks followed a fixed type scheme and tried
to handle differences between the AutoTest plugin and
the "real" world of the test framework internally.
Generalizing this decision does no more make sense when
adding an optional test suite layer.
Change-Id: I4788150a8935d8e35e557df8475aa95c8ca545b4
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>
* 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>
Changing (gtest) filters can result in inconsistent
check states up to the root item.
This patch makes the check states consistent again.
Change-Id: I83b146c8859a352892945312ee2fd183699fc79c
Reviewed-by: David Schulz <david.schulz@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>
This adds another grouping mode to the gtest framework based on
gtest filtering. You can now specify a filter that will be used
to group the gtest tree items into matching and non-matching
tests.
Change-Id: Iaf0e55c9e57e2720f4fa84ab4b51ecaeb614df88
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>
Root items that have a partially checked state would keep the state when
switching projects until manually modified or if new items would be
added on a next parse. Reset them to checked state instead.
Change-Id: Id543edd7694abc6fcec3b8d028dce2ee82213517
Reviewed-by: David Schulz <david.schulz@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>
It is a bad idea to remove child items while iterating over them.
Introduced a while ago, but forgotten to fix in f00a113e.
Change-Id: I8d335cec34c2e6a9e7dff99d10c68066ffa8933d
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>
Introduced with latest changes to TreeItem.
It is a bad idea to remove child items while iterating over them.
Change-Id: I6941f4728cf93e47b3ef6405bd1304112946c481
Reviewed-by: hjk <hjk@qt.io>
... and use this to reduce the number of explicit uses of m_children.
Despite of being shorter code by itself it is a step towards having
an explicit LeafItem object that doesn't explicitly store a(n empty)
vector of child nodes.
Change-Id: If8db85e2f1134dd1578a78d31235bf57a28f863a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Introducing support for inheritance broke some old functionality
which in fact was just over engineered.
Remove additional code which will be automatically handled and does
not need to get handled by special logic which could be now wrong.
Change-Id: I05a063c41dc0f8f644d0807fc5497de9c4461246
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
The LeveledTreeModel case is general enough to cover
the UniformTreeModel case, so merge them and rename to
TreeModel. The former TreeModel is now BaseTreeModel.
BaseTreeModels should not be instantiated directly,
a tree model with non-uniform basic items is available
as TreeModel<>.
Done-with: Eike Ziller <eike.ziller@qt.io>
Change-Id: I64a65617ab68c0cde39cf65f4bc092ef808ee6fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>