Commit Graph

51 Commits

Author SHA1 Message Date
Christian Stenger
ac1c04b6b3 AutoTest: Fix document update handling while code model indexing
Avoid fetching all files for the startup project again and again
while code model is indexing files. The indexing emits documentUpdated
signals for all (relevant) processed files.
If code model is indexing we perform a full parse anyhow after the
indexing has finished.

Change-Id: Ibfdb47f403da19d5bab3eb2295447ad451fca2b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-15 10:27:59 +00:00
Christian Stenger
48b2af5e77 AutoTest: Cancel possible running tasks on shutdown
If tasks are running while shutting down we might end up in a crash,
so cancel all tasks and handle possible invalid accesses of the
current running processing.

Change-Id: I69f7cac5f44390e322fa301af6d6794270c95c2a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-15 09:18:01 +00:00
Christian Stenger
4f13f074d9 AutoTest: Ignore generated files when parsing for tests
Change-Id: I66fcb2976f05d043ebc5a1c5a611ca688fe4fd16
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-07-07 11:58:43 +00:00
Christian Stenger
790040dddc AutoTest: Do not try to update tests for qbs files
qbs files are kind of qml documents which end up inside the
QmlJSModelManager. Ignore them by default.

Change-Id: I7136dee80a5f5bfc1b5262daeb00890df28e3f4b
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-07-07 11:58:37 +00:00
Christian Stenger
b570ee1b80 AutoTest: Fix initial parse when loading session
Avoid displaying tests from other projects of the same session
which have been indexed but do not belong to the current
startup project.

Change-Id: I6e0fb62cc97898ef3853ec61580dd2deb5ac64e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-07-07 11:58:30 +00:00
Orgad Shaneh
943c76f4ab AutoTest: De-slot and complete Qt5-style connects
Change-Id: I013b42523f163e123a0cee85f9d232815ad284e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-29 09:01:28 +00:00
Christian Stenger
72e6dd2ab1 AutoTest: Avoid fetching WorkingCopy from multiple threads
Instead fetch it once before starting asynchronous processing and
accept that current state of the WorkingCopy might be not completely
up to date. This avoids a crash that might happen when the code model
tries to update the WorkingCopy while the test code parser fetches
information of the WorkingCopy.

Change-Id: I2a893bc8814090361305657ed3c3d772c7bf07d5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-20 10:50:28 +00:00
Christian Stenger
8cba580343 AutoTest: Introduce active state for test frameworks
Change-Id: I0fddce91a239c0a51352a25e34a221fd8880b733
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-06-14 11:05:35 +00:00
Christian Stenger
5ef85949a8 AutoTest: Add test frame work handling
Mainly a preparation for enabling/disabling test frame works.

Change-Id: I0bbea7e055a607517ef8193587c229cadf0de027
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-09 11:50:26 +00:00
Christian Stenger
d198c4a22f AutoTest: Add Id to parsers and remove now useless enum
Preparation for introducing test frameworks.

Change-Id: Iefaa4ca9dd9af665444556afa9c6e326041cfd0f
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-07 09:12:12 +00:00
Christian Stenger
5a3a879a4c AutoTest: Unify naming scheme for gtest related classes and files
Change-Id: Ib0739889cbc6416da3f28f1e39b197317ec8a4e6
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-06 13:23:39 +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
0faf499461 AutoTest: Separate different test code parsers.
Change-Id: I7ff68be6e5442f7140d1257c7d9057434a398359
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-30 13:21:14 +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
bad4bac21c AutoTest: Do not use special members in base class
Change-Id: I9e110039ea886f6b0c3e6ddc7361bc9fac387abe
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-27 06:01:57 +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
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
db71490b1e AutoTest: Use (shared) pointer for parse results
This is necessary later on as we will need different sub-classes of
TestParseResult to support different test frameworks.
This avoids the necessarity to put all information inside a single
object even if it is not used.

Change-Id: I39c74ba06b9337608ece8b113b0993c0934b24b9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-12 13:48:29 +00:00
hjk
dee7ad3806 TreeModel: Rework tree iteration
Use function objects to apply directly during a depth-first
walk of the tree instead of faking a flat container of tree
nodes. Less code, and allows even some non-const operations.

Change-Id: I804ab11df358fe937b40809cbcb772e6f3ff8dc5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-12 12:30:36 +00:00
Eike Ziller
9e66ce48e4 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/autotest/testcodeparser.cpp
	src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri
	tests/unit/unittest/unittest.pro

Change-Id: I9db4fbea6ea7c9fdd0d8e1703735af20c92e754b
2016-05-09 16:37:41 +02:00
Christian Stenger
500286cab7 AutoTest: Fix parsing of Qt tests when using developerbuild
Change-Id: I226884c10e8fea48d08892b4dab3793b9babc0e5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-04 15:42:29 +00:00
Christian Stenger
3d96108bbd AutoTest: Fix reparsing of header files...
...when having split source and headers and defining test data functions
inside the source file.
If we just reparse a header file (e.g. when opening the respective file
inside the editor) we have no explicit information where the definition
of the functions is. This lead to not finding the information necessary
for displaying data tags and throwing away old information as they have
been marked for removal.

Change-Id: Ieb8ed9f7c758fe2c793e60ca2c30b4025106363b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-04 13:40:37 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
Christian Stenger
ca4076c839 AutoTest: Avoid accessing nullptr document
Task-number: QTCREATORBUG-16129
Change-Id: I126f278d9202c63ef731ec2f29562d73ad9eade9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-04-21 10:37:43 +00:00
Christian Stenger
b4b1c50b7a AutoTest: Cancel current parse if we start a full parse
Change-Id: I55dd45c1f39abf1540ec668dd17f878c85c06253
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-21 10:23:24 +00:00
Eike Ziller
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Christian Stenger
02a0c6f486 AutoTest: Ignore nullptr documents
It could happen that Qml related docs have not been added to the
QmlJSModelManager when trying to use them on our side.
Just ignore them when this happens as they will be added manually
as they will get added automatically when parsing the respective
main cpp file.

