Commit Graph

6274 Commits

Author SHA1 Message Date
Cristian Adam
aef432ec13 CMake: Add BUILD_TESTS CMake variable to filter tests to build
This allows building one test: -DBUILD_TESTS=tst_my_test, this will set
BUILD_TESTS_BY_DEFAULT to OFF (default value is ON) and set
BUILD_TEST_TST_MY_TEST to ON.

Change-Id: I7800f3d238121725bb9fa4146f76ddcd2b10bde9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-11 13:40:24 +00:00
Eike Ziller
dcfc467959 Revert "CMakePM: Filter test also by BUILD_EXECUTABLES list"
This reverts commit 99396421de.

The patch does not solve the use case (building Qt Creator without
tests and then only building individual tests), and has lots of
side effects like tests landing in the application bundle on macOS
and in bin on Windows, and tests being installed.

Change-Id: I593627b55577e13a3d2cf1758deac99efa521954
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-11 11:49:08 +00:00
Cristian Adam
99396421de CMakePM: Filter test also by BUILD_EXECUTABLES list
This way one can build only one test.

Change-Id: Iebf9686108988793193106ebed312f7e86ee2e61
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-10 16:47:44 +00:00
hjk
a80546593d Docker: Add another example Dockerfile for a run environment
Without build tools, for demonstration purposes.

Change-Id: I5940770aa0a5eb83d618ebdeb12436b38d3b21fa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-10 09:25:35 +00:00
Alessandro Portale
43c5944571 Tracing/QmlProfiler/CtfVisualizer/PerfProfiler: Compile with Qt 6
This makes the tracing lib, its tests and the three plugins which depend
on the lib compile with Qt 6.

The rectangles are not yet shown most likely because some OpenGL
specific code was #ifdef-ed for Qt 6. That code needs to be
reimplemented on top of the new Scenegraph API, using the RHI instead of
direct OpenGL in a follow-up patch.
An assertion failure in QQuickWidget::createFramebufferObject() needs to
be fixed as-well.

The code still builds and runs assertion free (and the autotests pass)
when built against Qt 5.

Task-number: QTCREATORBUG-20575
Change-Id: I47ebb477823de2f0d27329dac7c292a466cea1d7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-09 15:30:21 +00:00
David Schulz
0cfe27a53d Debugger: filepathify DiagnosticLocation
Change-Id: Ibbbf137231b313ec10e3d57c0230217b0c1e0a6c
Reviewed-by: hjk <hjk@qt.io>
2021-06-09 06:57:42 +00:00
Alessandro Portale
27f8e2dbce Utils: Fix splitting in ChannelBuffer::takeFirstLine()
Escape the '\r'

Change-Id: I8cee40dc4a65f893f1a11c7cf066777498c37339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-09 06:40:11 +00:00
Marco Bubke
d3a91cd3a7 QmlDesigner: Use import in exported types
We can remove the version from exported types because the are
implicit by the import.

Task-number: QDS-4458
Change-Id: I4a259dff5e59537b72a57d7df95256a38d036e7b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:28 +00:00
Marco Bubke
f32207c930 QmlDesigner: Add importId to types
If we now try to synchrize to an inconsistent type model we get an
exception.

Task-number: QDS-4458
Change-Id: I86f7ce90d14b18227a66314fb341f5b528bdfb95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:23 +00:00
Marco Bubke
fc0668882d QmlDesigner: Add Import Synchronization
Task-number: QDS-4460
Change-Id: Icd419baa7881fe882539f10d335ab6b3d36bc7b5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:19 +00:00
Marco Bubke
029aecef1e QmlDesigner: Synchronize type
A type should not removed but all it's fields should be reseted. This
has the advantage that if you remove a file and add it again later the
id is stable.

