summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp')
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index 886c70b..f515304 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -49,6 +49,10 @@
//TESTED_CLASS=
//TESTED_FILES=
+QT_BEGIN_NAMESPACE
+extern bool qt_script_isJITEnabled();
+QT_END_NAMESPACE
+
class tst_QScriptEngineAgent : public QObject
{
Q_OBJECT
@@ -557,6 +561,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionCall()
spy->clear();
QVERIFY(eng.evaluate("(function() { return 123; } )()").toNumber()==123);
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "functionExit() is not called for JS functions when JIT is enabled", Abort);
QCOMPARE(spy->count(), 4);
// evaluate() entry
@@ -592,6 +598,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionCallWithoutReturn()
spy->clear();
eng.evaluate("(function() { var a = 123; } )()");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "functionExit() is not called for JS functions when JIT is enabled", Abort);
QCOMPARE(spy->count(), 4);
// evaluate() entry
@@ -634,6 +642,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionDefinition()
QVERIFY(spy->at(1).value.isUndefined());
eng.evaluate("foo()");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "functionExit() is not called for JS functions when JIT is enabled", Abort);
QCOMPARE(spy->count(), 6);
// evaluate() entry
@@ -709,6 +719,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_native2()
spy->clear();
eng.evaluate("nativeFunctionCallingArg(function() { return 123; })");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "functionExit() is not called for JS functions when JIT is enabled", Abort);
QCOMPARE(spy->count(), 6);
// evaluate() entry
@@ -797,6 +809,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_builtin()
spy->clear();
eng.evaluate("'ciao'.toString()");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 4);
// evaluate() entry
@@ -1021,6 +1035,8 @@ void tst_QScriptEngineAgent::functionEntryAndExit_call()
spy->clear();
fun.call();
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "functionExit() is not called for JS functions when JIT is enabled", Abort);
QCOMPARE(spy->count(), 2);
// entry
@@ -1575,6 +1591,8 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch()
{
spy->clear();
eng.evaluate("try { throw new Error('ciao'); } catch (e) { }");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 2);
QCOMPARE(spy->at(0).type, ScriptEngineEvent::ExceptionThrow);
@@ -1632,6 +1650,8 @@ void tst_QScriptEngineAgent::eventOrder_functionDefinition()
QCOMPARE(spy->at(2).type, ScriptEngineEvent::FunctionExit);
eng.evaluate("foo(123)");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 13);
// load
QCOMPARE(spy->at(3).type, ScriptEngineEvent::ScriptLoad);
@@ -1708,6 +1728,8 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch()
{
spy->clear();
eng.evaluate("try { throw new Error('ciao') } catch (e) { void(e); }");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 12);
// load
QCOMPARE(spy->at(0).type, ScriptEngineEvent::ScriptLoad);
@@ -1752,6 +1774,8 @@ void tst_QScriptEngineAgent::eventOrder_functions()
QCOMPARE(spy->count(), 6);
eng.evaluate("foo(123)");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 21);
// load
@@ -1876,6 +1900,8 @@ void tst_QScriptEngineAgent::eventOrder_throwCatchFinally()
{
spy->clear();
eng.evaluate("try { throw 1; } catch(e) { i = e; } finally { i = 2; }");
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 9);
// load