Commit Graph

40 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
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
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
hjk
bc3c4d7453 Dissolve RunControl::setRunnable
Change-Id: I52aea3bea0c4ea90a448f5a77bfa01414bc56702
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-31 07:13:05 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +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
f9c221eb54 ProjectExplorer: Re-work setup runworker factories
This combines two of the previous three paths to create run workers,
and refers to RunConfigurations by id, not by type where possible
to decrease coupling between the classes.

Only allow "type of run configuration" and "type of device"
as the only possible kind of restriction and require a uniform
RunWorker constructor signature.

Adapt user code to fit that pattern.

Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-09 12:34:42 +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
hjk
efb7d8deb7 ProjectExplorer: Split RunControl constructor
Into a trivial bit and two setters. Plan is to use it only with information
that is truly there (e.g. kit/device only) at the user side without having
to invent a RunConfiguration "handle".

Also remove some dead code in the test runner.

Change-Id: I987881e41722178b14b91f973b84cbdb67a9f85e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:38:45 +00:00
Ulf Hermann
a5f83fb66e QmlProfiler: Suppress debug message in test
The application is expected to fail after the transition to "Starting"
there.

Change-Id: I61e69df73ca9db82b9649727b69800927b1c16c5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-29 13:39:18 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
Ulf Hermann
17d530d60d Make sure we always quote the qmldebug command line arguments
Change-Id: I5ce68c238e0ab05d19715659a9cc2161e51e1a7e
Task-number: QTCREATORBUG-20260
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-16 13:08:45 +00:00
hjk
da33f94e20 QmlProfiler: Pimpl QmlProfilerPlugin class a bit more
... to be able to remove an unneeded use of the global object pool.

Plus some code cosmetics.

Change-Id: Ifdb0ff9cd40820a34a8951563402a50a594e4fdd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-19 10:17:36 +00:00
Ulf Hermann
e1ad7a1784 QmlProfiler: Drop static accessors from QmlProfilerTool
It wasn't really a singleton even before. For testing purposes make the
client/state/model managers accessible.

Change-Id: Ie5efbc47a6b9119495f999e4e05877d4789da407
Reviewed-by: hjk <hjk@qt.io>
2018-01-11 14:04:13 +00:00
Ulf Hermann
fb370f460d Move URL utilities from ProjectExplorer to Utils
This way we can access them from the qmldebug library.

Change-Id: I90ba80228f44a9d5ea825ad59f4bd1572969980e
Reviewed-by: hjk <hjk@qt.io>
2017-10-05 08:54:39 +00:00
Ulf Hermann
05ef571922 QmlProfiler: 20s are still not enough for LocalQmlProfilerRunnerTest
The test has failed again because of insufficient timeout. 22s would
have been enough this time ...

Change-Id: I001a921921997863d77af8483403a8bd8a85eb29
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-09-26 09:35:56 +00:00
Ulf Hermann
63a99936ab QmlProfiler: Unify local and tcp connection mechanism
Use the URL scheme to distinguish between them, check that in
QmlProfilerClientManager and test all possible combinations of URL
parts.

Change-Id: I6583e5bf18eda0344a299a279c12578c4ebc7ffe
Reviewed-by: hjk <hjk@qt.io>
2017-09-21 14:54:57 +00:00
Ulf Hermann
ee9a730f4b QmlProfiler: Increase test timeouts further
Test runs frequently fail because the timeouts are too low. the test
library suggests around 12s, so we make it 20s to be safe.

Change-Id: I746b141949620310371de71b0b2ec7538dc4b5ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-04 11:33:20 +00:00
Ulf Hermann
a8426626d1 QmlProfiler: Fix and extend the local qml profiler runner test
We need to indirectly verify that the profiler support is doing the
right thing by watching the RunControl's state transitions.

