summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Repogen: Fix unite metadata when --repository switch usedKatja Marttila2020-11-1023-40/+67
| | | | | | | | | | United metadata 7z was missing the component which had no update available. Task-number: QTIFW-2018 Change-Id: I069fd852499f157075bf28e3ccfef3e42e5f30a9 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Tidy up progress message printArttu Tarkiainen2020-11-051-4/+4
| | | | | | | | The debug print does not look very nice when the string contains escape characters for quotes or extra spaces. Change-Id: I9428d3aef4e3ebd693f66083447430e4e2600098 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix loading controller script with comment on last lineMartin Kampas2020-11-041-0/+2
| | | | | | | Task-number: QTIFW-1062 Change-Id: I3deb46cae74d1e5851d4ddd4b58c0ba19375ddbd Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Fix wrong warning text in command 'purge' for running processesArttu Tarkiainen2020-11-031-3/+8
| | | | | | Task-number: QTIFW-1996 Change-Id: Iaf9aa6bfd39d266ed052838e969881c168b4b2ed Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix segfault in 'void localSocket()' test functionArttu Tarkiainen2020-10-161-33/+31
| | | | | Change-Id: Iced229d7d364f68599bd6eec20db57838f36a671 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix packagemanagercore test in macosKatja Marttila2020-10-162-2/+6
| | | | | Change-Id: I67178a9df34e3ed4752452dca9a85709fdd4c620 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Repogen: Fix options to work with unite metadataKatja Marttila2020-10-1537-1/+690
| | | | | | | | | | | | | | Fixed regogen 'update' and 'repository' options to work with unite metadata. --update-new-components with unify metadata is prevented. Moved --update-new-components functionality from repogen.cpp to QInstallerTools so it can be accessed from tests. Created tests for repogen. Task-number: QTIFW-1943 Change-Id: I12389f4747154a0f6f51b4f34f630103c2cfef04 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix essential updateKatja Marttila2020-10-095-9/+55
| | | | | | | | | When updating essential, no other components should be installed nor updated unless there is autodepend on the essential component. Task-number: QTIFW-1970 Change-Id: If9edd6515e3e5ec51611ac07ac52b13f05983b9d Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Give more meaningfull return value for installsKatja Marttila2020-09-256-49/+145
| | | | | | | | | | | | | | Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Page list widget enhancementsArttu Tarkiainen2020-09-111-0/+1
| | | | | | | | | | | | - Add support for a configurable image shown on top of the page list. - Add missing object names for easier object reference, for example when using stylesheets. - Remove the vertical line separating side widget as this looks particularly ugly on custom styles. Task-number: QTIFW-1939 Change-Id: I16e17e72163068381f54491f7fbe965eb4c5295d Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Obey --no-default-installations when default set from scriptKatja Marttila2020-09-093-1/+11
| | | | | | Task-number: QTIFW-1930 Change-Id: Ie180777a0c5dc7c6a7b4e273169e673cd5c7e918 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* CLI: Allow forced component to be selected for installKatja Marttila2020-08-311-0/+12
| | | | | | Task-number: QTIFW-1929 Change-Id: I4c9cc7449126b6bb8898f5148f2cb612b175f52a Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add support for vendor set image decorationArttu Tarkiainen2020-08-251-0/+1
| | | | | | | | | | | | Add possibility to show an arbitrary number of product related, or other images on PerformInstallationPage. These can be specified in the installer configuration file, using <ProductImages> element with one <Image> child element for each file name. Task-number: QTIFW-1900 Change-Id: I2be727d9189963ef1a79046150111dd8c91153c6 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* CLI: Ask user confirmation before performing installer actionsArttu Tarkiainen2020-08-213-0/+3
| | | | | | | | Also add new option --confirm-command to skip the interactive query. Task-number: QTIFW-1834 Change-Id: I1c63fd990431c792a523da7047637f54b193bee6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add a page list widget to installer wizardArttu Tarkiainen2020-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | If an installer is configured with <WizardShowPageList> set to true (default), a QListWidget set as a side widget for the wizard will be shown. The list should indicate completed and incomplete pages and the current wizard page. User navigation is not enabled in this change. The page list should honor the visibility of individual pages and update itself dynamically. In addition the visibility of a page in page list widget can be set internally with setShowOnPageList() which overrides other factors when hiding a page. The page item title shown on the list can be set internally with setPageListTitle() for the PackageManagerPage object, or the item can alternatively use the normal page title and the object name. Task-number: QTIFW-1755 Change-Id: I8a792d957a10e2176de5f42f29b1282e8e7667db Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Refactor maintenance tool writing conditionsArttu Tarkiainen2020-06-104-2/+6
| | | | | | | | | This change fixes a bug caused by a blocking runInstaller() call in PerformInstallationPage::entering() and also contains refactoring to related parts of code. Change-Id: Ic3309707c1f975a646937aa96fc407a3e5931359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix InstallAction type when updating componentsKatja Marttila2020-06-081-2/+8
| | | | | | | | | | | | Components should be selected for update using model, not components own check state so model values stay in sync. Wrong InstallAction type will cause component to think it will be installed when that is not the case. This caused problems in install scripts when trying to figure out if component is going to be installed or not. Task-number: QTIFW-1830 Change-Id: I367f476de96f27b27d74e06a6fb630f0876924d2 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Do not run updater if there are no updates for selected componentsArttu Tarkiainen2020-06-011-0/+6
| | | | | | Task-number: QTIFW-1818 Change-Id: I13dceeeaf294c689a90fbe5fe74586d7a117ea50 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Inform if trying to uninstall virtual componentKatja Marttila2020-05-275-0/+39
| | | | | | Task-number: QTIFW-1811 Change-Id: I333d6d0bd93f8538919f172113b7039b63491492 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add new option --file-query to auto answer QFileDialogKatja Marttila2020-05-264-0/+40
| | | | | | | | | | | | | QFileDialog.getExistingDirectory and QFileDialog.getOpenFileName can be called from scipt. If command line interface is used, user must type the correct directory or file name from command line during install. With --file-query option user can give the values when running the installer or maintenancetool with syntax --file-query filedialogId=C:/temp,filedialogId2=C:/temp/file.txt. Task-number: QTIFW-1631 Change-Id: I5e58be6b509cf00de832646ef31ec4eda90773be Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add new no-default-installations optionKatja Marttila2020-05-261-2/+54
| | | | | | | | | | | | This option can be used both from CLI and from GUI. Option will overwrite Default true in component.xml, which means that in GUI the components are not selected by default, and in CLI the components are not installed unless those are given as argument to install -command. Task-number:QTIFW-1630 Change-Id: I5dc16b14fc136f421980a55bb5fc6a74213309dc Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add missing license header to tst_settings.cppArttu Tarkiainen2020-05-151-0/+28
| | | | | Change-Id: I3877a0370cf6e2d2026eca50d44e4ce54b63ac03 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add support for disabling CLI features from configuration fileArttu Tarkiainen2020-05-152-0/+2
| | | | | | Task-number: QTIFW-1760 Change-Id: Ibd0668756700eeab68bce12ddce1866893cc08f9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* UnitTests: Cleanup codeKatja Marttila2020-05-1521-341/+212
| | | | | | | Move recurred code to common functions, remove unnecessary includes Change-Id: Idfe3a0c952d1154470ecb229ff3c1e428beaa3ac Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to accept licenses from CLIArttu Tarkiainen2020-04-286-1/+106
| | | | | | | | | | | License agreements can be accepted automatically by using command line option --accept-licenses or interactively by answering queries with either "Accept", "Reject" or "Show" selections. Task-number: QTIFW-1742 Task-number: QTIFW-1745 Change-Id: Iff46b44f91faddb7f163b299994167ab16df68b3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Answer queries from command lineKatja Marttila2020-04-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | Standard input is possible in Windows only in console application. This change makes installers to be console applications by default. If started as gui from command line, console is released and application is restarted so cmd.exe won't be waiting for application to finish. If started from explorer, console is launched but released immediately. This may be seen on screen with short console flash. Using command line interface messagebox strings and possible answer values for it are printed to console. Answers must be given in case sensitive format as StandardButton QMetaEnum is utilized when reading button values. This ensures that if StandardButtons are added/removed/changed the code continues to work. Also added a new option 'default-answer' which will answer the questions with default button values without user interaction. Task-number: QTIFW-1739 Change-Id: I710f921f5c927dbd13090af32f93656dded84e72 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Enable testsIikka Eklund2020-04-241-0/+2
| | | | | | | Remove DisableTests property. Change-Id: Ifa524f2f399e7b3072825a2ef34e752187c34be4 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add new option --auto-answerKatja Marttila2020-04-165-3/+42
| | | | | | | | | | | With this change user can individually answer to message queries if message id is known. The syntax is --auto-answer message.id=QMessageBox::Ok,message.id2=QMessageBox::Cancel Task-number: QTIFW-1740 Change-Id: I86d08df77cf5f3d665901b599586d8c52b7dcdf6 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to auto accept or reject IFW queries from CLIKatja Marttila2020-04-1510-7/+173
| | | | | | | | | | | | | | | Added new command line switches accept-messages and reject-messages to automatically accept or reject installer message queries. Also removed Retry option in CLI when archive or hash download failed. With GUI it is possible to try Retry in case either is missing but without GUI Retry will cause infinite loop. Added unit tests for accept-messages and reject-messages using CLI. Task-number: QTIFW-1736 Change-Id: Ie87d2d8157be772b790415c96e5b94fc882d4be7 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix build failures in PackageManagerCore tests with Qt 5.9.xArttu Tarkiainen2020-04-141-9/+9
| | | | | Change-Id: Iae43369276282711b242eac41e32997ebbfb40ce Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix shortcut creation when installing from CLIKatja Marttila2020-04-098-1/+149
| | | | | | | | | | | Change default button from Retry to Cancel if operation fails to avoid infinite loop when running from command line interface. Added also unit tests for shortcut operation. Task-number: QTIFW-1666 QTIFW-1710 Change-Id: I171b6aecd9886acce0051b7082842f8f76b22046 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add unit and CLI tests for AppendFileOperationArttu Tarkiainen2020-04-097-0/+188
| | | | | | Task-number: QTIFW-1718 Change-Id: Ibe29bd072f6fc671b76fbcc76e4e747cc870cab2 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* UnitTest: Allow test executable to run in registerfiletypeKatja Marttila2020-04-091-0/+1
| | | | | Change-Id: I1edf92384e9e74a7ee005f1fd70f784c601317a6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix building and execution of SettingsOperation test on LinuxArttu Tarkiainen2020-04-092-6/+6
| | | | | | | | | | | Return QSettings value QVariant explicitly as a QStringList. Change the install script settings path to use generic '/' separator as this seemed to cause problems on Linux, also remove unused variable from the script. Change-Id: I647c18ef577b923f92cfc6c6c903d517dde479ce Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add unit tests for environmentvariable operationKatja Marttila2020-04-0810-159/+217
| | | | | | Task-number: QTIFW-1719 Change-Id: I91f91e8704ed409a76302154d013e09afb767707 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix bugs in InstallIconsOperation and add unit testsArttu Tarkiainen2020-04-089-25/+298
| | | | | | | | | | | | | | | | | | - Fix conflicting naming and reference of operation value in InstallIconsOperation::targetDirectory(). - Fix bug related to appending of "icons" suffix to paths in XDG_DATA_HOME, the logic was glued to old default values which have been since changed. - Remove unused variable in class destructor and remove unneeded default implementation. Also add unit and CLI tests for InstallIconsOperation and move addToFileMap() to common functions so it can be used in multiple tests. Task-number: QTIFW-1715 Task-number: QTIFW-1465 Change-Id: I5281ca7a5dec1453f49fbe2cb2852d6467bf0c97 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* UnitTest: Remove Qt specific ignoreMessageKatja Marttila2020-04-081-1/+0
| | | | | | | | This warning depends on Qt version used, removed the ignoreMessage() as we don't know on which versions the warning occurs Change-Id: I38ae3a0fa01dbaf193507bc5b748a88ab581d908 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* UnitTest: Allow test executable to run in copyoperationKatja Marttila2020-04-081-0/+1
| | | | | Change-Id: I200c728190cf90e1c192aff5e1bbe9f4717e8e26 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add unit and CLI tests for CopyDirectoryOperationArttu Tarkiainen2020-04-087-0/+243
| | | | | | Task-number: QTIFW-1694 Change-Id: I7e3280f2b4faea987277b3af0d78a47e105f88e8 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Initialize user arguments earlierKatja Marttila2020-04-084-1/+54
| | | | | | | | | | | | | | | User can give arguments from command line, for example AllUsers=true, which can affect to other core values. Initialize user arguments in core constructor so we an utilize the user given values when defining other core values. Added also unit test for overwriting core data values. Note that some values belong to QSettings such as MaintenanceToolName which cannot be overwritten. Task-number: QTIFW-576 QTIFW-1730 Change-Id: I82a05f9f4bc8498f4e0e2af407ba29f6dabbf030 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add CLI test for SettingsOperationKatja Marttila2020-04-085-0/+63
| | | | | | Task-number: QTIFW-1711 Change-Id: Iccdeb5938c0034466bd1018a0beda415dd40da2e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Remove existing installation from command lineArttu Tarkiainen2020-04-071-0/+24
| | | | | | | | | | | Add new "purge" command to command line interface. This removes all components and all program directory contents. Add test function to unit tests. Task-number: QTIFW-1574 Change-Id: Iccd4a052c7e2fc8eec0a6ae2b5a93c0c607604cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add CLI test for CreateDesktopEntryOperationArttu Tarkiainen2020-04-075-1/+83
| | | | | | Task-number: QTIFW-1723 Change-Id: Ifc77c77a0db560198b04729518346e5438efa6b6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add CLI test for RegisterFileTypeKatja Marttila2020-04-066-23/+100
| | | | | | Task-number: QTIFW-1714 Change-Id: I530a30705a700152f3dc087d9fc775d933f5d586 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Create tests for MoveOperationKatja Marttila2020-04-066-1/+190
| | | | | | Task-number: QTIFW-1716 Change-Id: Ia1ca53315b389b8d8145f8a995c2cc2658502003 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add missing resource to commandlineupdate.proKatja Marttila2020-04-032-1/+3
| | | | | | | | Also add the commandlineupdate to installer.pro so it will be executed when all tests are run. Change-Id: Ia8dac2f1a3a6070a2c81d441d3f414e94426906b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add CLI test for ConsumeOutputOperationKatja Marttila2020-04-035-4/+52
| | | | | | Task-number: QTIFW-1717 Change-Id: If27b649a11f54395de117891ee6fa0d9d339bfb4 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add CLI test for SimpleMoveFileOperationArttu Tarkiainen2020-04-035-0/+66
| | | | | | Task-number: QTIFW-1713 Change-Id: I44d844e60ec57aa4b0128e7b0a50f7c182872490 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add unit and CLI tests for DeleteOperationArttu Tarkiainen2020-04-036-1/+175
| | | | | | Task-number: QTIFW-1721 Change-Id: I874095cfbbb3b80925b1fa1c61774b4858955887 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add CLI test for ReplaceOperationArttu Tarkiainen2020-04-036-1/+56
| | | | | | Task-number: QTIFW-1720 Change-Id: I2b4f1c7fd83bdb50a8eeba55f9dc632219e7c3c7 Reviewed-by: Katja Marttila <katja.marttila@qt.io>