Commit Graph

25 Commits

Author SHA1 Message Date
hjk
14e18fc92f AutoTest: Merge settings and tools hierarchies [1/2]
Currently living in the settings files to keep changes small,
will be renamed in a second step.

This allows the settings aspects to be used in their short form
and overall removes some indirections.

Change-Id: I099369b62239aed8192613a04bca958a660c36c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-12 12:12:17 +00:00
Christian Stenger
acad4b6b2e AutoTest: Improve QRegularExpression usages
Use static const if possible to avoid re-initializations.

Change-Id: Ibee9e320dccb90cd928737b809db3b56369961ec
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-07-04 06:59:50 +00:00
Christian Stenger
5a5776400a AutoTest: Fix missing includes
Change-Id: Ieb34092c8c78068ae1630cfaa0f18a45f7d43c0c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-03-02 07:51:28 +00:00
Jarek Kobus
8285c85725 Autotest: Use QPromise for async calls
Change-Id: I57d2feed36eeb1871b2b00cf7720c48f6a0e81b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-27 14:50:48 +00:00
Jarek Kobus
bc3ebef7ce AutoTest: Use using namespace Utils more often
Change-Id: I9d20cd3496c4719d58a977f8fd53253c86d55463
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-27 09:51:55 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
40ba25b691 CPlusPlus: Return FilePaths from Document::includedFile
... and fix fallout.

Change-Id: Ieaad57700fa48d0c4a0dd9bf2c284315579b9473
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-25 09:23:39 +00:00
hjk
fa1adf4d40 CPlusPlus: Proliferate FilePath use
The starts with CppDocument::filePath(), plus a bit of the fallout

This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.

Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).

There should be no difference for local operation with this patch.

Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-22 15:30:00 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Christian Stenger
924806e10b AutoTest: Fix catch2 parsing when using prefixed commands
If Catch2 is used with CATCH_CONFIG_PREFIX_ALL the relevant macros
get a prefix. This patch enhances the respective parser to be able
to handle these appropriate.
This does not really take into account whether the define is set or
not, so the parse results will only be correct if the project can
be built.

Fixes: QTCREATORBUG-27704
Change-Id: I935de752ac6106524c45c027af3e0f43673c4578
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-16 06:16:38 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Jarek Kobus
cd3f82f247 Pass QFutureInterface by reference
No need for a copy.

Change-Id: I0308da77199942ef49e36fb04e81713cb9d9a901
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-30 12:06:12 +00:00
Christian Kandeler
a952500e90 CppTools: Use only const pointers for ProjectInfo and ProjectPart
All members were already const, but this makes it clear at all points of
use that these data structures are immutable.

Change-Id: Iea615c090bde462c445d15223caccc561b0c713d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-27 10:53:54 +00:00
Christian Stenger
9db6569c43 AutoTest: Take precompiled headers into account
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>
2021-06-07 12:05:37 +00:00
Christian Stenger
5525f2b112 AutoTest: Use Utils::FilePath for files and directories
Still some missing bits as some QString members had different meanings
depending on their context.

Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c
Reviewed-by: hjk <hjk@qt.io>
2021-05-27 12:24:05 +00:00
Christian Stenger
d7c659fa87 AutoTest: Support upcoming Catch2 v3
Fixes: QTCREATORBUG-25582
Change-Id: I6ba7184d63aa6dd2b5b86d2d7d420297b59bef15
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-07 05:02:46 +00:00
Bernhard Beschow
ed6083b521 AutoTest: Improve type safety in TestParseResult
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>
2021-02-04 11:31:56 +00:00
Bernhard Beschow
5d7f2d7444 AutoTest: Use working copy of own parser
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>
2021-01-22 10:51:53 +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
Christian Stenger
3eb4a69b6f AutoTest: Remove some unused member
Change-Id: Iea332afc23c58aa0a3de1f3364eea519a422d524
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-23 11:09:21 +00:00
Christian Stenger
ae3bb43dd1 AutoTest: Support registering functions as catch test cases
Task-number: QTCREATORBUG-19740
Change-Id: I60a59d3902e1202d4cf18635bae3ef31806b0aac
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-20 08:43:19 +00:00
Christian Stenger
4e0fa78752 AutoTest: Pull catch tree nodes one level up
This patch makes test cases now match the TestCase node so that possible
additional sections can be functions instead of test data.
Mis-use the TestSuite for the file node that is used to additionally
group the items. The file node is kept - for now - as it seems rather
often that test case names get pretty long names.

Change-Id: I364fc40d1de6a22b6f170b3001f37393b64680aa
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-20 08:43:03 +00:00
Christian Stenger
96fe0aab8d AutoTest: Support missing Catch2 test case macros
Add support for macros defining parameterized test cases
and for test cases using a fixture.

Task-number: QTCREATORBUG-19740
Change-Id: I631009f309cb48d2657acb6e52911e052ff85c5b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-17 06:53:26 +00:00
Christian Stenger
d04597f2aa AutoTest: Re-implement catch parser
The AST handling is limited and fails for other macros
that will be added later on.
Replace the parser by using a lexer.

Change-Id: Ia11f0a05eec770c703180935a64615e5090b314c
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-16 07:45:19 +00:00
Jochen Seemann
de38285bc3 AutoTest: add support for Catch framework
This adds a basic test and test output parser for the
Catch2 test framework.

Task-number: QTCREATORBUG-19740
Done-with: Christian Stenger <christian.stenger@qt.io>
Change-Id: Ic3322905ab82f414d2a26c325e130142233f72aa
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-09 12:46:37 +00:00