summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/solver/tst_solver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix qHash return valueKatja Marttila2023-09-291-2/+2
| | | | | | | | qHash return value in Qt6 is size_t. Making relevant changes so that no warnings occur when building with Qt5 or Qt6. Change-Id: Ia4d8de49b163a59b58ec7c1eea83979b174b1bd1 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add common base class for the installer calculator classesArttu Tarkiainen2023-02-081-25/+25
| | | | | | | | As the classes already share similar features and public API, it would make sense to inherit a common abstract class to define the interface. Change-Id: I7ed278b1b049b7ec12c4401e55fdf39306b0ab85 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Cleanup installer calculator classesKatja Marttila2022-11-301-5/+1
| | | | | | | | | | | | | | As there are several optimizations done, the single click of component in component selection tree is not slow anymore. Cleaning the code so it is easier to maintain. Basically this revers commit a28cf55b5a5007c0dd952b3012c076d9da329f0f but as there are bug fixes made after that so pure revert could not be done. Task-number: QTIFW-2885 Change-Id: Id486d5dc68c42c31b4848cd19a1761bcfe242db6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Optimize retrieving components by nameArttu Tarkiainen2022-10-111-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The PackageManagerCore::componentByName(const QString &name) -function is called repeatedly by the InstallerCalculator class and at minimum once for each install script, because we automatically inject a snippet which stores the return value of the function in the 'component' variable for the script context. Create a <name, component> hash once per each component model reset to make the lookups faster: * This avoids constructing a flat list of components and all their descendants again and again when calling the function. * The linear lookup from the component list is slow because it calls componentMatches() for each element until the satisfactory component was found or the list ends. * The average time complexity of the key lookup from the QHash is constant even for large hashes. Task-number: QTIFW-2790 Change-Id: I580d28f78ac6681d5bcbfbad970002b49de1a830 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not install new dependencies for installed componentsKatja Marttila2022-05-161-2/+2
| | | | | | | | | | | | | | | | If component is updated to repository, and new dependencies are added, the dependencies should be installed only when fresh install to component is made or the component is updated. This change adds a new LocalDependencies value to component. It keeps track of the dependencies the local installed packages has. Fixes also a bug in uninstallecalculator, where we should also read the dependencies from local installed packages instead of newly introduced repositories. Task-number: QTIFW-2624 Change-Id: I0557e5adf1e87c0a1238cc455cfb2c90f6b05c87 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix updating autodependency componentsKatja Marttila2022-05-131-2/+3
| | | | | | | | | | | Autodependency components were always forcely updated, even if 'Deselect All' was selected in component selection page. Fixed so that the autodependency component update is updated only when one of its dependants is updated. Task-number: QTIFW-2595 Change-Id: I05ececc45ef32ff80d53b008f839b358158a3316 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Speed up component selection in component selection pagesKatja Marttila2022-04-281-7/+24
| | | | | | | | | | | | | | | | | If a lot of components are installed, maintenancetool was slow to select/unselect a single component. This was caused because the whole tree's components were recalculated. Fixed so that only the selected/unselected components and their dependencies and autodependencies are recalculated instead of whole tree. This change speeds up clicking tree item from zero to 90 percent, depending on how much components are already installed. The more components are installed as autodependency, the slower it gets to select the items. Task-number: QTIFW-2522 Change-Id: I5e824aed8787fd7ecdce72b15a1b13848f0a3923 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add install reason why component is uninstalledKatja Marttila2022-03-241-7/+19
| | | | | | | | | | In details view uninstallable and installable components are listed. For installable components a reason is shown why the component is installed. Added similar kind of message for uninstallable components as well. Task-number: QTIFW-2581 Change-Id: Idbf31200793a6c89a4ed4a6fc115f49889b5f9b5 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Make Updater -view checkbox selection fasterKatja Marttila2022-01-191-1/+1
| | | | | | | | | | If there are lot of components installed, querying core from component caused unnecessary performance hit. Also replaced the foreach keyword with the preferred C++ range-based loop Task-number: QTIFW-1021 Change-Id: I961439ba14f26fee21f201769a71319b4b98d14b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Revert "Fix addDependency functionality"Katja Marttila2019-11-281-19/+6
| | | | | | | | | This reverts commit 7dd35b336fbaa78e5f3b347c5e1875743d146fb0. Reason for revert: Change was causing a recursion error. Change-Id: I273a92fbb3292f33d5e0860085102f6e5cc90e13 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Fix addDependency functionalityKatja Marttila2019-10-211-6/+19
| | | | | | | | | | | | addDependency was acting weird - if a subcomponent was added as dependency, the parent was not installed. It was installed the next time the installer was launched and something else was added/removed. addDependency should behave the same as when selecting the component from UI - it should install the parents too Task-number: QTIFW-1458 Change-Id: I21726ad6acda3b1fb382263405754c2d682dea76 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix recursive error when there are unstable componentsKatja Marttila2018-09-141-3/+11
| | | | | Change-Id: Iecaf849368904a72bae1a1ca6e51b45cfafb54ef Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add Component::addAutoDependOn methodKonstantin Podsvirov2017-10-301-3/+7
| | | | | | | | | | Changes: - Add addAutoDependOn method to Component class; - Add method documentation; - Improve tst_Solver test. Change-Id: I5ed62368d62567f1056e20d89ba03c2639e0eaee Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Make installer to check the dependency versionKatja Marttila2017-03-231-1/+39
| | | | | | | | | | | | | | Installer was able to install dependency correctly. However, it ignored the version dependency might have. Dependencies>componentA->=4.0</Dependencies> If there was already a dependency installed with lower version number, the newer version, which was required by the selected component, was not installed. Fixed so that maintenancetool will not only check if the dependency is installed but also the installed version. Change-Id: Ia26b5233cf8847bce73095d19a13c481318d27f2 Task-number: QTIFW-914 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Issue a warning when a component depends on auto dependent one.Jarek Kobus2015-03-111-2/+23
| | | | | | | Task-number: QTIFW-510 Change-Id: I57eff879deebf8f31a472a6c66a7e275e34447bd Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Add ComponentChecker class for verifying the internal state.jkobus2014-12-011-0/+39
| | | | | Change-Id: I3361ad6c51d5a0f3beee049237e6b370d57a8f0d Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fix the uninstaller calculatorjkobus2014-11-041-2/+0
| | | | | | | | Don't include dependencies which were not installed before. Fix the "Cascade dependencies" test of "solver". Change-Id: I807503840af5c841cde89fdbbfc3f6932d4787b8 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Add failing test for uninstallationjkobus2014-10-151-1/+21
| | | | | | Change-Id: I76686693e14523732849e8cba297e550dc3fc5bd Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Move the uninstallation calculations into UninstallerCalculatorjkobus2014-10-101-3/+49
| | | | | Change-Id: I1b398815414430c2fab9a5c611b44e3a92c2fb39 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Compile fix.kh12014-10-081-2/+5
| | | | | Change-Id: Ibdfe2c86ee583ff56c3c182543aa57489498f2bb Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Add a test for graph resolving.kh12014-10-061-1/+65
| | | | | | Change-Id: I96f7077cdb9816b009d44b3daf2d985d151121fb Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* Fix [-Wformat-security] warning.kh12014-06-241-3/+3
| | | | | | | Change-Id: Iae180cb0f13a39daacc1cadd04094bfddd33b6ab Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* use dependency solver to order the installed operationsTim Jenssen2013-08-061-0/+134
- in case of single updates the order of the installed operations were wrong, now we reorder that till we are using that code for the install order aswell - added initial autotest for the dependency resolve code Task-number: QTIFW-318 Change-Id: If411a684cb02ef9e7d0316084075e86702bf839d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>