Test frameworks might be added to the precompiled
headers. This in turn would make some pre-checks
whether a file has to be processed or not fail.
Fixes: QTCREATORBUG-25821
Change-Id: Iff69c1a83889cb6f79a3e3f9b2e59c5383989ccd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@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>
By having TestParseResults take ITestFramework rather than ITestBase as
parameter, some base->asFramework() casts can be avoided today which
could possibly fail in the future.
Moreover, it allows TestTreeItem to take ITestFramework rather than
ITestBase as parameter which improves type safety further. This shall be
done in a separate commit though.
Change-Id: I66594415d68c3423076a0830ecd11080d3b6c186
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
In TestCodeParser::syncTestFrameworks(), a parser is created for every
test framework. As a result, the last parser being created would "win"
the global s_parserInstance variable, which is not predictable and
probably not intended. So turn CppParser::getFileContent() into a non-
static method, avoiding the global variable altogether.
Change-Id: I9f7560f1185bc4a3bc7b2b36e89280351998465e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
...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>
... 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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* remove unnecessary QLatin1String where possible
* foreach
* nullptr
* bad naming of static members
Change-Id: If0f7c6839be4d2efbfef6f7f0775d2034775bd90
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
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>
Preparation for introducing test frameworks.
Change-Id: Iefaa4ca9dd9af665444556afa9c6e326041cfd0f
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
...into files and respective sub folders.
Change-Id: Ic80d693bd73993a6e74b6d422349e47276e8cb6e
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>