Change-Id: I8f92f21022668ed3bb28477152132ccdcffaaea6
Reviewed-by: hjk <hjk@qt.io>
2017-08-10 10:23:39 +00:00
Orgad Shaneh
f8caf4f367 QmlProfiler: Fix linkage
76:5: warning: instantiation of function 'QTest::qCompare<ProjectExplorer::RunControl *, nullptr_t>' required here, but no definition is available
qtestcase.h:180:5: note: expanded from macro 'QTRY_COMPARE_WITH_TIMEOUT'
qtestcase.h:89:17: note: expanded from macro 'QCOMPARE'
qtestcase.h:364:10: note: forward declaration of template entity is here
76:5: note: add an explicit instantiation declaration to suppress this warning if 'QTest::qCompare<ProjectExplorer::RunControl *, nullptr_t>' is explicitly instantiated in another translation unit
qtestcase.h:180:5: note: expanded from macro 'QTRY_COMPARE_WITH_TIMEOUT'
qtestcase.h:89:17: note: expanded from macro 'QCOMPARE'

Change-Id: I0d9ed4eb9109cbc93439f655781cee34331719ce
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-08-07 17:20:23 +00:00
Ulf Hermann
cac4b7c87c QmlProfiler: Make sure local runner test fails before test run ends
QTimer::singleShot postpones the execution of the test methods. If we
return from the current test method before, we might end the test run
before the code gets executed. This was hiding failures.

Change-Id: I0250cd37e5b25f2a72752a2d6f3abcac3314946a
Reviewed-by: hjk <hjk@qt.io>
2017-08-07 12:45:48 +00:00
hjk
f82bb1ec3a ProjectExplorer: Remove Connection as concept
It turns out that one "Connection" per RunControl doesn't map
well to the uses we have. Instead, RunWorkers need to know
individually how to connect to the place where they can work,
but they are already specific enough to be able to use a
standard class (like QUrl) as their way to specify the needed
entry point.

In theory one could see a RunControl's connection as an
aggregation of its workers connection bits, but that does
not really seem to be needed in code.

As consequence, replace UrlConnection by a plain QUrl, and also
the HostName connection by a QUrl with hostName set.

Change-Id: I40c97e37779314ac0a77041e864a18eadb78f987
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-07-07 06:23:52 +00:00
hjk
38b4dec764 QmlProfiler: Re-organize local run
Having the overall runworker setup closer to the general pattern
allows to re-use SimpleTargetRunner.

Change-Id: Iff151cbebaa6ae6615b933f4277b0581a43d7f7f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-27 08:33:00 +00:00
hjk
232fb7a425 QmlProfiler: Split server url passing from custom startup request
Orthogonal concepts, that only happen to coincide.

Also, make the server directly settable instead of relying
on the runControl's connection().

Change-Id: I2472acafcc50aede2cb6f99421901f0e67531b91
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-16 12:55:21 +00:00
hjk
25a75d3fa3 Debugger, QmlProfiler et al: Replace AnalyzerStartParameter
... and QmlProfilerRunner::Configuaration by PE::UrlConnection,
and call it 'serverUrl' on the user side.

That's the only variant we ever had and avoids "translations"
between three structures that are essential the same.

Change-Id: I33386b2b8d2a7985ff934f6f8f840de0831bf9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-16 12:19:16 +00:00
hjk
1a82bedc8b QmlProfiler: Merge LocalQmlProfilerRunner and QmlProfilerRunner
Also streamline code paths in the result.

Change-Id: Id7d96343a8f778ba8f415b1a850cc78576afa475
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 06:24:36 +00:00
hjk
76185b3b09 QmlProfiler: Convert to a RunWorker based setup
This also re-enables the remote linux case and enables
the recording of a single run of events.

Change-Id: I9ea55017c8e5f2f17e6f32c5453df48093e41931
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-30 08:57:08 +00:00
hjk
89f02cba2c ProjectExplorer: Split Target and ToolRunners into smaller tasks
This increases re-usability of activities like 'port gathering',
and makes their use less dependent on actual device implementations.

Change-Id: I017cb74874f2b38c487ba2d03906a675d5618647
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-15 14:35:03 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
hjk
112e32228a ProjectExplorer: Merge AnalyzerRunControl into RunControl
The change is "conceptually wrong", the AnalyzerRunControl derived
classes' functionality should be provided by ToolRunners based classes
encapsulating/"being" the current Analyzer*Runner classes.

However, the AnalyzerRunControl is only three (empty even) virtual
functions, but a big obstacle in merging attempt due to a lot of
mechanical followup changes in downstream users.