Change-Id: I3a1f51e14195cff2fc39681acdf7072d1a2e4616
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:09 +00:00
David Schulz
79b9a2fea6 TextEditor: filepathify RefactoringChanges
Change-Id: Ie97e484bcdeaa0cb2f5d04b3c79ace55ff2e426c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 11:40:10 +00:00
Alessandro Portale
b730aa6405 Tracing/QmlProfiler/Perfprofiler: Merge modules
Move Tracing Qml Types into the "QtCreator.Tracing" module.
Move QmlProfiler Qml Types into the "QtCreator.QmlProfiler" module.
Move PerfProfiler Qml Types into the "QtCreator.PerfProfiler" module.
And tst_flamegraphview ones into QtCreator.TstTracingFlameGraphView.

... in preparation to register the types declaratively.

Change-Id: Ic0e3863d09b3426fa5b7419116625ad49b817dcf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-08 06:46:28 +00:00
David Schulz
4e69b5068a LSP: Fix Range::overlaps
Change-Id: I14e6477b25a4c9a25c3832a4bc580728bb85c448
Reviewed-by: <sergeikrivonos@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-08 04:42:27 +00:00
Christian Kandeler
a5ba33cbeb CppEditor: Add second "Find References" Action
This one includes access type categorization, while the "normal" one
does not.
We need this now, because with clangd, the categorization is too slow to
enable it by default.

Change-Id: I2eb4608630d34452ae28f0836befd5d9053f42bf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 08:28:49 +00:00
Alessandro Portale
8a5b917d8f tst_qtcprocess: Add check for QtcProcess::FinishedWithSuccess
Change-Id: Ic13368459e23b199bc203076d04da43407090c36
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-04 11:32:35 +00:00
hjk
170ec9eca5 Docker: Add ninja to test image
Change-Id: I76f7da62922c3dc228a580e6b5e6429702a4e7c3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-03 08:09:48 +00:00
Marco Bubke
da267946d9 QmlDesigner: Sync project storage
Task-number: QDS-4423
Change-Id: Ia99df711effff2909b0a57ecebfb386ca51165f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:19 +00:00
Marco Bubke
8603eb5ba9 Utils: Remove std::initializer_list contructor
If you write

Utils::SmallStringView view;
Utils::SmallString text{view};

it selects the std::initializer_list contructor. Not the didicated
constructore. It is much to easy to get it wrong so it is better
to make it explicit.

Change-Id: I4240eaf1f39cf71d37df4480fea1ecfa3ea83cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:11 +00:00
Marco Bubke
7b330d3496 Sqlite: Add insertUpdateRemove
An generic approach to merge values into a database. It is comparing
two ranges. The first range is the Sqlite select range and the second
one which are the new values. New values are inserted, change are
updated and missing values are removed. Unchanged values are not
touched. The compare function is comparing a key. Both ranges are
binary ordered.

Change-Id: I973c83677ea74f8fa62bd7ab8a73ed560c806562
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:02 +00:00
Marco Bubke
b2cd0c32a5 Sqlite: Open Sqlite by default in exclusive locking mode
There are no extra files for the WAL in the excusive locking mode and
it can be even faster because the logging is happening on the heap.

Change-Id: I59d75dd2aa95d802ba67c8534a5cd8ab32a343df
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:20 +00:00
Marco Bubke
494469641a QmlDesigner: Move source cache types to their own header
The namespace is now Cache for that types.

Task-number: QDS-4306
Change-Id: I479f1ca534455a41de9dc1d6a1fd891e1d8973eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:59 +00:00
Marco Bubke
b3bed53c4f QmlDesigner: Add SourcePathCache
Task-number: QDS-4306
Change-Id: I5adbf3893cb198c52c1fd433f599d21317c6881c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:08 +00:00
Marco Bubke
f7d09630b7 QmlDesigner: Add sqlite function unqualifiedTypeName
Task-number: QDS-4305
Change-Id: Ic9f16c6d5e9af8a3a6ffaff817c3b82af0fc8d61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:36:35 +00:00
Marco Bubke
019d948552 QmlDesigner: Move project storage to projectstorage subdirectory
We save their not meta info related data. So it is better we move it
their own subdirectory.

