Commit Graph

47 Commits

Author SHA1 Message Date
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
Marcus Tillmanns
3873bcf2a4 AutoTest: Add option to disable derived checks
Previously the quick test parser would always check each symbol
its interested in to see if it might be derived from "TestCase".
This is very expensive.

This patch adds an option allowing the user to
enable or disable the check.

By default the check is disabled.

Change-Id: Ia6b230b344add672e53ad7fb52845c78a2914b99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-23 11:32:01 +00:00
hjk
7ecc507b75 AutoTest: Fix test compilation
Also amends 33cdb052ba

Change-Id: Ic4cf8671cf97c9d94fe933b9d29cb515355f5e6b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-13 15:51:56 +00:00
hjk
33cdb052ba FilePathify some testing code
Change-Id: I3739a6eb3c2172078e9519e8186daf94ec74d99a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-13 10:46:13 +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
Jarek Kobus
ecf83d667c AutoTestUnitTests: Remove TestStringTable scenario
Instead, we should provide tst_StringTable that would
run GC, make a sleep inside GC being run in other thread
and execute destructor of StringTable in main thread.
In this case the test should ensure that destructor of
StringTable waits for its internal thread to finish.

Amends 7a02b39f26

Change-Id: I017b5a8f98b41ef6884c43d319858dcb16f17fba
Reviewed-by: hjk <hjk@qt.io>
2022-12-07 14:46:24 +00:00
Eike Ziller
f8b430c0b2 Various: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I724eecc040e33e249a88243f27e8a9e72e54f24b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-30 11:47:05 +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
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
Jarek Kobus
e3acfcbe60 Remove unneeded includes of ApplicationLauncher
Touching applicationlauncher.h caused recompilation of 455 files.
This reduces it now to 250 files.

Change-Id: I4f347d67695db40ea139faf7d36cfe02f1c32258
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-11-10 08:27:32 +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 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 Kandeler
33108795d6 CppTools: Turn some classes into pure value types
ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers
to Project and/or Toolchain, even though they were used in contexts
where these pointers were either unsafe to access or not guaranteed to
be valid anymore, which made their use difficult and error-prone.
We turn these classes into pure value types by copying in all relevant
information before the first async operation takes place.

Fixes: QTCREATORBUG-25678
Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-13 12:35:49 +00:00
Jarek Kobus
5b0889777a Add a test for a crash in ModelManagerInterface
Task-number: QTCREATORBUG-25350
Change-Id: I4ea31e7936cc77dcd8f3fc494b5ecbd83858a766
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 12:42:53 +00:00
David Schulz
cb1b86645a Autotest: some FilePath::toFileInfo cleanup
Change-Id: I45395c5e83bc01d98d0bec20c992424d4150c844
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-10 08:05:44 +00:00
Christian Stenger
093f3479ce Fix execution of scenario
There are different ways of having a settingspath for QC. If the
settingspath is not provided for starting QC we may use the global
settings or a temporarily created settings folder.
To correctly run the test scenario from inside a plugin unit test
we need to have the same environment and settings.

Change-Id: I5dcc61e162258a0af8d3c8df2e63255d0e35f464
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-09 12:24:39 +00:00
Jarek Kobus
422409bf26 Add TestStringTable test
The TestStringTable tests the fix provided for a crash in StringTable
on shutdown.

Amends: f4ab1279fd

Task-number: QTCREATORBUG-25417
Change-Id: I5a4a7e4a20e1b9611682a976d38dee17d4603c5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-06-07 12:16:27 +00:00
Christian Stenger
5d5ff57495 AutoTest: Fix gtest detection
If a test name starts with a number the codemodel handles
the function-like macro differently and does not generate
the arguments as it would do when using normal literals.
Work around by explicitly handling the expression tokens.