The current construction mechanism of analyzer run controls is actually
two different mechanisms (locally direct RunControlFactories, and a
"generic" createAnalyzerRunControl wrapper for remote cases). The generic
createAnalyzerRunControl makes it difficult to migrated them one-by-one,
due to the various downstream users.

So instead of merging the per-analyzer two uses directly reduce
the "indirection" distance by removing the AnalyzerRunControl
intermediate layer. After that the createAnalyzerRunControl mechanism
can be dissolved by using normal RunControlFactories also for
the remote cases. After that, porting to ToolRunner, and combining
with ther local equivalent can be done one by one.

Change-Id: I0ddace33fcce210cf3a547ac5bb23b3d85013934
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 13:47:53 +00:00
hjk
2360a2d743 ProjectExplorer: Run RunControl::{start,stop} always asynchronously
This introduces a mini-state-"machine" to handle RunControl states
Intialized->[Starting->Running->Stopping->Stopped->]*->Finished.

Needing time between trying to start and getting feedback is nowadays
the normal setup for all remote targets as well as for most local tools.
Making that the default for all runs simplifies the code and provides an
opportunity to (a) fix some currently wrong reports of "stopped
immediately" and (b) to remove target-specific (WinRT) or tool-specific
(Valgrind, GammaRay) state members doing essentially the same.

Change-Id: I7f52fee41144188ee8389e922fdc265f8c0a6459
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-24 13:37:46 +00:00
Ulf Hermann
ec28a4b0f3 QmlProfiler: Work around QProcess not emitting errorOccurred
When given an empty string as executable and some non-empty arguments
QProcess might emit error() but not errorOccurred(). This was fixed by
2f0ffba638bdb868a810bc0349c240b6b6e172cd in qtbase, but we cannot rely
on that being present, yet. Thus, avoid passing empty strings as
executable.

Change-Id: Ia1bb5ebceb6edeca1e54489d12b838f3cea8851e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-11 12:32:27 +00:00
Ulf Hermann
dd3fa30212 QmlProfiler: The local runner can spontaneously stop an application
If the application outputs the "QML debugging is disabled" line (and
Qt Creator can read it), the QmlProfilerRunControl will kill the
application. In the test this happens if Qt Creator was compiled
without QML debugging enabled.

Change-Id: I958a991d304ec9af8643e88dd9709f580a28753f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-26 08:41:01 +00:00
Ulf Hermann
8067297edf QmlProfiler: Ignore messages in local runner test
Depending on the build configuration of Qt and Qt Creator there can
be various kinds of messages and we cannot reliably determine their
number in advance.

Change-Id: I162cc02a72200026d3cbe7498fa705911f4cda39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-25 12:21:19 +00:00
Ulf Hermann
30eab176fd QmlProfiler: Output unexpected errors in LocalQmlProfiler test
We want to know why it's failing.

Change-Id: I794f183d8aae7f0f7c6444b432d9a2e80db16f22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-22 07:21:20 +00:00
Ulf Hermann
f7924a23b2 QmlProfiler: Fix LocalQmlProfilerRunner test for windows
Start the process with valid environment, connection, configuration,
and better suited arguments, and re-enable the test.

Change-Id: I4ff92ab60d46f3a96a1eb7c8414abf0fc56e8b26
Task-number: QTCREATORBUG-16436
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-07-05 08:08:15 +00:00
Christian Stenger
a5a6206e92 QmlProfiler: Disable a plugin unit test on Windows
This test does start QC with '-version' which results in a (blocking)
dialog on Windows.

Change-Id: I75fc84382bf7228f17febe4b852db01362b02537
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-14 08:48:47 +00:00
Ulf Hermann
98207ae020 QmlProfiler: Give test processes some more time to start and stop
Change-Id: I144ee2201feba2d635d1b8af4f6afac78aecdf3a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-10 08:55:11 +00:00
Ulf Hermann
16bf9227ba QmlProfiler: Add tests for LocalQmlProfilerRunner
Change-Id: I5d770adace7096f945e6385a62383282df3e5745
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-06 14:51:38 +00:00