Commit Graph

132 Commits

Author SHA1 Message Date
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
Jarek Kobus
9e571931d0 AutoTest: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Glue lambda brackets with parameters brackets.

Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 09:32:42 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +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
Marcus Tillmanns
04205d1225 FileUtils: Adds toFilePathList function
Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-04 11:33:53 +00:00
hjk
960e99ecb1 Autotest: Convert to Tr::tr
Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-01 12:16:41 +00:00
Fawzi Mohamed
fd89043de2 qmljs: (QString -> Utils::FilePath)++
convert more QString containing paths to Utils::FilePath

Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-13 17:13:23 +00:00
Eike Ziller
342a24d56a Merge remote-tracking branch 'origin/5.0'
Change-Id: I0ef7cd302ba7cba64fec401f3426dd682b8dc036
2021-09-15 11:18:11 +02:00
Christian Stenger
0f58258e04 AutoTest: Silence soft assert
We synchronize the test tools now earlier and may
not have finished setting up the configuration of
the current project.
This means the project might have no valid target
yet.
Amends 481070d808.

Change-Id: Ic0c1817318a343e68587930c492397a6094a4ce2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-15 08:13:54 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Eike Ziller
8e51295959 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/libs/utils/processreaper.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
2021-09-07 11:05:40 +02:00
Christian Stenger
481070d808 AutoTest: Fix test tools handling for project settings
Fixes restoring project settings with enabled test tools but
having globally disabled these.
We need to take the real active state for test tools into
account not only the global one.
Kind of enhances b99d7623f3.

Change-Id: I29c8cc4fff7c82140da41d3c85823d5980c96d9f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-07 08:06:03 +00:00
Christian Stenger
b99d7623f3 AutoTest: Fix synchronizing test tools
It is wrong to query the global active state when
adding test tools known to be active.

Change-Id: I89ab292e1a71b43757e6308fa4b4c584d62fe28b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-03 07:13:23 +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
Christian Stenger
fec3ef202f AutoTest: Prevent potential nullptr access
Change-Id: I78eb4a5113d23273e9383c86fdefcffea05e0123
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-06 12:24:44 +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
c1abbf0802 AutoTest: Fix checkstate evaluation
When the last item of a test got modified and gets a
different state than the rest of its siblings we failed
to set the resulting state of its parent to partially
checked.

Fixes: QTCREATORBUG-25702
Change-Id: I122b77b907dfa7fd14c31d8363b025254e0c115e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-10 07:48:21 +00:00
Christian Stenger
1effc86642 AutoTest: Fix crash on closing a project
If the check state of a tree item changes due to closing
the project and there is no other project open we access
a nullptr.

Change-Id: Ib08031e19eaae0837d1dc0485a05756cd8d0c0dc
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-26 06:22:42 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Bernhard Beschow
06dd646370 AutoTest: Only expose ITestTreeItem in TestTreeModel's public methods
Change-Id: Ide2513c838178b841763fe781478748a852a258c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:44:16 +00:00
Bernhard Beschow
cba4d5de5c AutoTest: Mark method as static
Change-Id: I14f2f0acf266a0fb4f88e26f50cfbe2257e3ab9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:43:54 +00:00
Bernhard Beschow
2d92ae391a AutoTest: Prefer ITestBase::type() to ITestBase::asTest*()
The casting provided by the asTest*() methods isn't made use of here, so
using the "data-oriented" type() method seems more expressive.

Change-Id: Ia3e1a28d126f096afed54eeb0d884c52332f4350
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-09 22:38:20 +00:00
Bernhard Beschow
c16f8ce988 AutoTest: Prefer ITestParser to ITestFramework in TestCodeParser
Preserves the level of abstraction.

Change-Id: I01354fc8fcdf846dd2ef2a20fce12f6e9c4756b2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-08 09:36:35 +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
3d075d30d0 AutoTest: Fix invalid static_cast
Test tools only create ITestTreeItems, not TestTreeItems.

Change-Id: Idb20844b80e351d4f0a472e4b97b074797ad6f99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:31:09 +00:00
Christian Stenger
da07d8f5c3 AutoTest: Fix some clazy warnings
Avoids potential nullptr accesses and unneeded allocations.

Change-Id: I8c13ca1dab885fc3e9a05dc7329ff592a7f0fe1a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-19 12:27:08 +00:00
Christian Stenger
ab963bd4f1 AutoTest: Simplify expression
Change-Id: I3f724e3d9f749f533cd6d18e2258cf7e99c29239
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-15 06:20:18 +00:00
Christian Stenger
3de4ac3736 AutoTest: Handle test tools inside project settings
This effectively enables to handle ctest project wise instead
of just globally. So far only code based test frameworks could
be enabled or disabled by project.

