Commit Graph

6441 Commits

Author SHA1 Message Date
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
hjk
6830328ecf Utils: Drop SynchronousProcessResponse
Move the remnaining two members into QtcProcessPrivate, its
only user.

Change-Id: I8e0c23e1a56b36b750b5b4bd4e88d762260e42a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 11:49:11 +00:00
Christian Kandeler
2182993b97 clangbackend: Add another exception to our "find real cursor" heuristic
Leave preprocessor directives alone.

Fixes: QTCREATORBUG-25692
Change-Id: I1c31f4120e9b86a58123f8877cebd354e800fb8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 11:44:49 +00:00
Christian Kandeler
3113b0e6d6 clangbackend: Fix token length calculation
This was broken for tokens with characters that take up more than one
byte.

Fixes: QTCREATORBUG-25715
Change-Id: Ic9842b960af8d6f12487f582b100cb2edcf48cc1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 08:35:32 +00:00
Christian Stenger
78e1260d05 Tests: Fix compile
Amends f18ac508e8.

Change-Id: If958606a06f0e86f9f8ff0a47a640566c885e018
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-12 08:01:50 +00:00
hjk
4c09a6e6b2 Debuggger: Compile fix after moving ProcessArgs class into filepair
The .pro files list dependencies explicitly.

Change-Id: Ie84202f6c34057bf87cc8f27fbb45f78f105e9a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 12:30:10 +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
hjk
d825805c39 Utils: Use std::function instead of signal SynchronousProcess callback
Simpler interface and use.

Change-Id: I8db448b7ccd12927b8f8fd347b0a92c3f76f7114
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-10 11:40:25 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Eike Ziller
040d0cc1ef Android: Fix AVD display if there are no AVDs
Fix that a broken dummy item was shown in the AVD Manager tab in the
Android options, if no AVD is available.

Fixes: QTCREATORBUG-19338
Change-Id: I31550812c332ff78d107d79682e064aa9eae1070
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-10 09:47:12 +00:00
Eike Ziller
c213b93aff Android: Make avd output parsing testable
And add some tests

Change-Id: Ife0e0c60f55251a1ac23215055ece8fb01478d59
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-10 09:47:04 +00:00
Eike Ziller
bf5b1d714c Revert "Revert "Merge remote-tracking branch 'origin/4.15'""
This reverts commit f0a86d4510.

Reverting a merge doesn't "undo" it - the changes would be lost
forever even with subsequent merges.
So we need to revert the revert to get the changes.

Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-05-07 09:07:40 +00:00
hjk
40e2bb2551 Tests: Port manual/process to QtcProcess
Change-Id: I50d489e47f61927745f63b37dae3e3567355414f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-07 08:23:15 +00:00
hjk
9995b82612 Utils: Remove SynchronousProcess::stopProcess
Handled by QtcProcess::stopProcess nowadays.

Change-Id: I5acf7db470f9b75989edc18e48c9a48e01b50868
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-07 08:19:23 +00:00
Marco Bubke
f0a86d4510 Revert "Merge remote-tracking branch 'origin/4.15'"
This reverts commit 888ca0dd20.

Reason for revert: wrong patchset

Change-Id: I1291789938601aaf606c59917ff938e3c24c78dd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-05-06 15:30:02 +00:00
Tim Jenssen
888ca0dd20 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/libs/sqlite/sqlitebasestatement.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp

Change-Id: I0fa0a8a7feffed24c0d2bc26eca86590f1156755
2021-05-06 13:07:48 +02:00
Christian Stenger
eafba223a5 QmlJS: Add test for recursive declared items
Tweak the test to allow multiple messages per line.

Task-number: QTCREATORBUG-24615
Change-Id: I662ab4801794dc3e49f68667f634337a847bc503
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-06 09:31:20 +00:00
Marco Bubke
1618937637 Sqlite: Use config.h instead of setting everything in the build files
Change-Id: Ia70a5e78475a8b8078276df03330060c8785bf90
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:49 +00:00
Marco Bubke
f8647ec428 Sqlite: Enable SQLITE_DEBUG for debug
Change-Id: I086dc07ae7672d1077f8469eccac5ce34d56c04d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:44 +00:00
Marco Bubke
81a36ac0ef Sqlite: Optimize the initialization
https: //www.sqlite.org/compile.html#omit_autoinit

