summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* EXPECT_FAIL tests for MSVC 64 bit in qscriptjstestsuite.old/5.1Friedemann Kleint2013-09-122-1/+15
| | | | | | | | | | Introduce compiler defines for 32/64 bit and adapt the text file. Task-number: QTBUG-32829 Change-Id: I9cdbe5b306264858953e2c710b48300f5690e7db Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* test: Fix XPASS for tst_QScriptJsTestSuite::ecma/Math(Math.pow()Sergio Ahumada2013-08-201-2/+0
| | | | | | | | This tests seem to be passing on MinGW 4.8, so removing them from the expect_fail.txt file. Change-Id: I3786d410f1e0937ddc1ceedd8ffd3c07d2619c40 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* test: Add 5.1.0 bic data for linux-gcc-ia32Sergio Ahumada2013-07-082-0/+7161
| | | | | Change-Id: I6d17ba2357350199bb0f0043cc0cc741df6785b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* List QtScriptTools as a module under test.Stephen Kelly2013-04-081-0/+1
| | | | | | | So that the expected version for it is generated. Change-Id: If414029e6cb420b33e5f36baf31ec5ef37c5c491 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Merge branch 'dev' into stableSergio Ahumada2013-03-191-0/+2
|\ | | | | | | | | | | This starts Qt 5.1 release cycle Change-Id: Ie8a79e8c58e45eab13391377dd33750ff2d98c08
| * Fix CLANG-warnings.Friedemann Kleint2013-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | - Unused member variable. - Unused static functions. - Return false for pointer. Change-Id: Ie78332d3754e7f53ed75d6006c11d60c29719c7b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Test the cmake scripttools module only if widgets is available.Stephen Kelly2013-03-141-2/+11
|/ | | | | | Change-Id: Ia124db1328e9d6b87c9b1b6858103f81e1678355 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use qmake for package dependency resolution in cmake tests.Stephen Kelly2013-02-262-2/+2
| | | | | | | This allows us to remove hardcoded depends information. Change-Id: I778e3ca6a5f3f316948c652f4f30f00ebbf900cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Remove QPointerBase bic check.Stephen Kelly2013-02-132-10/+0
| | | | | | | QPointerBase is not public or exported and it is to be removed Change-Id: I84f8708a06f4c4495a073b3bde02015b263403cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge branch 'release' into stableSergio Ahumada2013-01-311-3/+0
|\ | | | | | | Change-Id: If3a1efe3888b872702d75e25d1943ff79d57e9c6
| * Fix QtScript crash on 64bit with JIT.v5.0.1Friedemann Kleint2013-01-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During back-trace generation we calculate a code offset towards JIT generated code. Using JITCode::offsetOf() will crash/assert if the offset doesn't fit into 32 bits, because the generated code can only encode relative offsets in 32-bits and not 64-bits. However in this context - backtrace generation - we just want to calculate the offset and are not interested in this architectural limitation, therefore we can just calculate the offset ourselves using the fully sized uintptr_t. Initial-patch-by: Simon.Hausmann@digia.com Task-number: QTCREATORBUG-8629 Task-number: QTBUG-23463 Change-Id: I0efadd5ed20855409122e1fcc9236fdfbc4f62a4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Doc: Fix module name formatSze Howe Koh2013-01-262-7/+7
| | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtScript -> Qt Script QtScriptTools -> Qt Script Tools Change-Id: Icf6b2ea3829247475f8902334b615f9a9206cc51 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | tst_bic: Add linux-gcc-ia32 bic dataSergio Ahumada2013-01-143-1/+7034
| | | | | | | | | | | | | | | | | | | | Adding bic data for the following modules: - QtScript - QtScriptTools Change-Id: Ie16f2aa9f399d3f05facbc9cfa2de2a0797f0962 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | Remove the Qt 4 BIC data for QtScript.Sergio Ahumada2013-01-1413-102442/+0
| | | | | | | | | | | | | | We will not be testing BIC of Qt5 against Qt4 Change-Id: I649d0a7f9f628211d73b6ce740220e9ce116c52f Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-1037-37/+37
| | | | | | | | | | | | Change-Id: Ic4a2739c8caf2eac95e4a72d8d38cfb912d5fe2b Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | make use of qtHaveModule()Oswald Buddenhagen2013-01-101-2/+2
|/ | | | | | | Change-Id: I440b609d23570293f21f21a2cb31854366d06bf7 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove obsolete DEPENDPATH assignmentsv5.0.0Oswald Buddenhagen2012-12-162-2/+0
| | | | | | | | qmake now add CONFIG+=depend_includepath by default, making manual DEPENDPATH setup unnecessary. Change-Id: I0804385b636d6f5b3b0136cc472a1f9ecb7b7871 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make use of qt_headersclean.prfv5.0.0-rc2Oswald Buddenhagen2012-12-122-73/+2
| | | | | Change-Id: I0256b34290c3f281ab51141d84795f3514cb832d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove symbian vestigesOswald Buddenhagen2012-12-045-20/+4
| | | | | Change-Id: Id4cf97c6ca3b9d4335daf4f32842fb07f51c557e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* autotests were moved to qtbase as they have no real script dependencyOliver Wolff2012-11-0827-3012/+0
| | | | | | | | Task-number: QTBUG-27705 Task-number: QTBUG-27706 Change-Id: I1bd17444b5ba8effba52bf4c179751f25a9d5974 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* CMake: Remove obsolete test_modules testStephen Kelly2012-11-013-81/+0
| | | | | | | The generated module_includes test is a super-set of this test. Change-Id: I74f0abb3f577306b9cd5161a297458902d6da2e7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* CMake: Test module includesStephen Kelly2012-10-311-0/+7
| | | | | Change-Id: Icc2d86758f43c89493b2ef3afee913c22e2a1b88 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed compile with -no-widgetsRohan McGovern2012-10-262-1/+12
| | | | | | | | | Disable tests which need QtWidgets when that module is not available. Note that a missing QtWidgets also implies a missing QtScriptTools. Change-Id: I59ae3c25cfebf24ec9f8418b78b8b9f8c1caa7e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2450-1202/+1202
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Id0b72b8c895b0eab04a740bf83859c9b646dd911 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Tests: Use qInstallMessageHandlerKai Koehne2012-09-141-4/+4
| | | | | | | qInstallMsgHandler got deprecated in Qt 5. Change-Id: I4da748659f232d8b0fe4b16fe9cf83290762dd2c Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Capture full backtrace when a native function calls back into JSKent Hansen2012-08-221-0/+41
| | | | | | | | | | | | | | | | | | | | | | Commit df0ec196031d33850324dc5eeed2d71f61413885 assumed that JSC's Interpreter::throwException function is called exactly once when an exception occurs. That's wrong. If there is a native call inbetween two JS calls on the stack, the call stack will be unwound to the point of the native call frame, and throwException will return. After the native (C) call frame has been unwound, throwException will be called again to unwind remaining JS call frames, and so on. This was causing QtScript to discard the backtrace belonging to the inner-most JS frames; the backtrace would be regenerated from a partially unwound state. Fix this by ignoring subsequent calls to the uncaughtException() callback once a backtrace has been captured; the backtrace is already cleared before each evaluation is started. Task-number: QTBUG-26889 Change-Id: I03e1d60fbac5e592cff1dd5ef70f397cf94454ae Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Remove the use of the QWidgetStar metatypeid.Stephen Kelly2012-08-154-2/+158
| | | | | | | | | | It is to be removed, and is obsoleted by QMetaType::PointerToQObject. By using QMetaType::PointerToQObject, we also gain the feature that all pointers to types derived from QObject return true for QScriptValue::isQObject(). Change-Id: I18392b5b6cde3a45d060c37612d987a5cf8e8f18 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make QScriptEngine::uncaughtExceptionBacktrace() work againKent Hansen2012-08-151-8/+7
| | | | | | | | | | | This function has been broken since Qt 4.6 (when the JavaScriptCore- based back-end was introduced). Fix it by introducing a callback in JSC that allows us to capture the stack when an uncaught exception occurs. Task-number: QTBUG-6139 Change-Id: I4a829323c9fb0c8b2f16a2e5d6f0aeb13cc32561 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove dead code from backtrace autotestKent Hansen2012-08-151-35/+0
| | | | | | | | | | | | With the JSC-based back-end, Error objects don't have a "stack" property, and there is no Error.backtrace() function. Commit a670b4756885b106db04651cd2a7030e02f0cc2f removed all mention of them from the documentation, but not from the autotest; this code wasn't reached anymore because of a preceding QEXPECT_FAIL in the autotest function. Change-Id: Ib34cbd5edff126137cec02bf68624e4a102ace84 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add default conversion for types long and ulongKent Hansen2012-08-142-0/+64
| | | | | | | | | | | | | | Such conversion is not guaranteed to be lossless on all platforms, but it's still reasonable to support these types by default. JSC::JSValue already had constructors for them. The type matching / overload resolution in the QObject binding already handled long and ulong, but the value conversion itself was missing, for some reason. Task-number: QTBUG-2124 Change-Id: I14ff29a8e949403234b7659c0aca8b48bcdbda0e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix GC issues related to QObject connections and ownershipKent Hansen2012-08-092-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue 1: Even if a sender object was only weakly referenced, the connection's slot function would still get marked. If the slot was a closure, its scope could hold a reference to the sender object, so by marking the closure, the sender would get marked, too - even if there were no other references to the closure outside of the QObject connection structure. This would cause the sender object to stay alive, rather than being garbage-collected (i.e., it leaked). Issue 2: It's possible that a closure used as a slot in a connection for one QObject holds the only reference to another QObject that has connections of its own. In that case, if the first object is explicitly referenced, the second object (and its connections) should get marked. But depending on the order in which the connections were marked, the second object might get treated incorrectly. This commit solves both issues by introducing an iterative scheme for marking connections. The first pass marks only connections whose sender object is referenced elsewhere in the JS environment. The second pass marks connections whose sender object is referenced by slots of the connections marked in the first pass. And so on, until no more connections should be marked. At that point, any remaining unmarked connections are effectively dead (belonging to QObjects that can be reclaimed by the GC). Task-number: QTBUG-26590 Change-Id: I50aa66f7fe407a6827b6f2a12e027275a2fb4655 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Move test helper function to separate header fileKent Hansen2012-08-094-15/+64
| | | | | | | | Makes it possible to use the collectGarbage_helper function in other autotests too (e.g., tst_qscriptextqobject). Change-Id: I4fefa36aba13ebf9f931f0e2b90d7ddbc0036a6c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QScriptEngine::pushContext(): Don't inherit parent context's scopeKent Hansen2012-08-081-0/+27
| | | | | | | | | | | | | | This was a regression introduced in Qt 4.6 (JavaScriptCore-based backend). pushContext() should always create a context with a "clean" scope (only the Global Object and the context's own activation object should be in the scope chain). The scope chain API is internal, but the wrong behavior could still be observed e.g. through QScriptEngine::evaluate(). Task-number: QTBUG-18188 Change-Id: I138dabc665d7275fb85d3b5e1b473d56096a989e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-0131-0/+31
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I432719e9520662c9dda5eaa580f0b508de4120fe Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Test that the package configs for QtScript work.Stephen Kelly2012-07-195-0/+97
| | | | | Change-Id: I044409a384a1931c7727cc679fb54a87be627a45 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QScriptContextInfo::functionMetaIndex() for overloaded slotsKent Hansen2012-07-131-6/+0
| | | | | | | | | | | | | | | | | | This was a regression against the pre-JavaScriptCore implementation, where we used to store the selected method index as an internal member of the QScriptContext(Private). But in the JSC-based implementation, QScriptContext is implemented as a pointer to a JSC::CallFrame, and there are no unused fields in CallFrame where the method index can be stashed. Refactor the Qt method call logic so that the method selection is separate from the actual processing of the target method. This way, QScriptContextInfo can compute the method index the same way that the actual method call did. Task-number: QTBUG-6133 Change-Id: I619fa8b91542d0b6ab5a44b00266cc0705c95823 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Ensure QObject wrappers are garbage-collected if appropriateKent Hansen2012-07-031-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address the "###" comment. When QScriptEngine::newQObject() is called with the option PreferExistingWrapperObject, the resulting wrapper object is cached by the engine, in case it will be needed later (e.g., by a subsequent newQObject() call for the same QObject, with the same wrap options). But if a QObject wrapper object is only referenced by the QtScript internals (i.e., not reachable from the JSC stack/heap, or kept in a QScriptValue), the wrapper should not be kept alive if the ownership is ScriptOwnership, or if the ownership is AutoOwnership and the C++ object has no parent. If the wrapper is marked in that case, it won't get collected, and hence the C++ object will be kept alive, too. In practice, QtScript appears to leak memory (the objects will only be destroyed when the engine is destroyed). Our copy of JSC doesn't have a concept of weak references; the ClientData callback in the JSC markRoots() function (which causes QScriptEnginePrivate::mark() to be called) was moved to the end. This enables the wrapper and connection marking logic to determine whether a wrapper can be safely discarded (if it hasn't been marked by JSC by this point, it must be a weak reference). Task-number: QTBUG-21993 Change-Id: I61f6aafc91f080b80d3f5859148e645b80d9b653 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Don't crash if queued signal handler no longer existsKent Hansen2012-06-261-0/+33
| | | | | | | Task-number: QTBUG-26261 Change-Id: Ie269c56c0336b1c937d4ec551f913ae7537d0338 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix namespace compilation on macx clang developer build OSX 10.7Toby Tomkins2012-06-211-0/+5
| | | | | Change-Id: Ic111b51472e0252446be4c2db0f991aac1c72e1d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Skip a test case that started failing after the upgrade to Unicode 6.1Konstantin Ritt2012-06-152-1/+2
| | | | | | | | | | | U+10C1 and U+10CD has been added in the Unicode 6.1 and assigned with general category Lu (Uppercase Letter). toLower(Lu) can never be Lu, thus the failing testcases are just wrong -> omit them. This also avoids using of QUnicodeTables internals in JSC. Change-Id: I6aa6dab686dc3e3556ebe83c395c5d93e42cfb4f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Skip a test case that started failing after the upgrade to Unicode 6.1Lars Knoll2012-06-131-0/+1
| | | | | Change-Id: I6aa6dab686dc3e3556ebe83c395c5d93e42cfb4c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Disable these tests for nowLars Knoll2012-06-131-1/+1
| | | | | | | | They cause valgrind errors and crashes and it's unclear how they are at all related to QtScript Change-Id: I0bf1d6b047e0770d965a174cd66bfb3d7cad4ac3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* don't reference $$QT_SOURCE/BUILD_TREE - they're unavailable hereOswald Buddenhagen2012-06-062-2/+2
| | | | | Change-Id: I88316acb4cfc867689dfa636dd7554ac0976275f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash when converting invalid JSValue to stringKent Hansen2012-06-011-0/+9
| | | | | | | | JSC::JSValue::toString() expects that the input is valid. Task-number: QTBUG-21896 Change-Id: I3199fcba94be5426cb3d193b57d16176daae83a0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix crash when accessing QObject properties through activation objectKent Hansen2012-06-011-0/+18
| | | | | | | | | | | | | | | | Since objects in the scope chain have to be JSActivationObjects, QScriptContext::setActivationObject() creates a proxy object that should delegate access to the actual object. This case was not handled in the toQObject() conversion function, so for activation property access through evaluation (where the this-object would be the proxy object, not the actual QObject), the this-object conversion to QObject would fail, and the assert "this-object must be a QObject" was triggered. Task-number: QTBUG-21760 Change-Id: I40e868d9717ec76e0df18d5848c6ad99546ba34f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix scripttools compilation when some features are disabledKent Hansen2012-06-011-0/+6
| | | | | | | Task-number: QTBUG-20378 Change-Id: Ia1dc574824cb1d58c237d60675d1b8a5f8f44c43 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Don't crash in debugger if QScriptEngine is deletedKent Hansen2012-06-011-0/+18
| | | | | | | Task-number: QTBUG-21548 Change-Id: I925a920c8685cf4cf40c7ad03c2d519e2f2121fb Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Remove trailing semi-colonKent Hansen2012-05-311-1/+1
| | | | | | | Task-number: QTBUG-22152 Change-Id: Iad9f14ea4bbe401091aa5c56f8ce7abf0e69af8b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix race condition in tst_qsharedmemory autotestKent Hansen2012-05-281-1/+2
| | | | | | | Task-number: QTBUG-25655 Change-Id: I9d0c1498decfe94a84b3ddaba566eac92066e14d Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Deprecate the Encoding argument of qsTranslateLars Knoll2012-05-212-13/+9
| | | | | | | | | | This is the same as change 4822a821facbbf834c6aab5a8a7da2b3e43f09f7 in qtdeclarative. We always assume the js source code is Utf8 encoded, as also on the C++ side. Change-Id: I4f49484241718dfc4a2bb39a674b54df46aa8c8d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>