Change-Id: I491f91119c3500131ca51af4d55b0e68d47debf0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-15 06:20:09 +00:00
Bernhard Beschow
f82692cc7f AutoTest: Make code more symmetric
... by assuming that active.keys() is a subset of
TestFrameworkManager::registeredFrameworks() which is used in the case
above. Also, TestFrameworkManager::registeredFrameworks() is already
sorted, as can be seen from the above case, too.

Change-Id: If82c8c998716fa56d6257d3ee0ec09c12d458bb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-07 14:54:34 +00:00
Christian Stenger
40d83926a2 AutoTest: Use more specific types for test tree model
Allows to move over some static casts to the base tree model.

Change-Id: I19e322714a6026771139eeb0ded4645afb45aabe
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-07 05:33:16 +00:00
David Schulz
7853c6ba4d AutoTest: add ITestBase::type() for better readability
Change-Id: I67133f4940329483f2d8d25d1212f4e07f57d39d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 05:15:15 +00:00
Christian Stenger
c217f0694d AutoTest: Allow registering ITestTools
Task-number: QTCREATORBUG-23332
Change-Id: I529b1cc1f110739c264c7a021aada063f697b1db
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-27 09:53:43 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Jarek Kobus
2c919c43be Use QHash instead of QMap when key is a pointer type
Ordering in container by pointer to memory doesn't make much sense.
QHash is faster for lookups in this case.

Change-Id: I0d4bdac7f5bb9afffdeaef70b99326547c080f55
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-17 14:38:17 +00:00
Christian Stenger
73613d8549 AutoTest: Introduce ITestTool
Preparation for separating handling of code based and
build system based tests.

Task-number: QTCREATORBUG-23332
Change-Id: I490af5f3157fd4a8cd07d976cdfd9e4503ade97b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:31 +00:00
Christian Stenger
239a59c596 AutoTest: Introduce ITestConfiguration
Preparation for an additional simpler test configuration
which needs to have the same common base.

Change-Id: I1800ed5d7301f1aea99eba6ef588a204697bd569
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:04 +00:00
Christian Stenger
55298cc211 AutoTest: Introduce ITestTreeItem
Preparation for having separated test tree items with a
common base.

Change-Id: I3735f582cc96910e971f5a41c799cc0729a10a58
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:09:46 +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
Christian Stenger
ff06a409c2 AutoTest: Immediately update checkstate cache
...as soon a modification of the check states happens
instead of waiting for the next parsing to update.
Otherwise we might lose all changes that have been
made without a parse.

Change-Id: I33a92786742eb2b58c1cfcdb438412a2c5bbaed8
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-01 08:07:50 +00:00
Christian Stenger
a7e1411ebf AutoTest: Cache failed states
Avoid losing failed states of test while editing files
that trigger a re-parse and may drop the original item.

Change-Id: Ia66c7f61819d610cced42ff9f86449855b80da2a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-01 08:07:40 +00:00
Christian Stenger
5f22126a79 AutoTest: Support gathering failed tests
Mark test tree items as failed for the last run
to be able to re-run them in an easier way.

Change-Id: I7ea3dcd16e5a02797d41f13e02b2fa95b857cf5e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-16 06:53:54 +00:00
Christian Stenger
df49d6e40d AutoTest: Persist check state to project settings
Make it easier to switch between projects and restore
the former check states of the found test items if
we have these information.

Change-Id: I99a5357388c36aa8cce6f5f82184d6ab2a8bf6e8
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-13 06:26:12 +00:00
David Schulz
dfd7bdd22a Autotest: Introduce ItemDataCache
Change-Id: Icbd703a8ddd3c5dea4a90d2c32c1866764bc0267
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-07 08:42:08 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +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
Eike Ziller
9a149e295b Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/tools/qml2puppet/CMakeLists.txt

Change-Id: Id6243b0f725a68075d789bf35e771113b742645b
2020-03-30 17:27:55 +02:00
hjk
78235d63b4 Autotest: Slim down TestFrameworkManager interface
- sort frameworks at insertion time
- apply the 'static' pattern
- inline code from convenience functions that are only used once on
  the caller side

Change-Id: Ic4a46ad9487c58b4dfd61658a6fccebb88a428a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-27 14:16:48 +00:00
Christian Stenger
ca82019cf0 AutoTest: Fix flakyness of plugin test
Relying on the order of tests of the underlying tree
model is bad as we order the model for the user with a
QSortFilterProxyModel.
Using non-unique keys is not wise either.
Ensure the keys are unique to have reliable results.

Change-Id: I556371d018c16e7b03a8ec85d60afc850056a94a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-26 15:09:57 +00:00