Change-Id: I25c4b6d9159ad4ff8def3148c2a04356380fbd27
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-18 07:47:12 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
Christian Stenger
b7a8abec13 AutoTest: Separate code parsing and begin to unify
This is preparation for a consistent interface to be later
able to provide a way to support other frameworks more easily.

Change-Id: I6d83060364121eb3d11f7e0b5b259b6eeb1564b4
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-14 14:33:24 +00:00
Christian Stenger
d0a6f70380 AutoTest: Fix possible nullptr access
Task-number: QTCREATORBUG-16062
Change-Id: Ifa544390f27b3ff73d74e4766dc93762bf152da8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-04-14 09:58:56 +00:00
Christian Stenger
01504e41b8 AutoTest: Avoid invalid parse results
If the document gets updated while typing we can get different
results when fetching the content and using positions inside the
content which might have updated milliseconds later.
Beside fetching only once ensure valid parse results by adding an
additional check for the used visitor.

Change-Id: Id1ba4a139a4dc497be0fbb5cf1f81004f3f8676c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-31 13:21:54 +00:00
Christian Stenger
f34bb5e81c AutoTest: Avoid using costly containers
Replace several occurrences of QMap with QHash as we often do
not care about the order and use iterators instead of fetching
keys or values to iterate over them.

Change-Id: I5061a7e7e60fe259ac2aa31915f338a373e278d3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-14 08:46:28 +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
ba61f2946d AutoTest: Add some gtest related settings
This patch enables execution of disabled tests, repetition of
test runs and shuffling of test sets.

Change-Id: I3668afde5766d18acdf1afb7edd913655b13a76c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2016-02-26 09:40:46 +00:00
Christian Stenger
25d63d8556 AutoTest: Support typed gtests as well
Change-Id: I5e904ef50c76560df8b63fc766a2b78b90bf73cc
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-26 09:40:31 +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
Eike Ziller
47c3755600 mapReduce: Support progress information and add (unordered) map
If a container is given to mapReduce, it takes the responsibility to
report progress information for the whole operation. If the map function
reports its own progress, that is taken into account for the overall
progress.

The (so far only unordered) Utils::map operation can be used to replace
MultiTask, by passing a member function of the items in the container as
a map function.

Change-Id: I18ca38a6ad2899d73f590bfe59bf2e6eb2f1a57a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 08:36:08 +00:00
Christian Stenger
13e0abf526 AutoTest: Copy parse results only if necessary
Copying of the results is quite costly, so reduce this to a minimum.

Change-Id: I8db3bcd72c34ddd0bdc622ec3f2fd538c9679955
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-16 12:00:42 +00:00
Christian Stenger
956db366cb AutoTest: Avoid triggering aboutToPerformFullParse twice...
...when switching projects.

Change-Id: Id4c9e4e4691ef93cea1fa7e40643c549634f0215
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-16 11:49:11 +00:00
Eike Ziller
72af6b7834 runAsync: Remove ResultType template parameter.
It is now deduced from either the type of the
QFutureInterface<ResultType> function argument, or the return type.

Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 10:58:55 +00:00
Christian Stenger
3f760bad1f AutoTest: Avoid temporary storing of QMap
Change-Id: I099ffb6931947f72ad242e858d82a109a0da85f9
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-05 13:12:06 +00:00
Christian Stenger
6ebd3cc7e8 AutoTest: Trigger onPartialParseFinished directly
Change-Id: I291712b5820c5bf84ee92621bc91497ec4264709
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-05 13:12:01 +00:00
Christian Stenger
02e188c3fd AutoTest: Trigger signal by QFutureWatcher
The finished signal might be triggered before the started.

Change-Id: Id23612553fdd19de2ddbee72b20b4e85448e1611
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-05 13:11:57 +00:00
Christian Stenger
7f61a590ab AutoTest: Do not pass pointers without owner between threads
Change-Id: I40e86716d1dd7c8a84e759e792042b84571fc2aa
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-05 09:09:31 +00:00
Christian Stenger
612f36fb3a AutoTest: Apply QC coding style
Change-Id: I79548cae407c5f7327953184977f8133885bc367
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2016-02-05 06:49:51 +00:00
Christian Stenger
30b1e70c42 AutoTest: Report parse results through QFutureInterface
Change-Id: Ib99e9ae5efa26f01dd9c0b0bf5516e2e9dab73ce
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-04 06:05:14 +00:00
Christian Stenger
992f9ed222 AutoTest: Use mark and sweep for parsing
This also removes caching from parser and the respective test info
files are gone now as well.

Change-Id: Ibcea68e446dea532d6addd2f16863738e497bca4
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-01 08:31:52 +00:00
Christian Stenger
1caeb9bb63 AutoTest: Store referencing file inside test tree item
This duplicates (temporarily) the information for referencing files,
but the cache inside the parser will be removed within a later patch.

Change-Id: I7377864547f0d9ce074fa409b9c12067c4329d40
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-01 08:31:28 +00:00
Christian Stenger
3d5bb6d0bb AutoTest: Prepare parsing function to get referencing files directly
Change-Id: I53b8db50d286dccc8ec9764ddb9a2c08d52fffb5
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-01 08:31:16 +00:00
Christian Stenger
9a0941277b AutoTest: Simplify caching for test information
We only need the referencing file in some cases.
First step for refactoring the code parser and the test tree model.

Change-Id: I713212461e4992863ef11a0a634c5d8d786a72a9
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-02-01 08:31:02 +00:00