Commit Graph

139 Commits

Author SHA1 Message Date
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
hjk
5dcfbe6c52 Autotest: Use more FilePath
Change-Id: I15de1121305f245274d74b4116786f6f07ffa3c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-23 07:25:16 +00:00
Alessandro Portale
912b016ab0 Utils: Add "Layouting::HorizontalRule" LayoutItem
We have many horizontal separator lines in the UI, which are each time
repetitively created from a QFrame with some flags set. With the .ui
inlining, we will have more of these separators coming.

This change intoduces a Layouting::HorizontalRule LayoutItem and
replaces various existing QFarme separators with it.

Change-Id: I60bad89e2a2b777fbd2f9d0cf872af81e41dcfd7
Reviewed-by: hjk <hjk@qt.io>
2022-08-29 15:30:25 +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
4a9fe3e709 TestRunner: Don't call blocking waitForStarted()
Handle failed to start case inside done() handler.

Change-Id: Id138f0ef1fc58b6e335e08d8222e99c29c06b942
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-04 12:40:16 +00:00
Jarek Kobus
425a0c8835 AutoTest: Connect to done() signal instead of finished()
QtcProcess::done() is also emitted when process failed to start.

Change-Id: I08f6f104014d1c90c0f761de352dada620207d86
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 12:51:42 +00:00
Christian Stenger
b28f907114 AutoTest: Use QtcProcess for test runner
Change-Id: I29b15a08a260aaf8d2c4071d5ea71d49902d8ef6
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-14 13:33:20 +00:00
hjk
a579fa52ee ProjectExplorer: Rename some RunControl functions
Change-Id: Ia86a50100ddfd465d548863ae8d58033a5dbafc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-02 08:10:28 +00:00
Christian Stenger
17ef9bc35c AutoTest: Ensure test runner does not get stuck
If we fail to start the executable or the executable is missing
we need to ensure the runner continues by cleaning up and
scheduling the next test if there are more.

Fixes: QTCREATORBUG-27285
Change-Id: Ia89374d7105f2fd6a42fa3fa018f14677e30ad1b
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-03-31 13:03:45 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +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
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +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
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
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Christian Stenger
5d1c789c27 AutoTest: Introduce TestToolConfiguration
Preparation for having code based and build system based
test items.

Task-number: QTCREATORBUG-23332
Change-Id: I4d21142d74b40b988d82c69d02f5c6633c8cebe4
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:56 +00:00
Christian Stenger
e95041c054 AutoTest: Guard against nullptr access
Change-Id: I0378b043ed240533ce6f4b341705dc84d6ede7eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:17 +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
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
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02: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
745beb7634 AutoTest: Fix possible nullptr access
If the process of the test executable cannot be started
for whatever reason we will not have an active run
configuration or output reader.

Change-Id: I50146a2c8228ad39574e007ae2659465122ad20b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-15 12:59:05 +00:00
Alessandro Portale
bb89b80097 AutoTest: performance-for-range-copy
Change-Id: I60e79aec1fe2813867d8ff46cec7d39b848d0020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 07:01:10 +00:00
hjk
f3c1751965 Autotest: Move Test{FrameWorkManager,Runner} singletons
Make them plugin-pimpl data members, removing some indirections.

Change-Id: Ie441ac94a27f07342513b0b5b1437ccfe4b5d7d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-26 16:46:17 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Christian Kandeler
9348ac5fec Utils: Remove the *SameLine OutputFormat enums
Presumably, they were intended for output that shouldn't get an
automatic newline, but if there ever was such a thing as automatic
newlines, it must have evaporated over time. All users of
OutputFormatter provide a newline if they want one.

Change-Id: Ibd219b7305fd503ce075d6f77930d2b538d5e2e8
Reviewed-by: hjk <hjk@qt.io>
2020-03-18 13:52:17 +00:00
Christian Stenger
5a562bd9b1 AutoTest: Fix possible crash
Re-triggering runOrDebugTests() should be done
only once to avoid the test runner interfering
itself and crashing QC.
Amends 0f60f120d2.

Change-Id: I49f666f2c96730729ef54d8d8781d4058b3e0cca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-18 09:08:32 +00:00
Christian Stenger
0f60f120d2 AutoTest: Handle async updates of executable information
When opening or creating a project for the first time the
executable path of the application targets may be empty
until the build system has updated this after the first
successful build.
This update happens asynchronously, so we might need to
postpone the test execution a bit and wait for the
respective update.

Change-Id: I63b5c45f6ecb194020ea36bbb5c9486a4dcc004c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-17 14:32:02 +00:00
Christian Stenger
769bd017b9 AutoTest: Remove unreachable code
Change-Id: I98d3d21fe8239f376e0c2619b10bc5b44267cb0e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-11 11:39:31 +00:00
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.

