summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/scriptengine
Commit message (Collapse)AuthorAgeFilesLines
* Add buildCpuArchitecture() to systemInfoKatja Marttila2023-11-221-0/+2
| | | | | | | | To access buildCpuArchitecture from script Task-number: QTIFW-3224 Change-Id: I02086f7d3e064fe53d6fa9322b8832110c40c6b1 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Enable blacklisted testsKatja Marttila2023-09-051-5/+0
| | | | | | | | | | The fail has already been fixed to IFW, no need to blacklist these tests any more when building with Qt6.5 Task-number: QTIFW-3087 Change-Id: I9d2a25d12cfe5fb98083826936878ce3770db0d2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix scriptengine testKatja Marttila2023-08-221-0/+1
| | | | | | | | Evaluating scripts which has gui components needs a valid packagenamanagergui when building with Qt6 Task-number: QTIFW-3087 Change-Id: I3ac03f90cb490e7769e6af7db6f7be198ed06b8f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Start using Qt 6.5 branch with IFWHeikki Halmet2023-08-171-0/+5
| | | | | | | | | This also blacklist test function loadComponentUserInterfaces Task-number: COIN-1050 Task-number: QTIFW-3087 Change-Id: I7c59570b07a54b50898ef0c1bf23ff83540f36bd Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Omit thisObject creation in javascript codeKatja Marttila2023-06-121-8/+1
| | | | | | | | | | | | | | | | Originally, new Component object was created for javascript so that the garbage collector would not destroy the object. This caused the thisObject in javascript to differ from the object in packageManagerCore, which in Qt6.5 lead to warning messages when each script was evaluated: "Warning: :1: Calling C++ methods with 'this' objects different from the one they were retrieved from is broken, due to historical reasons. The original object is used as 'this' object." Fixes so that the new object creation is omitted and QJSEngine::CppOwnership is set to Component object so that garbage collector won't destroy it. Task-number: QTIFW-1829 Change-Id: Ia131d88fc83122f11c5b19a431e7db45e0ba18f9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to post load install scriptsKatja Marttila2022-11-041-10/+42
| | | | | | | | | | | This change adds attribute, postLoad, to existing <Script> -element. Using <Script postLoad="True"> will call the script loading and evaluation only to those components which are selected for install or update right before the components installation start. Task-number: QTIFW-2820 Change-Id: Ic1967d329cbb5de6a0216ff3f76cc2ede178db80 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Update license headerKatja Marttila2022-01-241-2/+2
| | | | | | | Use https instead of http in www.qt.io/licensing Change-Id: I0a2e97afcda03d50fd823be8e11426c2399a3b8f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to list components with regexpKatja Marttila2021-05-211-0/+15
| | | | | | Task-number: QTIFW-2225 Change-Id: I6a7fdfc1070ad54d520563cae7d2446e97e2e87c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@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>
* Fix license check failuresSimo Fält2020-02-281-16/+11
| | | | | Change-Id: I123b1c6a06717c37387a636aae8296e27c1df8c0 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Enable support for Qt 5.12 in installer frameworkArttu Tarkiainen2019-08-221-0/+4
| | | | | | | | | | | | | | | | | Workaround issues of IFW not being able to work on elevated mode caused by changes in qtbase, namely when initializing socket connection between remote installer client and server, and writing maintenance tool binary. Switch to using unbuffered mode for QFSFileEngine instances as buffered mode support has been dropped. Fix calls to QFile::copy() when running elevated installer process. Make minor modifications for unit tests to pass. Explicitly fail and return when performing CreateLocalRepositoryOperation on non-owned directory. Task-number: QTIFW-1312 Change-Id: I3db72547ee95c87d8c02d27e5b31c7b30e793431 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add findFiles methodKatja Marttila2018-03-261-0/+28
| | | | | | | Task-number: QTIFW-1094 Change-Id: Ibc37e9b568f7f54e37f6ed6a5b040940cab5aebd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix testsKatja Marttila2017-11-081-1/+1
| | | | | | Task-number: QTIFW-1027 Change-Id: I9d153924d0f88a537ddcf87e61cac2c550d6817f Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-308-136/+96
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-268-136/+96
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Katja Marttila2016-06-211-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/7zip/7zip.pro src/libs/7zip/win/CPP/7zip/UI/Common/Update.cpp src/libs/installer/component.cpp src/libs/installer/lib7z_facade.cpp src/libs/installer/packagemanagercore.cpp src/libs/installer/proxycredentialsdialog.h src/sdk/translations/ja.ts tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp tests/auto/installer/scriptengine/tst_scriptengine.cpp tests/auto/installer/settings/tst_settings.cpp Change-Id: I3bb98b8490b3c3eb7f664c1abb7417155b5430b2
| * Revert "Use QQmlV4Function to correctly get empty parameters from script."Katja Marttila2016-02-173-120/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit eb574d77b0ab9a92b61e7738d089cd4ea4304e51. The change will not work with Qt5.5 as it is causing constant crashes in Qt installers. Using this change will require a fix for Qt5. As we are about to make Qt installers based on 2.0 we need to revert this change for now. Change-Id: Ia7906d02db645f2407ab07d14f5a037224574b29 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Tests: Fix scriptengine testChristian Stenger2016-03-312-1/+3
| | | | | | | | | | Change-Id: I288f366785c72da49087cb688f7f1247c2494c99 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Make communication via installer.execute() Unicode safeKarsten Heimrich2016-03-301-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was impossible to pass Unicode data safely to a process started via installer.execute(), or to read Unicode data printed by that process safely back in. The reason for this is that the code hardcoded the latin1 codec for converting between strings used in the script interpreter and bytes used by the QProcessWrapper API. Fix this by adding two new optional arguments to installer.execute() which can be used to define the codec to be used for writing to stdin resp. reading from stdout. This defaults to latin1 for backwards compatibility. Change-Id: I290d8d9617b286ef90b2f0a05c6e7a47f6df317f Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Frerich Raabe <raabe@froglogic.com>
* | Fix failing auto-test.Karsten Heimrich2016-03-231-1/+4
| | | | | | | | | | Change-Id: If948400f15f9dcb43e4f47293ee58428993375f7 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
* | Fix build after merge.Karsten Heimrich2016-01-211-6/+6
| | | | | | | | | | Change-Id: I03b7f65e9a2b5ce16160f9059e70a064e354a6c7 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-2010-12/+294
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-299-16/+177
| | | | | | | | | | | | | | | | | | 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>
| * Use QQmlV4Function to correctly get empty parameters from script.Karsten Heimrich2015-11-263-0/+121
| | | | | | | | | | | | | | | | | | By using QQmlV4Function to get the parameters, empty strings passed are correctly kept as empty and not null. Task-number: QTIFW-724 Change-Id: I592e2230e574ba82e765bd0079964db29452b2e9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix scriptengine autotestKatja Marttila2015-11-061-2/+2
| | | | | | | | | | | | | | | | | | Was failing in Windows because NativeSeparators was not taken into account when verifying the error message Change-Id: I79c17ad91875918501d84b102d16f84bb2008038 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Sanitize QDebug outputKai Koehne2015-07-091-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | Prefer using the stream operator logic instead of using QString::fromLatin1. Add a noquote() where a QString should be printed without any quotes/escapes. This also fixes the tests with Qt 5.5, where QString's are further escaped. Change-Id: Ie3afd14b9355101d3c0b52f30f66ec759c76526c Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Fix error strings in autotestsKai Koehne2015-06-241-2/+2
| | | | | | | | | | | | | | | | Fix autotests that broke with commit 1e589e37a991b. Change-Id: I2c0ed437de17fef856706fb3e422f3466c373c37 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* | Fix autotests for changed debug outputKai Koehne2015-06-101-5/+4
|/ | | | | | | | | Commit fa5f7c662841b1d13f6610db8817608a24e3a3f6 removed the printing of exceptions on creation. Fix autotests accordingly. Change-Id: Id715b194f893016d23d7e2accf4b131a40a3f906 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* fix empty installer.components arrayChristoph Vogtländer2015-03-131-0/+16
| | | | | | | | | | Make sure the current list of components is used when referencing installer.components in a controller script. Change-Id: I9468110d61a958f13edba66da0059d6622aa7037 Task-number: QTIFW-601 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-183-21/+21
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fix testBrokenJSMethodConnect autotestKai Koehne2015-01-302-3/+6
| | | | | | | | | | | Since qtdeclarative change e2c1e7b8a exceptions in JS slots do _not_ set the engine to an error state anymore, but are rather printed to console, and ignored. This prevents exceptions to silently propagate ... Change-Id: Icb065314730cf2142eedbde14b0c77c21bdd6f6f Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix the invocation order of entering() and page callbackjkobus2015-01-273-0/+109
| | | | | | | Task-number: QTIFW-620 Change-Id: I1a40aae35dc1c259a96043a1056aa631bf7279b2 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make sure widgets from .ui files are properly registered to engineKai Koehne2015-01-204-0/+50
| | | | | | | | | | | | | Make the QWidget representing a UI file known to the engine, so that e.g. child objects can be always accessed : component.userInterface("RegisterFileCheckBoxForm").RegisterFileCheckBox.checked; This worked reliably only if the .ui file has been shown to the user, which might not always been the case. Change-Id: I7a87773e29f6210ab7160d8e33c41f6ebeeb82d6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Fix objects returned by gui methodsKai Koehne2015-01-082-0/+12
| | | | | | | | | | | | | We need to make sure objects like pageWidgetByObjectName are augmented too (so that one can access child objects). This is achieved by a proxy object that augments all raw QObject * and QWidget * return values. This fixes e.g. the dynamicpage example. Task-number: QTIFW-605 Change-Id: If26dc59220946a7445ef0f9ec7caa15e5b04eaa8 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Simplify registration of objects into script engineKai Koehne2015-01-071-2/+2
| | | | | | | | | | | | Rename addQObjectChildren, removeQObjectChildren methods to addToGlobalObject, removeToGlobalObject, and merge the augmentation of the properties with newQObject. Also, don't recursively register all objects with their objectNames in the global scope. This avoids name pollution. Change-Id: I28f1bc67e6febecc7b5142982c918432b61ed96f Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Expose findChild, findChildren methods to JSKai Koehne2014-12-102-2/+13
| | | | | | | | Re-add the findChild, findChildren methods known from Qt Script. Change-Id: I3db6be53ccd89a09b2c7de14ba7f96ebb26dbdbb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Expose systemInfo APIKai Koehne2014-12-051-0/+13
| | | | | | | | | Add systemInfo as a wrapper for QSystemInfo. Task-number: QTIFW-592 Change-Id: Ib54fcea8b0ef3a397a74f5315202f3000abd63cd Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Remove unused code.jkobus2014-12-032-11/+0
| | | | | | | | Dead since commit 5359d0a3e8d84699701e73d3d15163fb20200bb0 Change-Id: I40af485876d70a6a68406eafe14258b185e16323 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fix regression after porting to QJSEngine.kh12014-10-303-0/+156
| | | | | | | | | | | | Setting a dynamic property of a dynamic page from JS doesn't have any effect anymore, as the properties are not synced. Now we define the property directly on the JavaScript object and connect it to corresponding C++ page with static Qt properties. Task-number: QTIFW-562 Change-Id: If95222a94ebee7f8bb455792eab96c5e9bc19b86 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add check for expected default properties.kh12014-10-301-0/+3
| | | | | Change-Id: I315c958bbc3cbc45452db4787ef3ab27750ebbaa Reviewed-by: Niels Weber <niels.weber@digia.com>
* Add test for default script engine properties.kh12014-06-031-0/+38
| | | | | Change-Id: Id07a6ffd193e032439d008878d6526806ef24c9f Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Replace script with js engine.kh12014-06-032-72/+54
| | | | | Change-Id: Ic9c88e27dca1e936ba09a3776df3df7ec166c606 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Cleanup to support Qt5 only.kh12014-06-021-4/+1
| | | | | Change-Id: Ib8f61229ce2f07e52c22a15e10dc817aca860ead Reviewed-by: Niels Weber <niels.weber@digia.com>
* Restart on the wizard needs to cleanup component left-oversTim Jenssen2013-11-061-1/+1
| | | | | | | | | | | | | | | - use two different script engine instances - one which lives from the beginning -> the controlScriptEngine - the other one which will be reset if there are some new repositories loaded - now the core has a pointer to the gui object, but it should only be used by the script engine so a QObject type should be enough - engines are deleted as QObject children from the PackageManagerCore - registered downloaded archives are removed Change-Id: I60a4a32fb2e409059839ec11b10c57357454f57a Reviewed-by: Michal Klocek <michal.klocek@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* remove slotCurrentPageChanged and call it directlyTim Jenssen2013-09-301-7/+5
| | | | | | | - also renamed it to better name: executeControlScript Change-Id: Id2bb7cada2386561c2b25b158c6aa101382e5cc4 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* add exceptionhandler code for connected signals/JS methodsTim Jenssen2013-06-033-3/+61
| | | | | | | | | | | - there wasn't any error information if a C++ triggered signal resulted in a JS method which has an error, now it will create an exception for it - creating messagebox inside the lib is something what we want to avoid, so the developer itself is responsible to catch these exceptions - most cases of the installer code does that already Change-Id: I07486f73be9de13a486de235f14e3a7d7b54f5b1 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* fix crash in scriptengine autotestTim Jenssen2013-05-221-4/+6
| | | | | | | - destructor deletes components, so there was a double deletion Change-Id: I5c4f14bb3b964297be542821d10a7ebb27925af5 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* fix scriptengine autotestTim Jenssen2013-05-221-2/+4
| | | | | | | | - since we are using one scriptengine the component needs to be registered on the packagemangercore to load the script Change-Id: I931b75e8d68328c2317dd4a55ab9cc298229caba Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
* introduce installerscriptengineTim Jenssen2013-05-166-0/+293
- it uses one scriptengine for everything and adds the components or/and the install-controller in javascript closure contexts - added the gui object to the component script context - removed tabController from controlscript context Change-Id: I3bd6c5dcf470666c30add1b7d04a8fdd094f5f11 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>