Commit Graph

36 Commits

Author SHA1 Message Date
Jarek Kobus
6c5f39c5d2 Valgrind: Rename valgrindrunner.{cpp,h} -> valgrindprocess.{cpp.h}
Change-Id: I17f8e55ee97567b98f2260d1a79413bd26d02314
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 08:26:36 +00:00
Jarek Kobus
1d5102781d Valgrind: Rename ValgrindRunner -> ValgrindProcess
Change-Id: I5e7d704c749e53672915c5f7aab64abb68353f24
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 08:11:28 +00:00
Jarek Kobus
121d73b30f Utils: Rename ProjectExplorer::Runnable into Utils::ProcessRunData
Move it into Utils lib.

Change-Id: I3b6c16d18439cabddf59afc03116f13c1970102c
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 07:44:34 +00:00
Jarek Kobus
b1304de6cf ValgrindRunner: Employ task tree internally
Change-Id: I32f674d7ea93e5825eba0912c98cc0280802c483
Reviewed-by: hjk <hjk@qt.io>
2023-08-16 16:21:40 +00:00
Jarek Kobus
5bce234986 Valgrind: Refactor Parser
Make it implicitly threaded.

Get rid of ThreadedParser.

Don't move QTcpSocket instances, received by
QTcpServer::nextPendingConnection(), into another thread,
as docs says it's not safe.

Use wait condition for waiting for new data.

Don't potentially leak the Parser in loadXmlLogFile():
store a unique pointer to the running parser.

Introduce Parser::setData() method and use it with
QFile device in loadXmlLogFile().

Pass QAbstractSocket into the parser instead of
QIODevice and get rid of downcasting. The QIODevice
couldn't really work with non-socket and non-file devices
(like e.g. QProcess), as it lacks general error and finished
reporting signals (it has only general readyRead() signal).

Change-Id: I9352aec694564d4d2a26898841ed964bed470d82
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-14 14:42:16 +00:00
Jarek Kobus
bce2dde117 Valgrind test: Use Utils::Process instead of QProcess
Change-Id: Id7a0611fd7d36adc22993f50cce87cd30c6a336c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-10 08:19:33 +00:00
Jarek Kobus
7630801293 Valgrind: Make Parser's API similar to the ThreadedParser's API
Change-Id: I39634c881dac44fc857a4aa2049e9c2618daec9b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-09 13:54:33 +00:00
Jarek Kobus
94f4c21740 ValgrindMemcheckParserTest: Fix const correctness
Simplify list c'tors.

Change-Id: Ib2534acfda1e0b24d8cfd10c7f48b585c881929a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-08 09:23:32 +00:00
Jarek Kobus
fbf9325395 ValgrindPlugin: Use QList instead of QVector
Change-Id: Ib1bd223b73d1f7399008f91a3c26ff515ab03a0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-08 09:23:25 +00:00
Jarek Kobus
00a34e60fc Valgrind test: Hide Recorder and Dumper in cpp file
Inline Recorder's and Dumper's slots.
Clean some namespace specifiers.

Change-Id: I1111e8fb3c912dc1f253ebb2ed7f8e9c3fff67e0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-08 09:23:15 +00:00
Jarek Kobus
545dbc5743 Valgrind: Use QMetaEnum for parsing enum values
Change-Id: I43685e3fde662a57b6966d5f5f29d4138158b4d8
Reviewed-by: hjk <hjk@qt.io>
2023-07-25 15:00:43 +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
866a658b42 Get rid of unneeded includes of RunControl
Removed also some other includes that were marked
with yellow triangles. In some cases includes of
runcontrol.h were substituted with other includes,
like qtcassert.h.

Change-Id: Ica40f68198c7f8f70e6047acb2eddc8ef017e43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-25 09:49:13 +00:00
Jarek Kobus
738803a4da Various plugins: Limit the usage of qMakePair
Change-Id: I9113dd47fb4f9026f3a732aebbd0aee31651b727
Reviewed-by: hjk <hjk@qt.io>
2022-09-30 10:17:47 +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
d783b4d5ff ValgrindRunner: Remove ValgrindRunner::setDevice
The device can now be determined from the debuggee's file path.