AA_DisableWindowContextHelpButton was added in Qt 5.10.

Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 13:26:44 +00:00
Christian Kandeler
5cebf2a79a ProjectExplorer: Move some build-related code to BuildManager
The projectexplorer.cpp file is a huge mixed bag, which could use some
cleaning up. The queue() function is very much related to the
BuildManager, so move it there.

Change-Id: Ibc6425cc27d44514803a5e7c6139f83ddd760382
Reviewed-by: hjk <hjk@qt.io>
2019-12-19 17:35:46 +00:00
Eike Ziller
3b583061a2 Merge remote-tracking branch 'origin/4.11'
Change-Id: I066040bd5e762d580c8a903122f451f2193df186
2019-12-19 12:21:00 +01:00
Christian Stenger
62fd368473 AutoTest: Fix stopping test debug run
If the Debugger gets into a corrupted state and is not
stopable cleanly we do not get the stopped signal.
This in turn leaves the test runner in an inconsistent
state which cannot be reset except with a restart of Qt Creator.

Fixes: QTCREATORBUG-23298
Change-Id: I9d7e7cbc847f8883d2e750f4436c5ef281106d3a
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-12-19 10:13:28 +00:00
Christian Kandeler
4933f79111 ProjectExplorer: Provide the option to build only the app to be run
... instead of the entire project.
This can speed up the development cycle by ignoring irrelevant changes
in the project, potentially at the cost of missing parts that actually
should be re-built (in particular with build systems where a product
does not have full knowledge of its dependencies).
Supported by qmake and qbs for now.

Change-Id: Ic7101aa243e92ba139798d13366d256c1919dcc3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-12-05 14:18:06 +00:00
Christian Stenger
333b8f9812 AutoTest: Allow colored commandline output
Some test frameworks allow to print their output colorful
to further indicate meanings of messages or test results.
Provide a highlighter for the textual output of the results
and enable this functionality for GTest and Boost UTF.
Keep at least a small backdoor for overwriting this by
the user.

Fixes: QTCREATORBUG-22297
Change-Id: Iddd2b734416de807635d90c6519553081f7372f2
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-11-13 13:09:00 +00:00
Christian Stenger
2c7e769e31 AutoTest: Clear up and generalize
Instead of transforming forth and back the output
try to handle the output once correctly and pass it
line-wise around.
This also ensures that we always get a single line
when appending the output which will be necessary
later on.

Change-Id: I3e9c6db5f81172997dfe566eee9a86bfe2f17a1f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-11-13 13:07:25 +00:00
Christian Stenger
3e56a2b81e AutoTest: Add some logging to test runner
This may help for issues which are not easily
reproducible.

Change-Id: If8063c51f69bd24f12afdcdd0648790f1a0668da
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-17 04:41:09 +00:00
Christian Stenger
a8cad2038e AutoTest: Tweak run after successful build
Make it possible to distinguish between all and selected
test cases also for the automatic run after build feature.

Change-Id: I91715a7ae4f09cea2e31844940a6b21ae9e62157
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-20 04:43:14 +00:00
Christian Stenger
265498cadc AutoTest: De-noise code a bit
Change-Id: I4585ebfb53623221c713ab0e8e254ba59a4e5920
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:28 +00:00
Christian Stenger
03b80025a9 AutoTest: Shuffle namespaces for clearer separation
Change-Id: I6ac440c6d72c3d0dbcd75907f8a6ae756f3cf5ee
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 09:04:16 +00:00
Christian Stenger
d12f90047a AutoTest: Allow run after build per project
It might make more sense to be able to enable this
per project instead of globally.

Task-number: QTCREATORBUG-16704
Change-Id: I2e29d3af62c428bcbb534b72b5eb13f1fbd83973
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-02 07:08:50 +00:00
Christian Stenger
51382a846d AutoTest: Add automatic run after build
Add an option to automatically run tests if the build
succeeded and the current project has tests.

Change-Id: I1fe028be84279b9b488f78590565c6d4b0449e34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-02 07:08:38 +00:00
hjk
d2a0b13252 AutoTest/ProjectExplorer: Move some unusual function towards only user
Change-Id: I1101a21871c8b1eac5c01afc033e5416850bc794
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 11:48:36 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
Christian Stenger
8f6d99dc29 AutoTest: Avoid unclosable progress bar widget
The progress bar widget gets automatically closed if the
underlying future reports that it has finished or got
canceled. This patch ensures to emit the respective signal.

Fixes: QTCREATORBUG-22699
Change-Id: I5c7d2169194e90165fb1c90831cf69c02e029268
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-11 13:55:09 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
Marco Bubke
4bae5de36b Enable macro editing for the Clang indexer
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.

Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-13 16:51:48 +00:00