summaryrefslogtreecommitdiff
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Utils: replace LineColumn with Text::PositionDavid Schulz2023-05-112-7/+0
| | | | | | | Change-Id: Ia69547374efec7412717cbed1eb4162162a89d39 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* FileSearch: Get rid of FileSearchResultJarek Kobus2023-05-093-28/+0
| | | | | | | | | Use SearchResultItem instead. This change should reduce the remaining freeze described in a9eb732ce6763e22badd92fc8523cebe84b09a84 even more. Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Move SearchResultItem/Color into UtilsJarek Kobus2023-05-081-2/+2
| | | | | | | | | It's going to be reused inside FileSearch. Change-Id: I8993d7158ff31c311c2283d32bc43465a8946a52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix compiler warningsEike Ziller2023-05-022-2/+2
| | | | | | | | Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Merge remote-tracking branch 'origin/qds/dev'Tim Jenssen2023-03-3025-767/+2026
|\ | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/filepath.cpp src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp tests/unit/unittest/CMakeLists.txt Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
| * Merge remote-tracking branch 'origin/10.0' into qds/devTim Jenßen2023-03-26118-120/+119
| |\ | | | | | | | | | | | | | | | | | | | | | bigger conflicts resolved at: src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
| * | QmlDesigner: Project Storage Watcher updates only some directoriesMarco Bubke2023-03-211-8/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates only the entries for the given source context (directory) ids and skips everything else. It is enabling partial updates for directories in a project. [&, &ids = ids] the strange capture clause steams from a C++ issue. Tak-number: QDS-9456 Change-Id: Id3abcd39ac429ba4483124f334d50c2999f5e6a8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
| * | UnitTests: Simplify project storage watcherMarco Bubke2023-03-211-129/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the real path cache. It makes the test some 100ms slower because the database has to be created for every test but makes the test simpler. Renames some variables too for better readability. Task-number: QDS-9456 Change-Id: I3246a1859eae7b26b9e13a9d88d3c717748de43e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
| * | QmlDesigner: Project storage watcher watches unchanged filesMarco Bubke2023-03-211-10/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qml documents and Qmltypes files cannot added or removed if the project data is parsed. So the can simply been added to the watched files. Task-number: QDS-9178 Change-Id: Iaa30425241ac7ad3c2434b9c6c5955e894ec6049 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
| * | Sqlite: Improve database openingMarco Bubke2023-03-151-7/+18
| | | | | | | | | | | | | | | | | | Change-Id: I9074cda4d9da12a061f094ca72fa156d89ca0f87 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | QmlDesigner: Improve readabilty of tests for project storage updaterMarco Bubke2023-03-151-291/+181
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QDS-9382 Change-Id: I9aac10b7e7782847bae23b09e64fbe569ce2c40a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
| * | QmlDesigner: Update directories without qmldir to project storageMarco Bubke2023-03-091-42/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are qml directories without a qmldir. To identify them we use the directory source id instead of the qmldir source id. Task-number: QDS-9345 Change-Id: I1356ad332c091b64cbdad389a3ac505133716634 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
| * | QmlDesigner: Use directory source id for project dataMarco Bubke2023-03-091-120/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are qml directories without a qmldir. To identify them we use the directory source id instead of the qmldir source id. Task-number: QDS-9345 Change-Id: I4ed4596a21576e6bbd18c5117753669ef8a68a28 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * | QmlDsigner: Add entries to path watcher for initial runMarco Bubke2023-03-092-18/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | If there are no cached data all importatnt files should be now being watched. Task-number: QDS-9178 Change-Id: I0c9093e41e6a2d4f3a5aa3d62aba1fd41e047da4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
| * | QmlDesigner: Add image for broken previewMarco Bubke2023-02-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QDS-9048 Change-Id: Ic2ce8bf4d51f72c3ddae588709820728fc7c76b5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
| * | QmlDesigner: Fix test for project updaterMarco Bubke2023-02-281-39/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests got broken by the directory support. Change-Id: I2a0de46a7f7f84328440ee785329d915049cb7f3 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
| * | QmlDesigner: Don't inline what methodMarco Bubke2023-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works around the type_info::hash_code macOS bug and leads to smaller code size because the RTTI will be not anymore injected in all TUs. Task-number: QDS-9266 Change-Id: I3defe3dc11b4b76f5c60b08c103a3a39ee92f367 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | Sqlite: Inject RTTI into TUMarco Bubke2023-02-281-22/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had problems on macOS with the catching of exceptions because the has type_info::hash_code was different. This is probably a bug because RTTI code is injected for an inline class. To work around that problem we implemented the virtual what method for every exception. Task-number: QDS-9266 Change-Id: I79052c8b70adead412d1940b17195151fb19ebb9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
| * | UnitTests: Make test fore robustMarco Bubke2023-02-231-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I6e92f242f759a89a11c77d862b5158c86b2b7a5a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
| * | UnitTests: Disable warning for self assign overloadedMarco Bubke2023-02-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | We want to test it so we cannot fix the code. Change-Id: Ieb0517e539ae60c275069b790ca32380d39a59f0 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | UnitTests: Disable self move warningsMarco Bubke2023-02-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | We want to test self move, so we cannot avoid the warning. Change-Id: Id785690d40cfc5299e65c9f0e69abe6e336ba9ff Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | Sqlite: Add pathExists functionMarco Bubke2023-02-222-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'pathExists' function can be registered to the database connection and is then callable in Sql. Task-number: QDS-9217 Change-Id: I21afc5cd38765854daa0b1058cc5e8946b551924 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
| * | Sqlite: Add progress handlerMarco Bubke2023-02-221-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sqlite::ProgressHandler handler{ [] { return Sqlite::Progress::Continue; }, 1000, database}; is setting up a progress handler for this scope. If the handler is destructed it will automatically reset the handler on the database. The handler is active for the whole database connection. Task-number: QDS-9216 Change-Id: I59831f40d32c062eefdfb0c4dfbf3045058e1fd2 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
| * | UnitTests: Disable warnings as errorsVikas Pachdha2023-02-211-1/+1
| | | | | | | | | | | | | | | Change-Id: Ib58799510258973638f25ec4d52ce62710c26f54 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * | QmlDesigner: Integrate ProjectStoragePathWatcherMarco Bubke2023-02-202-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QDS-9170 Change-Id: Iedbb07e41232beeb73cd12c89f892eec7968d084 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * | UnitTests: Fail on warningsMarco Bubke2023-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QDS-9135 Change-Id: I798b1143c68e68bcd53144f5e6d01864ae0ce73b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | Googletests: Bump to 1.13Marco Bubke2023-02-201-0/+0
| | | | | | | | | | | | | | | | | | Change-Id: I8b54611e404e5313269fc3436ce995bf0d09d35d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | QmlDesigner: Add extension support in qmltypesparserMarco Bubke2023-02-161-3/+49
| | | | | | | | | | | | | | | | | | Task-number: QDS-7384 Change-Id: I3f84f361360bd085d0ee78f32d808151e32a2436 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | QmlDesigner: Use Qt6_VERSION instead of Qt5_VERSIONMarco Bubke2023-02-081-2/+2
| | | | | | | | | | | | | | | Change-Id: I346f5d256468696076299f964022c0a2ec2d190d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
| * | QmlDesigner: Add direct dependency on QmlDomPrivateMarco Bubke2023-02-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | It adds an indirect dipendency to QmlCompilerPrivate too. We stick to Qt 6.5 because the private API changed. Task-number: QDS-9049 Change-Id: Icb0b406fc47759763384e167c0cabbffc1c9e186 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | QmlDesigner: Fix missing adaptionMarco Bubke2023-02-072-93/+111
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I307c9f236ee8ebd36d62b3fe9b0d4bbaea5699e8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * | QmlDesigner: Add midSize image to cacheMarco Bubke2023-01-2612-112/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is now a mid size image in the image cache. It's logical size is 150x150, so it is 300x300 for HighDPI. Task-number: QDS-8918 Change-Id: I6586b2e82b9e74737f46b67c441201ad4964fca0 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * | QmlDesigner: Don't abort if any image is not nullMarco Bubke2023-01-251-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we expected that both images are null or not null. But sometimes you only want to save one image type in the collector. This will try to generate the image cache entry again if you try to get a null image so be careful. Task-number: QDS-8917 Change-Id: I765f5b82589f52e439513a11926314ad2d99a928 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | | Unittest: Drop unneeded dependencies to coreplugin filesJarek Kobus2023-02-231-9/+0
| | | | | | | | | | | | | | | | | | | | | Amends baa83725f640419bc2c17cd28b91e1604255a3dc Change-Id: I82b472585dc30b0466eace15897f5d96fc7e9fd9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | Build: Remove FindQt5.cmakeEike Ziller2023-02-232-2/+2
| |/ |/| | | | | | | | | | | | | | | | | | | No longer needed, since we generally only support building with Qt 6 nowadays, and the parts that still do support building with Qt 5 handle that manually. Change-Id: I72381589ca3ab7bf1af88d9f185cad7f0cdf149c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* | CMake build: Remove usages of Qt5_VERSIONEike Ziller2023-01-241-1/+0
| | | | | | | | | | | | | | | | | | | | and remove checks for Qt < 6.2, since that is our minimum version. Except for sdktool and qml2puppet. Change-Id: Id36cd1a15a5a6e5480e4ae5d0a8ffaea4b2a1864 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Remove GPL-3.0+ from license identifiersKai Köhne2023-01-06116-116/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | CMake build: Use version-less Qt targetsEike Ziller2023-01-052-3/+3
|/ | | | | | | | | Since we do not support Qt < 5.15 anymore, and as a first step for getting rid of our special FindQt5.cmake. Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QmlDesigner: Fix build for testsThomas Hartmann2022-11-281-0/+1
| | | | | | | Updating the NodeMetaInfo mock. Change-Id: Ia3a87095413bb58430d978bb831ed8b808596093 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* QmlDesigner: Hide or disable material browser and editor if no libraryMiikka Heikkinen2022-11-221-0/+1
| | | | | | | | | If material library is missing, material browser and editor UI should be disabled, except for material editor main pane in case of root material node. Change-Id: I3d2bd545de0649fb90d3fe1f751d46b7c7054bbf Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: QmlPuppet as standalone toolMarco Bubke2022-11-091-3/+3
| | | | | | | | | | | | | The qmlpuppet is now a standalone tool. There is new a library too with the communication code. That is shared between the designer and the puppet. It's in a .cmake file so it can be included by the standalone tool if it is not part of a designer build. Task-number: QDS-5879 Change-Id: I2bc2a0b463fbb3e0c8c23d182abfd368cf87e968 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QmlDesigner: Handles directories in Project storage updaterMarco Bubke2022-11-033-259/+445
| | | | | | | | | | | | | All directories are searched for qml files and they are added to the meta data. If the directory is changed the qmldir is always parsed even if it was not changed. We can optimize that later but I think there is no big advantage fot this optimization. Task-number: QDS-5297 Change-Id: Ibe3102520bc18ac474380aad306486d8e25bc5db Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QmlDesigner: Detach views outside of model destructorMarco Bubke2022-10-271-2/+2
| | | | | | | | | | | | modelAboutToBeDetached can still calling the model. So calling the function from inside the model destructor is a little bit undefined. To get around it we add a custom delete which call the detachAllViews() before it deletes the model. Change-Id: I38ff8283f4e1ac48b256aeb9fd5bb9f3fb6bfed1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Merge remote-tracking branch 'origin/9.0'Orgad Shaneh2022-10-112-155/+3
|\ | | | | | | Change-Id: I2e11bfba622c14578f08ca988ad98dab97cb385b
| * qbs build: Do not build QmlDesigner & friendsChristian Kandeler2022-10-102-155/+3
| | | | | | | | | | | | | | Too much maintenance effort for not enough gain. Change-Id: Ica385bcc93da0dbc7af8e15c07fdd33580de29a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | QmlDesigner: Merge cmake filesMarco Bubke2022-10-075-3/+13
|/ | | | | | | | | | | | To improve testability external dependencies are now broken with an interface. It is a first step to test individual units without injection of source files. Task-number: QDS-7571 Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Add sourceContextAndSourceId to SourcePathCacheMarco Bubke2022-09-261-0/+84
| | | | | | Change-Id: I4f5eb784e80d3afc10aa007f3be1604f6e18e312 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Remove Utils::optionalEike Ziller2022-09-015-22/+22
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* QmlDesigner: Refactor isSubClassMarco Bubke2022-08-262-9/+17
| | | | | | | | | | | | | | IsSubClass is renamed to isBasedOn and takes now NodeMetaInfo as a parameter. But for most cases there are is... functions as short cut. The model is providing shortcut NodeMetaInfos too. This is done in the sake of caching. Task-number: QDS-7445 Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-26116-2784/+232
| | | | | | | | | 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>