Change-Id: I2b24d6e325f74826a644d02a9e418576c4e9b436
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-20 08:08:25 +00:00
Christian Stenger
00df4c6675 Valgrind: Remove expect to fail of a test
This seems to be fixed meanwhile.

Change-Id: Ia2868fb6d8f1fd1bd3510965c57407e1cd62067a
Reviewed-by: hjk <hjk@qt.io>
2022-04-05 12:46:33 +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
Alessandro Portale
570f72b8f9 ProjectExplorer: Document source of test data for testAbiOfBinary_data
Change-Id: I2e9b59d5ac99de0bbb9cf1f64210439e41f403af
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-23 12:02:36 +00:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
b0e52f7ff6 Valgrind: Move to Utils::FilePath in some places
Change-Id: I54d03ccda62121055509fd24c5c98a13f7605964
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 14:25:37 +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
Christian Stenger
482fd5f0fd Valgrind: Use external test data if available
External data files will be tried to search inside a path
that is specified by the environment variable
QTC_TEST_EXTRADATALOCATION and need to be present inside a
subdirectory called 'valgrind'.

Change-Id: I8f192b2862e4c269ed17b7a81000eb3dabfc2efb
Reviewed-by: hjk <hjk@qt.io>
2019-05-10 05:47:09 +00:00
Alessandro Portale
00ec6dfb5d Valgrind: Modernize
modernize-*

Change-Id: I6db60dce78cf2575e36caa597b1f095adba34fd9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-10 18:54:02 +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
Christian Stenger
54d6e3ad7b Valgrind: Fix unit test
Change-Id: I270aaf2fd2b74a6d1ec067555a9f65ecbab2ffad
Reviewed-by: hjk <hjk@qt.io>
2018-05-09 07:13:34 +00:00
Christian Stenger
ccef9c0294 Valgrind: Fix plugin unit tests
The original tests were written for an older version of valgrind.
Additionally mark startup checks as expected to fail as the error
codes are not processed at the moment.

Change-Id: Iaad272b5977da3a3395064270d2c9442a3e2f313
Reviewed-by: hjk <hjk@qt.io>
2017-07-04 10:55:46 +00:00
hjk
fc8dee4675 Valgrind: Make the (threaded) parser a proper member of the runner
Simplifies user code, and it was only ever used in a 1:1 relation,
even in the tests.

Change-Id: I3ce4fc83a361aceb730c05420efdb4ea52d37cda
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-23 11:30:32 +00:00
hjk
88fd4043d8 Valgrind: Merge MemCheckRunner and ValgrindRunner base
It's mostly the xml/log handling, which can be re-used in other tools.

The change is purely mechanical, including some style fixes and
some modernization.

Change-Id: I6b44ae71451e8d3e26df40b9af9b4ec70038a92d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-23 09:41:28 +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
Thomas Hartmann
eaedebb7f1 Fix linkage on msvc2015
This does not link without this explicit compare
function after the QLatin1Strings have been removed.

Change-Id: I09cd323f850954eedefed6ee58597cb0ef3ab026
Reviewed-by: hjk <hjk@qt.io>
2017-02-09 15:18:48 +00:00
Christian Stenger
fe16f0b38e Valgrind: Modernize code
* QLatin1String
* initializer list

Change-Id: I6654fcd8b8ec513d1802a4ba3fe3f5833a29136b
Reviewed-by: hjk <hjk@qt.io>
2017-02-09 13:55:00 +00:00
Christian Stenger
e1d339b72c Valgrind: Fix Qbs build
Change-Id: I67e0b3baa68589eec58d407e6886f51866cfa275
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-19 12:30:07 +00:00
Christian Stenger
62118e9d78 Valgrind: Move some memcheck auto tests into plugin
Due to changed dependencies it is nowadays necessary to have more
of the plugin infrastructure at hand. Moving memcheck related tests
to be able to execute them as QC plugin unit test.

Change-Id: Iab492b3cb87728425b950ca9387edf292d895350
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 10:04:56 +00:00