Fixes: QTCREATORBUG-25498
Change-Id: Ibf381af912403cb7b87c1c30b5a8fc7043c16056
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-07 08:58:14 +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
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
hjk
0cdd07e06e AutoTest: Fix compilation with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I40b51e02fbb90b059d3cad16a57b70e463e6465d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-20 11:24:44 +00:00
Christian Stenger
6e798401a0 Fix plugin unit tests when using projects
The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.

Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-17 04:13:30 +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
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
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
Christian Stenger
8cd7a11926 AutoTest: Fix handling of unnamed QuickTests
..now that the parser understands multiple TestCase items
inside a single qml file.
As long a test function is located inside a different TestCase
it is considered as a different one, so treat test functions
even of unnamed test cases correct.

Change-Id: I5cbfe1f63f896317523d51bbf67ea59169481a71
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-08-22 06:50:05 +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
Christian Stenger
e6ede1d997 AutoTest: Limit condition for test execution to Linux
gcc and clang are handling builtin include paths differently.
On Linux the default should be gcc - which works fine even
if boost is installed in /usr/local.
On macOS clang is default which does have the correct builtin
include paths only for Qbs but we are testing on qmake as well.
So, expect the BOOST_INCLUDE_DIR set on macOS if we want to
have this test executed.

Change-Id: Ib9ad697b59bfad5413ad984c9b969ec8b174ae9a
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-25 07:46:50 +00:00
Christian Stenger
b86c05b96a AutoTest: Add unit test for parsing boost tests
To execute them you need - beside the former prerequisites -
either have boost installed installed at system level (UNIX)
or you must specify BOOST_INCLUDE_DIR as environment variable
otherwise the respective test will be skipped.

Change-Id: I6bd8472e554132ab05e58b56e3ccbd5e9dffada9
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-24 06:27:22 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +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
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
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
2475da1bb5 Replace some more occurrences of QStringList() << pattern
Change-Id: Ic7193ac3a741763479a9ef129ed05cb7ca64f1e9
Reviewed-by: hjk <hjk@qt.io>
2017-02-08 14:27:48 +00:00
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +00:00
Christian Stenger
f375f197d1 AutoTest: Add test for derived Qt tests
Change-Id: I8c61c08ff9b0653c02d262fb9010940e41e178af
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-11 09:02:09 +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
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
Eike Ziller
7e1b4ccebb Merge remote-tracking branch 'origin/4.1'
Change-Id: I041b949aff8bee481a572ba6f7e2ef72b9010923
2016-07-15 14:10:38 +02:00
Christian Stenger
9a3a0fa7ce AutoTest: Fix detection of gtests inside namespaces
Task-number: QTCREATORBUG-16535
Change-Id: I3285d2545e2861607b6e1406ee24f950405c4367
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-15 10:17:44 +00:00
Tobias Hunger
cb14fb0d71 Kits: Save several ToolChains per kit
BREAKS BACKWARD COMPATIBILITY OF TOOLCHAIN SETTINGS!

* Convert old ToolChainKitInformation to new version
* Store several toolchains in one kit (one per language)

Change-Id: Ia59a2ad067c57971ec34ce9b2e43758344443755
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-14 15:34:06 +00:00
Christian Stenger
5ec1faa64f AutoTest: Provide additional test project...
...to also test combination of Qbs using Google Test.

Change-Id: I4a5d32a32bfaadd0dfaaa4884b58d2ac1a952bd3
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-20 19:23:07 +00:00
Christian Stenger
bf6f1232f7 AutoTest: Use settings for test run
Change-Id: I3871d15c34f19ea87d9c6ff99a6b0a83dad16fd1
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-14 07:46:59 +00:00
Christian Stenger
a4b747307e AutoTest: Fix flaky unit test
Since parsing and updating the tree model has been changed the
respective tests became flaky.

Change-Id: I82fcde51493bc86e2315018b21e9bacd8e8409a9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-26 09:40:39 +00:00
Christian Stenger
992f9ed222 AutoTest: Use mark and sweep for parsing
This also removes caching from parser and the respective test info
files are gone now as well.

Change-Id: Ibcea68e446dea532d6addd2f16863738e497bca4
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-01 08:31:52 +00:00
Christian Stenger
15b4e6fc91 Delete unneeded and prepare directory structure...
...to get plugin's repository more easily integrated
into QC's repository.

Change-Id: I10243bb4283623ae951e799feacaa15915678e04
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-22 14:07:19 +00:00