Commit Graph

95 Commits

Author SHA1 Message Date
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Stenger
1b8c68f617 AutoTest: Restore former check state on reparse
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>
2020-06-18 07:49:59 +00:00
hjk
7158e67612 AutoTest: Move TestCodeParser and TestTreeModel ownership to plugin pimpl
Change-Id: I01b32aae894a4b419c8a067f604d5f04a2b14dfe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-20 13:13:52 +00:00
hjk
d3f79fcc68 AutoTest: Use ITestFramework * instead of its id in some cases
Change-Id: Ic327e31185247b6479c78af8bf8156f44bb4bdfb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-16 12:18:29 +00:00
Christian Stenger
89ae78fd89 AutoTest: Reparse only newly added frameworks
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>
2019-09-18 08:03:49 +00:00
Christian Stenger
a03074e139 AutoTest: Remove leftover code and message
This kind of filtering has been removed long ago
and therefore it should be impossible to get triggered.

Change-Id: Ic9ea02b5446edaadda4d7f21846b37a2f8178505
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-17 13:09:14 +00:00
Christian Stenger
42edcc5771 AutoTest: Allow re-parsing with a sub-set of parsers
Avoid expanding parsing over all parsers if we trigger a
re-parse for a different parser and there is already a
re-parse postponed.

Change-Id: If74480fea2c671b32083fb7cf3f4dc4c418e6e33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-17 13:05:44 +00:00
Christian Stenger
49942bc06a AutoTest: Re-order responsibilities
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>
2019-09-06 10:07:01 +00:00
Christian Stenger
0d11d880ca AutoTest: Unify container usage in TestFrameworkManager
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>
2019-08-22 13:34:23 +00:00
hjk
ef102389a2 Autotest: Avoid a deprecation warning
Change-Id: I547f57957098d2e7674928a1055708e49afc04b6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 12:32:22 +00:00
hjk
c77cef5706 Avoid more deprecation warnings
Change-Id: Icc7bb7a4ccf7fc9f89f6f668c194ccd440e5231c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 07:49:48 +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
330af3309c AutoTest: Remove scan filter capability
The scan filter capability had been added to avoid long
scans in bigger projects.
Nowadays the scans are done multi-threaded and the
filtering is probably barely used.

Change-Id: I7d99f5a57bb10deb3d79510db0c7a06bd771c271
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-03-18 09:10:09 +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
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Christian Stenger
0bd6f712f0 AutoTest: Access plugin singleton through static functions
It's the more common pattern nowadays, and cheaper.

Change-Id: If6217b2a820fbfa6f088fd9349225f5f8488f593
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-01 09:51:54 +00:00
Friedemann Kleint
f482270432 Introduce Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: I9d06d04b496c9ec060e13e1be6f43d8fbadb1f3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-24 14:50:43 +00:00
Christian Stenger
a4c318d5e1 AutoTest: Fix wrong behavior when rescan is triggered
If the code parsers perform a full scan then do not use
cached information.

Change-Id: Ib9635c9715841ab71b97edfe42c4fe9d9d20c23a
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-16 07:35:06 +00:00
Tobias Hunger
9d3c5c6ff5 Session: Remove projectContainsFile
Use Project::isKnownFile instead.

Change-Id: If69e413e4603fe6d7dc359ecd55d6233d9a3a642
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 11:14:21 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Christian Stenger
ecd8fd1198 AutoTest: Ensure reparse even for unlisted Qml files
Files containing Quick tests are not necessarily listed
inside the project file.
If such an unlisted file is updated we have to scan for tests
even if it is not part of the project otherwise it would not
get updated inside the test tree.

Task-number: QTCREATORBUG-18692
Change-Id: I4c4c67d50b4fff13138b0ab3c884f5ea48a7b8bf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-08-25 07:16:43 +00:00
Orgad Shaneh
8430da3bf7 Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I01ab8c85ea3372b6dce4142ddb9cf92d903ffca6
2017-05-23 23:41:40 +03: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
Eike Ziller
83b8c8fc15 Reduce CPU load of test parsing
Use a thread pool with reduced max thread count.

Task-number: QTCREATORBUG-18185
Change-Id: I18bd3de82365edaf21d8dcf9c89035da1ac74756
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 10:46:13 +00:00
Orgad Shaneh
f6c6224ebc Autotest: Avoid needless iterations over the project files
Task-number: QTCREATORBUG-18185
Change-Id: I6c541cfa577331edc1ff3083d2f9b705ffc7ce73
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-11 06:04:15 +00:00
Orgad Shaneh
c7d7cb9d40 Autotest: De-noise TestCodeParser
Change-Id: Ide351ed081417d3520714dcc44d543797f75dd4a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-11 05:51:39 +00:00
Christian Stenger
93299cb802 AutoTest: Do not perform parse for disabled parsers
If a single parser triggers a reparse check if it is enabled
to avoid senseless work.

