Commit Graph

17 Commits

Author SHA1 Message Date
Christian Stenger
0bb8cd2d68 AutoTest: Tweak wizard a bit
Provide a version for creating Boost tests using the
shared library approach.
Add second variant for creating Boost tests.
The former version is the header only variant and can
not get extended with further cpp files without
modifying project files and the existing cpp file.

Task-number: QTCREATORBUG-28846
Change-Id: Ie7ecc339dcbe11804ce19bdba20e8db36b893a50
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-05 13:52:05 +00:00
Christian Stenger
87be1f6370 AutoTest: Tweak generated cmake project file a bit
Using Quick Test with cmake as "build tool" does not list the
important part for the testing - the test sources.
Explicitly add the qml files to the project and list them to
be able to see and access them directly.

Change-Id: Id136a017989a5bfb4b9058576e008edb792e5866
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-09 10:08:13 +00:00
Christian Kandeler
aed001650a Project wizards: Do not use CMAKE_INCLUDE_CURRENT_DIR
This is an anti-pattern that lets uneducated and/or careless developers
get away with using the wrong type of include, so we should not
encourage its use.
It's also not needed by the wizard-generated code.

Change-Id: Iae508025bcd6659ed5aeb546a3da5f8f72e75059
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-26 13:55:16 +00:00
Christian Stenger
0614d9ba4d AutoTest: Enhance QtQuick Test wizard
The wizard can now generate setup code as well.

Fixes: QTCREATORBUG-26741
Change-Id: If67ba0556001c5acd9ad6e5d98458771589f2ebd
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-01-12 12:02:46 +00:00
Kai Köhne
b098b8ffe4 Change wizards to use find_package(... REQUIRED COMPONENTS) idiom
Task-number: QTBUG-98867
Change-Id: I7812898c411d5366d1d2452f01bd856d194fde84
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-09 13:09:10 +00:00
Christian Stenger
7e965629b0 AutoTest: Fix cmake wizard
If ctest is going to be used we need to enable testing. Do it globally
instead of per framework which already led to forgot it.

Change-Id: Ifdb0e94708a26e2496d708361d5b8163aa2912ad
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-13 09:29:05 +00:00
Christian Stenger
f6f2ffde4e AutoTest: Fix generated files for gtest
When using gtest as test framework the wizard generated
a header file containing the test code which had been
included inside the main.
As this works generally it is on the one hand not
recommended and on the other hand it lets us fail when
using cmake as build system.
Create a cpp file instead and use this accordingly.

Fixes: QTCREATORBUG-26253
Change-Id: Ibec8489258de0def27ee116eacbfc1bb22d3206b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-13 08:54:48 +00:00
Kai Köhne
e030d04892 Auto Test Project: Prefer Qt6 over Qt5
Be consistent with the other wizards, and prefer Qt6 over Qt5,
if both are available.

Change-Id: I3a2f1c04c372a98ae6dacd884344fdd8d2ea2deb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 11:15:38 +00:00
Kai Koehne
1b09888ba9 Auto Test Project: Make CMakeLists.txt file Qt 6 compatible
Change-Id: I2289c60e44e8e97de7634342de166bf299934e76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-18 15:06:24 +00:00
Jochen Seemann
9f981e7e23 AutoTest: Wizard: Add Support for Catch2
Done-with: Christian Stenger <christian.stenger@qt.io>
Change-Id: Idc59cf962e54845746a645efb5e931502deae38e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-20 08:43:45 +00:00
Christian Stenger
2375dcab67 Wizard: Fix test registration to ctest
Change-Id: Ia30cdf1ce690a2ebbc2e991e4e3f8a029e4768ed
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-12-05 11:55:16 +00:00
Christian Stenger
90189ec3d1 AutoTest: Wizard: Soften condition for gtest repository
Make the need for the googletest repository optional. The user
may have gtest installed inside the system instead.

Change-Id: I4959878fa893d6b8ed53fd612934d7cd4504a6b7
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-12 08:50:36 +00:00
Cristian Adam
36135aa261 CMake: Small clean-up of CMake Wizards
* Updated CMake minimum version to 3.5 (Ubuntu LTS 16.04)
* Lowercase commands
* Used the target name instead of ${PROJECT_NAME}, which nobody uses in practice
* No string quotes around the source filenames, which do not contain spaces

Change-Id: Ide9b3eb85535213798c6c35e08624cae080ebd9d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-06-12 13:34:58 +00:00
Christian Stenger
675ac662e9 Wizard: Fix AutoTest wizard for Boost with CMake
While at it use the same environment variable used for
Qmake or Qbs based project.

Change-Id: Ieefb4e1da4ce4155863b80a1b275b67e664273c6
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-24 06:58:41 +00:00
Christian Stenger
a0b94384a6 AutoTest: Add wizard for Boost test
Task-number: QTCREATORBUG-21169
Change-Id: I77936e3e47911cf724705c858b9897c74875c41e
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-23 12:19:36 +00:00
Christian Stenger
e43668f603 AutoTest: Provide missing QtQuick test template
The Auto Test Project wizard had minimal templates for
QtTest and GoogleTest. Provide the QtQuick minimum
template as well.

Task-number: QTCREATORBUG-19579
Change-Id: I0efc1915c3bd0c251d8b94c50ed7ed6341812242
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-01 09:23:07 +00:00
Christian Stenger
9df203f314 AutoTest: Add missing CMake build system to wizard
Task-number: QTCREATORBUG-16916
Change-Id: I4dca90dd458789b7385013229d8447d6a8e6d360
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-21 14:07:00 +00:00