Task-number: QDS-4304
Change-Id: Ib99419e992fced93fb245a8c48e02ee256823def
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:32:12 +00:00
Marco Bubke
e4fea9f159 QmlDesigner: Add project storage
Task-number: QDS-4252
Change-Id: Ic74e027b20bc41f3712e3ae155cddc64f8972cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:16:48 +00:00
Marco Bubke
ef4f2a4dcf Sqlite: Add unoptional value fetcher
There is now value, valueWithTransaction, optionalValue and
optionalValueWithTransaction. Sometimes you want to return
the default constructed value as default. So this is now possible.
This simplifies some code but can be even more optimal.

Change-Id: Ibbb6b5ca47803344ed646bfa257602b6db52e0fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:10:09 +00:00
Marco Bubke
c78d1c171f Sqlite: Add *WithTransaction fetcher
There are many simply fetch functions which can now be simplified.

Change-Id: Ibf542ee8b07a1b06ea3dae695da1f69065e9dd71
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-31 16:07:30 +00:00
Marco Bubke
5fda083436 Sqlite: Add exception if statement is called outside of a lock
Sometimes it is really hard to trace if sqlite statement is called
outside of a database connection lock. So we know throw an exception
in the unit test. So we get failing tests.

Change-Id: I71485b9473075751a2fb771ce7e2954e28d8413e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:07:14 +00:00
Eike Ziller
2485c31a48 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc

Change-Id: I906330addb7de31e6ed88f88af3fd2adbbe53e1f
2021-05-31 16:13:47 +02:00
hjk
90e9de5d5d Tests: Move auto/qtcprocess to auto/utils/qtcprocess
Change-Id: Ied95a0f0109ed96703b96c9e79d268d509eda211
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-31 13:17:03 +00:00
Christian Stenger
73c2a98b39 Utils: Make Link a class
Change-Id: Ia2f1c9589f65064eca2416b093b3fecf568058d2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-31 06:45:03 +00:00
Eike Ziller
07b0aa89f5 CMake build: Improve default qmake for dumper tests
We can do better than just "qmake" and instead take the path to
the qmake that the test was compiled with.
(Can still be overridden with environment variables.)

Change-Id: Icc045d4f96946aeb1f324e6f1334dc9747215f3f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-05-28 16:17:59 +00:00
Eike Ziller
0f64c88510 CMake build: Fix running tst_sdktool from different directory
It would only run exactly from the Qt Creator build directory.

Change-Id: Ifd105bdaab7405f93b6fb6084a85014fc4023b2f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-05-28 12:15:47 +00:00
Alessandro Portale
8cb4ab733a Utils: Add auto test for SynchronousProcess::runBlocking
QTCREATORBUG-25667 appeared a few Months back in corellation to a
seemingly unrelated change, and I was much later scratching my head a
day or two.

Therefore, it should be fine to have a test for the usage of
SynchronousProcess::runBlocking with interactive cli processes. Those
cli processes might output lines without terminating \n or \r and thus
hang until timeout.

We are IMHO lacking process IO tests, anyways.

Task-number: QTCREATORBUG-25667
Change-Id: I3b7ea471b2ac9fa4554f0ce51752ce54c4a7d304
Reviewed-by: hjk <hjk@qt.io>
2021-05-28 10:55:57 +00:00
Alessandro Portale
642318c325 Utils: Add an auto test for QtcProcess::exitCode()
Exit code handling can break during refactorings. This addition to
tst_QtcProcess tests negative, zero and positive exit codes of sub
prcesses that are launched asynchronously and synchronously.

