Commit Graph

38 Commits

Author SHA1 Message Date
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Jarek Kobus
b269066435 Use const iterator with std::find_if where possible
Make the resulting interator const.

Change-Id: I4aadcfff35f6b1015e506bc75bcfc2a1f1be4d65
Reviewed-by: hjk <hjk@qt.io>
2020-11-19 09:46:31 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Jarek Kobus
3998e30684 Fix a warning about const signal
Fix a [clazy-const-signal-or-slot] warning. Instead of defining
a signal for internal usage, use directly QMetaObject::invokeMethod().
Don't declare scanDirectoryForQuickTestQmlFiles() a const method
anymore.

Change-Id: I036afc6124dfb877ced7d9e798920c8a8fde1892
Reviewed-by: hjk <hjk@qt.io>
2020-11-17 11:30:23 +00:00
Christian Stenger
ac14a1e038 AutoTest: Clean up header mess
Better decoupling and reduced binary size.

Change-Id: I4f6239979d9d7dae4ad92f19ec8420be38372c07
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 08:24:01 +00:00
Christian Stenger
24db5dcc4f AutoTest: Use base of framework inside TestTreeItem
...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>
2020-11-09 08:23:00 +00:00
Alessandro Portale
bb89b80097 AutoTest: performance-for-range-copy
Change-Id: I60e79aec1fe2813867d8ff46cec7d39b848d0020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 07:01:10 +00:00
hjk
f80715a8ca AutoTest: Use QMap::keys() return type directly
Instead of a derived one.

Change-Id: Ibe6261b94d8158b8678bd2523144fd806a71914f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-29 08:41:24 +00:00
hjk
77c4caf4ea Autotest: Keep track of generating framework in TestTreeItem
... 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>
2020-03-27 14:11:11 +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
265498cadc AutoTest: De-noise code a bit
Change-Id: I4585ebfb53623221c713ab0e8e254ba59a4e5920
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:28 +00:00
David Schulz
6e84529a88 AutoTest: fine tune quick test case specs
and fix multiple inheritance

Change-Id: I031c8518437b7b396f5b17a51d2067e4b3661530
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-30 12:49:38 +00:00
Christian Stenger
c020fb6e3e AutoTest: Fix parsing of multiple test cases in single qml file
Quick tests allow definition of more than one TestCase inside a
qml file and even nesting is possible, so support this correctly.

Fixes: QTCREATORBUG-22761
Change-Id: I65fcc7cd6063d976d798c3e900d3299a12e2d73f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-30 10:45:09 +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
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
Christian Stenger
3a4592609c AutoTest: Handle direct usage of quick_test_main
If users need to register additional QML types before Qt5.12
they need to bend the Quick tests magic a bit and use
quick_test_main or quick_test_main_with_setup directly.
The plugin supports something similar for QTest::qExec, so
allow this for Quick tests as well.

Task-number: QTCREATORBUG-20746
Change-Id: I672f8410914c6cc77abc901998f419dda35755ae
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-07-12 11:26:07 +00:00
Christian Stenger
f80aa2c6f7 AutoTest: Fix handling of cpp files for Quick tests
Modifying C++ files of Quick tests had been ignored as they
normally have little impact.
But nevertheless this behavior is wrong and could lead to
unexpected behavior later on if no complete rescan had been
done and even with a rescan there could have been some
cached artifacts.
Fix this by tracking the paths of the C++ files that hold
the main() or the respective macro to be able to handle
changes of these files correctly as well.

Task-number: QTCREATORBUG-20746
Change-Id: Iec860aa63ffd167511efdbf63a6ffa369f094edf
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-07-11 13:18:04 +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
Marco Bubke
b6e12f4a1c Convert macros from plain QByteArray to a vector of structs
The old code model expected the macros as C++ formatted text
("#define Foo 42) but newer targets like the Clang codemodel expect key
value arguments like "-DFoo=42". So instead of parsing the text again and
again we use an abstract data description.

Task-number: QTCREATORBUG-17915
Change-Id: I0179fd13c48a581e91ee79bba9d42d501c26f19f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-14 15:23:56 +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
3cd688ca44 AutoTest: Avoid full rescans if not necessary
The file system watcher triggers way too often as it
acts not only for removal or addition of files, but
for any change like mtime or similar.
Doing always a full rescan is painful, so limit this
as much as possible to the files that have changed.

Task-number: QTCREATORBUG-18315
Change-Id: Iba4705ff58c34e998d8cf1b40761758c6fd65680
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-13 07:24:35 +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
b86011c375 AutoTest: Avoid dead-lock of file system watcher
Calling addPath() on the watcher could dead-lock on some operating
systems as we were in an asynchronous process.
Avoid calling addPath() from inside an asynchronous process and
perform this call from synchronous context.

Change-Id: I94cd401e12ccbb3526b8cc4232a9cff7ed552bbb
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-21 11:25:20 +00:00
Christian Stenger
3d6b108971 AutoTest: Fix handling of subtyping TestCase again
We need a more present snapshot when inspecting the AST of QML files
we need to process.
Due to handling all problematic accesses inside the QmlJS model by
guarding it with mutexes it is no problem even when parsing multi threaded.
The former fix collided with another patch and therefore went in
without fixing the issue.

Task-number: QTCREATORBUG-17787
Change-Id: I460bae4b09cdc9a0cd38bc3383fd593c3abdfaad
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-16 08:02:48 +00:00
Christian Stenger
5708f3aa34 AutoTest: Handle sub-typed TestCases correctly
Furthermore ensure that TestCase is really the Qml type
to avoid handling self-defined types as Quick Tests.

Task-number: QTCREATORBUG-17787
Change-Id: I08a6c70c3c166eefec6f24669cc225f568e51c7a
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-14 08:24:08 +00:00
Christian Stenger
05e8f34d3e QmlJS: Allow forced rescan on already known paths
Qml files used by Quick tests are not necessarily added to the
project file and therefore not fully handled by the QmlJS code
model / snapshot.
When adding qml files to a directory that is handled by the
code model these folders are not scanned again - we need to
enforce such a scan on AutoTest plugin's side.

Task-number: QTCREATORBUG-17805
Change-Id: Ie3d071a9aa03297d618648b06d52fb298c856d25
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-08 08:57:34 +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
a095148993 AutoTest: Avoid processing files that are no more present
Change-Id: I02ea32b14fe0d911f3c0b151eb993999922605e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-07 09:57:43 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +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
40174187cb AutoTest: Remove unnecessary indirection when creating test tree items
Change-Id: Id4648196011b6769a2cd51b4daee146068272f00
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-12 05:50:32 +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
38484d463c AutoTest: Correctly release resources
Change-Id: I8023c1468f9cf9cc0c549a466b298e19a6b40a15
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-07-15 09:19:18 +00:00
Christian Stenger
0b527de52e AutoTest: Fix parsing for QuickTests
If the scan for quick tests was triggered just by a change of a
qml file (including indexing by the respective modelmanager) we
might find tests that won't be able to execute.
If we have already found quick tests we know their respective
project files. If we cannot find the files to be scanned inside the
already found ignore scan requests for such files.

This patch is kind of a continuation of b570ee1b80
(Fix initial parsing when loading session)

Change-Id: Ic1228641f60abf127134acbd4232a0ddd30ef159
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-15 09:19:12 +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
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
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
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