summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* qMalloc, qFree and qRealloc are deprecated.Debao Zhang2012-05-201-1/+1
| | | | | | | | Use the stdlib version directly instead Change-Id: Ib289b37c9a00b7da1926e20cc1c1b5a52388fb2f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Skip tst_QScriptEngine::collectGarbageOlivier Goffart2012-05-201-0/+1
| | | | | | | | | | | | This test is blocking CI. It is possible that depending on the optimisation flags, some pointers are still on the stack. This feature is also tested in tst_QScriptEngine::collectGarbageAfterConnect Change-Id: I264f634aa58a002738b8d9c87c43ee1790bb329a Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Remove the test generator for the test qscriptvaluegenerated.Friedemann Kleint2012-05-1611-1401/+0
| | | | | | | | | | The data will not be re-generated any more since the module is done. See also 58f53b807fafcadf76282f0c8c7f20451c7a97a5. Change-Id: Ida365dbb2e0a70b1cf7d5f0714e5df4cc7084d30 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove large, static QString[] arrays from test qscriptvaluegenerated.Friedemann Kleint2012-05-105-263/+173
| | | | | | | | | | | | They seems to trigger a compiler error for linux-arm-gnueabi-g++ (32bit). Use const char *-arrays and introduce utility functions to populate the static hashes, sets. Fix some string and iterator usage errors. Change-Id: I4e32c6ffa004e141bc04c3a2971c379f71072b38 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Change uses of {to,from}Ascii to {to,from}Latin1Thiago Macieira2012-05-031-14/+14
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I4f44512856ea99112d8eb6d341d6058c1fc439dc Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Port qtscript to QMetaMethod-based connectNotify()Kent Hansen2012-05-011-32/+43
| | | | | | | | | | | | | | The const char *-based API is deprecated and will be removed in Qt5. Also improve the autotest so we check precisely the number of connect/disconnect notifications received. The hacks to manually call the notify functions aren't needed anymore, because the internal QMetaObject::(dis)connect() now does it for us. Change-Id: I2e5efed34ee1cba0aad8e60ea00dc9bc2a25bc6c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fixed compile for removal of const from QRegExp::indexInRohan McGovern2012-04-301-1/+1
| | | | | | Task-number: QTBUG-25064 Change-Id: I8adfe68a610a37b667803939553739d64a714c51 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Remove insignification from qscriptjstestsuite test.Jason McDonald2012-04-261-2/+0
| | | | | | | | | | This test has not failed on Windows since CI testing on that platform began. Task-number: QTBUG-24426 Change-Id: I0cafb1bcf94fbd96d81bb4075e045ff434f58d28 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove insignification from qscriptv8testsuite test.Jason McDonald2012-04-261-2/+0
| | | | | | | | | | This test has not failed on Windows since CI testing on that platform began. Task-number: QTBUG-24427 Change-Id: I955eeb23b954d46b3b9170cd58fdc77493ab3476 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't use the QRegExp methods that modify the objectThiago Macieira2012-04-241-2/+4
| | | | | | | | | | | | | | QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I4f57d8df2e4de13aa95bb72da53c2565b38ae616 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Adapt qtscript to QMetaMethod::signature() renamingKent Hansen2012-04-171-2/+2
| | | | | | | | | | QMetaMethod::methodSignature() should be used instead, and it returns a QByteArray. Change-Id: I81150e238dab7eda26d0466ac407a4f3ba79a7c7 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Disable qtscriptengineagent autotest for non-developer buildsKai Koehne2012-03-151-1/+1
| | | | | | | | It uses qt_script_isJITEnabled , which is only exported with -developer-build. Change-Id: I1c3d69c82896b8b940b5913629b68227a66f9815 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Make QScriptValue QObject handling consistent.Stephen Kelly2012-03-061-1/+2
| | | | | | | | | | | The behaviour has been inconsistent since ae85d7c965e7d50404c056a77c73bfe00267fa12 in qtbase which added special handling of QObjects to QVariant. Change-Id: Ie75faa3cc3387cff8894cdba025c93f2cc2ea491 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Use new plugin system in QtScript.Friedemann Kleint2012-02-234-2/+9
| | | | | | | | | Add static plugin test and QtDBusScriptPlugin which were left over (see f1653db0f4b7ceba448a39dc16ba45c0f817ef5b). Change-Id: Ifd1e13882f7e39ce724a6e94732b238255ce3128 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Windows: Mark two failing QtScript tests insignificantMiikka Heikkinen2012-02-232-1/+3
| | | | | | | | | Once underlying issues are fixed, the tests need to be re-enabled. Task-number: QTBUG-24203 Change-Id: I38449fd3753f647abaaab24f8928d28fd921cdcb Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>