Change-Id: Icbcc036d3fda7fa681958b57fd0a6f67d3a90352
Reviewed-by: hjk <hjk@qt.io>
2021-05-28 10:55:48 +00:00
hjk
e5b3ebecea Docker: Add a DockerFile for a test image for manual testing
Change-Id: Ic030ff3a78f20009c0f031afd315caf26bc1b154
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-28 08:51:07 +00:00
David Schulz
fc53dc27e4 Move filename line split into Utils::Link
Since we already have a container for file path, line and column move
the parse function there.

Change-Id: I5d0d97d271c5aaeb618e1a303b02cc6514e94e81
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-25 17:32:45 +00:00
David Schulz
356bfcc9fd Utils: filepathify Link
Change-Id: Ie62500bde139158e776f9698ee0ea00c2a113f93
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 17:32:18 +00:00
Eike Ziller
dbd4a10d6f Merge remote-tracking branch 'origin/4.15'
Change-Id: I3d3dfa04124eed14952294c2847b9851dcb1a5fd
2021-05-25 16:26:54 +02:00
Christian Stenger
0980ef7e49 Tests: Adapt test after changing diagnostics
Blocks are no more considered bad per se. Only if they
contain a var statement they are considered as bad and
worth a warning.
Amends 2447d1d69c.

Change-Id: I93b5e43c01059b66f3fb287772e54f3ae3e157af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-25 13:47:52 +00:00
Christian Stenger
c6213df1c6 Unittest: Fix source location after merge
Change-Id: I671f6d8edd3d2989b0b1d1af86e2a3abac9a6c48
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-21 17:41:48 +00:00
Alessandro Portale
aabb6d3539 Tracing: Add a manual test
A minimal application that displays the tracing view with some dummy
data.

Change-Id: Ie564a3be017731313659aef7958138613b0bb94d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-21 07:00:49 +00:00
Jarek Kobus
76d8483d16 Add a test for parsing properly [Thread ...] data
This test is based on real data processed during debugging.

Task-number: QTCREATORBUG-25745
Change-Id: Ia400367e37b799a93f66fc07c5532c6b90b08be6
Reviewed-by: hjk <hjk@qt.io>
2021-05-20 12:59:34 +00:00
Alessandro Portale
356eaf1d3f Manual widget tests: Expose setTheme function
...so that it can directly be called if showing the combobox is not wanted.

Change-Id: Id80658336421788749f1a1ec68680fef53ae1695
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-20 09:10:06 +00:00
hjk
a71bb36682 Utils: Centralize FilePath case sensitivity handling
This could or possibly should the target device's file name case
sensitivity into account by diverting to IDevice. However, as this is
expensive and we are in time-critical path here, we go with "good
enough" for now.

The first approximation is "Anything unusual is not case sensitive"
which is better than "Any device equals the host".

Change-Id: Ib3d4a627abebd96a7285a855af66e0c800767767
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-19 13:02:05 +00:00
hjk
2db9ebc615 Utils: Rework FilePath guts
This replaces FilePath::m_url by explicit host and scheme members

This removes the unclear duplication of information in m_data and
m_url.path() and avoids syntactic restrictions a real url has on
scheme and host and complex (and potentially lossy) url parsing:

    QUrl url;
    url.setHost("1234");
    assert(url.host() == "0.0.4.210")

The toString/fromString methods now accept strings of the form
scheme://host/path, mimicing the use of urls so far.

Relative remote paths are representable, their toString() output
looks like scheme://./host/path and can be parsed back by fromString().

Change-Id: Id3b52c270b228e23834faa3f44daad8b1718b654
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-19 11:41:42 +00:00
Eike Ziller
f83be6debe Merge remote-tracking branch 'origin/4.15'
Change-Id: Ia6558fc2423fd9cd84ca2282bfa60d102dff682e
2021-05-19 09:54:07 +02:00
Christian Kandeler
124b7ad911 Unit test: Fix build
Amends a13aef759e.

Change-Id: I07fbb52b741a765fc9aa92f4f4752890b581ed35
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-18 15:01:42 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00