Change-Id: Iaa91203be21f01a19235a9401cb4fa412eca8276
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:37 +00:00
Marco Bubke
8edbdd78ad Sqlite: Default column type to None
None has no type affinity. So it will not try to convert types to other
types like Numeric will do.

Change-Id: I5362a6d071459594619485b8b8a37b3f5ed12db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:18 +00:00
Eike Ziller
b3a893e9b8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
2021-05-05 11:46:19 +02:00
Christian Stenger
c362df32ee Unittest: Fix writing CppTools.json in cmake build
Do not write additional garbage into the json file as this
will end up in a parse error.

Change-Id: I02783b5e94b016d35962ee5729d53bc218d42b42
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-30 08:18:08 +00:00
Christian Stenger
402231c5d9 Tests: Fix build
Amends 509f40825a.

Change-Id: I4eaca8f1ad43ab8f3e5e92d313de334f42ed4905
Reviewed-by: hjk <hjk@qt.io>
2021-04-30 08:17:59 +00:00
Alessandro Portale
dba1468b35 ProjectExplorer: Fix tst_toolchaincache dependencies (CMake)
idevice.h(33): fatal error C1083: Cannot open include file:
'QAbstractSocket': No such file or directory

Change-Id: I4398c546af31e92c111d06f651270ef5c64a30bd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-29 07:58:50 +00:00
Marco Bubke
c4c3d4cc33 QmlDesigner: Remove findInSorted function
Using std::lower_bound is more generic and we have less code which
could lead to less bugs.

Change-Id: Iacf6ea550182b51a8d5dd6b18a92de68914f4df1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-27 10:26:03 +00:00
Marco Bubke
3862f67b8d QmlDesigner: Improve storage handling in StorageCache
Using an explicit class for the storage not even makes the code easier
to understand but enables the possibility of code optimizations too.

Change-Id: I9239919d3385ba1bf141c23bdc3013b6c1e624ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-27 10:25:58 +00:00
Christian Stenger
318b3f10ce Unittest: Fix build
Amends 8e352af0ec.

Change-Id: I8130996fa68d9a5fa4217a8db001745a0382f91b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-27 09:09:49 +00:00
Marco Bubke
c236a25339 QmlDesigner: Add storage cache
Task-number: QDS-4237
Change-Id: I7d587f615b5e26cc6014ea3a63dedd203fdd35eb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-26 14:52:24 +00:00
Eike Ziller
2fe1e881ac Merge remote-tracking branch 'origin/4.15'
Change-Id: I44dad4bbe9ed955d35c713485720a3f36a21874d
2021-04-26 11:59:13 +02:00
Marco Bubke
f69314b6ae Sqlite: Add range getter
Sometimes it is handy to return a range so you can break in a for range
loop. So you can now write:

for (auto [key, value] :
    statement.range<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

for (auto [key, value] :
    statement.rangeWithTransaction<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

It will only step over the statement to the break. So you don't fetch
not used values anymore. The second version will add a transaction
around the range.

But be careful. The range is view to the statement. Holding it longer or
reusing it can lead to strange behavior because the state of the
statement is changing.

Change-Id: I90191f7da5a015c7d8077d5bc428655a2b53246c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:42:40 +00:00
Marco Bubke
44b4c461ff Sqlite: Fix sqlite
Missed to remove the not anymore used ResultTypeCount.

Change-Id: Ia150e945bd650cc1e3d19fcb9426621d93fa16c3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:06:50 +00:00
Robert Löhning
8d813b8864 Squish: Remember where breakpoints are
So we don't have to update the test each time
Creator changes the project templates.

Change-Id: I76f96f719895f2f8cadccaf9c91cc85d1735ce13
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-23 09:45:06 +00:00
Robert Löhning
aaa5b93b2e Squish: Simplify API of doSimpleDebugging()
No need to pass a value which never differed from len(...)

Change-Id: Iea481abed0ebfa9acf05456bc2ff1f01c7bc0d1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-21 17:27:31 +00:00