Change-Id: Ib28f2737be81021e1bfdd33eb347c64ffb5df020
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-09 08:35:47 +00:00
Christian Stenger
9a126e37f9 AutoTest: Handle conflicting update triggers
If a postponed update should be done for a single parser only and
another full update for all is triggered the latter one would be
ignored which is wrong.
An update for all parsers should always have higher priority and
replace a possible scheduled update for a single parser.

Change-Id: I5e1e446c7dcb9ddbcaed4606ff87a894235b723e
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-08 14:16:35 +00:00
Christian Stenger
b273d7be6a AutoTest: Ensure that removing and adding qml files is noticed
Task-number: QTCREATORBUG-17805
Change-Id: I068f6925fc39813a504205c4ef8e8b9f9e911189
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-07 09:57:53 +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
67aea18cc2 AutoTest: Allow basic filtering of scanned folders
This allows to specify folders to be used as search folders
while scanning for tests.
Current approach allows simple folder names or folder structures
without wildcards.

Examples:
Value                What will be (recursively) scanned
tests                if the current project has any (not necessarily
                     a direct) subfolder 'tests' this folder will be
                     scanned
tests/auto           if the current project has any (not necessarily
                     a direct) subfolder 'tests' and this folder has
                     a direct subfolder 'auto' the 'auto' folder will
                     be scanned
If there are more folders which apply to the rules then all of them
will be scanned.
This filtering will not keep the parser inside these folders as it
might be necessary to step into different folders because of
dependencies if the found tests, but the search for entry points to
tests will be limited to these folders.

Task-number: QTCREATORBUG-16705
Change-Id: Ib93465540cd20656d033e16205807aba6830d738
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 12:28:01 +00:00
Christian Stenger
6137d14857 AutoTest: Avoid scheduling single shots if not necessary
This avoids doing internal stuff based on getting respective
signals if there is no active test framework.
The only signal that still will perform some more internal stuff
is triggering a rescan from the context or global menus.

Change-Id: I78f065b6bc77a100676d63248b438d3ebc71809b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-03 07:02:10 +00:00
Christian Stenger
69a94c2c28 AutoTest: Always parse if plugin is enabled
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>
2016-12-12 10:57:47 +00:00
Christian Stenger
349ad040d6 AutoTest: Limit purging of test tree to project switching
Instead of purging the current test tree on all full parses, just
purge the whole tree if the user switches the current project.
If an item can no more be found after the full parse it gets
removed anyhow.
This avoids losing the check state on any full-parse.

Change-Id: Ia7bae6ced65a69444adf0d7e2a554d90ddd5caa4
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-02 12:29:32 +00:00
Eike Ziller
37076e8c33 Reduce thread priority for test parsing
Adding API for that to the parallel map/reduce functions

Change-Id: Ic7987d899c124dcb04c1ca110b09fc97576873fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-15 15:00:18 +00:00
Christian Stenger
f967545c5a AutoTest: Fix handling of enabled state for code parser
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>
2016-11-14 09:57:25 +00:00
Christian Stenger
771fa178b6 AutoTest: Re-do multi-threaded parsing for tests
Avoid using global thread pool, use internally provided functions
instead.

Change-Id: Id8d3c72c45d85d4806e3692ef3039c31a0eae7b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-11 11:31:36 +00:00
Christian Stenger
3893ffa039 AutoTest: Speed up parsing for tests
Initial parsing for tests when opening bigger projects was too
slow. Try to let the parsing process on more than one file at
a time to speed up the whole process.

Project       before       now
qtbase        ~11min       ~4min
qtcreator     ~2min        ~40s

Values above may vary depending on the underlying hardware.

Change-Id: I77eeb189c82c58fce84ffbac67143ec7fa0adcae
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-07 13:46:12 +00:00
Christian Stenger
2b27f30538 AutoTest: Reduce re-parsings while editing single file
Change-Id: If3dbcb3026733873881921cb9208b7c9da33c8de
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-26 10:00:10 +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
Christian Stenger
3e5966cff0 AutoTest: Add some logging for time measuring
Change-Id: I31b8ff6edf5c4bd0469da9e32a20dc9b73c46158
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-27 12:59:53 +00:00
Christian Stenger
e9869abfd5 AutoTest: Fix stopping progress animation on cancel
Sometimes the progress indicator did not stop its animation
when parsing for tests was canceled.

Change-Id: I0e4896f2b391ce6690d079fb8b33972cc5fb07f3
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-27 12:59:48 +00:00
Christian Stenger
18ac6b8be1 AutoTest: Minor fix for initial test scan
If parsing the project is not finished we get an empty list of
files to be scanned.
Just trigger another full scan for such a case.

Change-Id: I84b275f76bc98c8f0ef544fc27d30ebd6f8b43d1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-01 07:21:48 +00:00
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