diff options
Diffstat (limited to 'tests/auto/qscriptv8testsuite')
-rw-r--r-- | tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 5 | ||||
-rw-r--r-- | tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 86 |
2 files changed, 58 insertions, 33 deletions
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 9e35801..3f641b5 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -1,11 +1,12 @@ load(qttest_p4) QT = core script SOURCES += tst_qscriptv8testsuite.cpp +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" -wince*: { +wince*|symbian: { testFiles.sources = tests testFiles.path = . DEPLOYMENT += testFiles } - +symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x02000000 diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 621382b..77fa826 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -45,9 +45,22 @@ #include <QtScript> +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= +// Uncomment the following define to have the autotest generate +// addExpectedFailure() code for all the tests that fail. +// This is useful when a whole new test (sub)suite is added. +// The code is stored in addexpectedfailures.cpp. +// Paste the contents into this file after the existing +// addExpectedFailure() calls. + +//#define GENERATE_ADDEXPECTEDFAILURE_CODE + static QString readFile(const QString &filename) { QFile file(filename); @@ -106,6 +119,9 @@ private: QList<ExpectedFailure> expectedFailures; QList<QPair<QRegExp, QString> > testExclusions; QString mjsunitContents; +#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE + QString generatedAddExpectedFailureCode; +#endif }; QMetaObject tst_Suite::staticMetaObject; @@ -175,6 +191,14 @@ int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a) QTest::Continue, path.toLatin1(), lineNumber); } +#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE + else { + generatedAddExpectedFailureCode.append( + " addExpectedFailure(\"" + name + + "\", \"" + actual + "\", \"" + expected + + "\", willFixInNextReleaseMessage);\n"); + } +#endif QTest::qCompare(actual, expected, "actual", "expect", path.toLatin1(), lineNumber); } else { @@ -193,7 +217,7 @@ int tst_Suite::qt_metacall(QMetaObject::Call _c, int _id, void **_a) tst_Suite::tst_Suite() { - testsDir = QDir("."); + testsDir = QDir(SRCDIR); bool testsFound = testsDir.cd("tests"); if (!testsFound) { qWarning("*** no tests/ dir!"); @@ -207,44 +231,18 @@ tst_Suite::tst_Suite() } } QString willFixInNextReleaseMessage = QString::fromLatin1("Will fix in next release"); - addExpectedFailure("apply", "morundefineder", "morseper", willFixInNextReleaseMessage); addExpectedFailure("arguments-enum", "2", "0", willFixInNextReleaseMessage); - addExpectedFailure("array-concat", "undefined", "baz", willFixInNextReleaseMessage); - addExpectedFailure("array-functions-prototype", "undefined", "one", willFixInNextReleaseMessage); addExpectedFailure("const-redecl", "undefined", "TypeError", willFixInNextReleaseMessage); - addExpectedFailure("const", "2", "1", willFixInNextReleaseMessage); - addExpectedFailure("declare-locally", "undefined", "42", willFixInNextReleaseMessage); - addExpectedFailure("delay-syntax-error", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("delete-vars-from-eval", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("dont-enum-array-holes", "4", "2", willFixInNextReleaseMessage); - addExpectedFailure("fun-as-prototype", "undefined", "Funky", willFixInNextReleaseMessage); - addExpectedFailure("fun_name", "function(){}", "functionanonymous(){}", willFixInNextReleaseMessage); - addExpectedFailure("function-caller", "undefined", "function f(match) {\n g(match);\n}", willFixInNextReleaseMessage); addExpectedFailure("global-const-var-conflicts", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("length", "3", "1", willFixInNextReleaseMessage); - addExpectedFailure("math-min-max", "-Infinity", "Infinity", willFixInNextReleaseMessage); - addExpectedFailure("newline-in-string", "asdf\n\nasdf\n?asdf\n\tasdf\n\\\n\n", "asdf\nasdf?asdf\tasdf\\", willFixInNextReleaseMessage); - addExpectedFailure("number-tostring", "1111111111111111081984.00000000", "1.1111111111111111e+21", willFixInNextReleaseMessage); - addExpectedFailure("parse-int-float", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("regexp-multiline-stack-trace", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("regexp-multiline", "false", "true", willFixInNextReleaseMessage); - addExpectedFailure("regexp-standalones", "0", "2", willFixInNextReleaseMessage); - addExpectedFailure("regexp-static", "undefined", "abc123.456def", willFixInNextReleaseMessage); - addExpectedFailure("sparse-array-reverse", "nopcb", "nopdcba", willFixInNextReleaseMessage); - addExpectedFailure("str-to-num", "false", "true", willFixInNextReleaseMessage); addExpectedFailure("string-lastindexof", "0", "-1", "test is wrong?"); - addExpectedFailure("string-split", "5", "13", "regular expression semantics"); -// addExpectedFailure("substr", "", "abcdefghijklmn", willFixInNextReleaseMessage); - addExpectedFailure("to-precision", "1.2345e+27", "1.23450e+27", willFixInNextReleaseMessage); - addExpectedFailure("try", "3", "4", "task 209990"); - addExpectedFailure("try_catch_scopes", "0", "1", "task 227055"); - addExpectedFailure("unusual-constructor", "false", "true", "no idea"); - addExpectedFailure("unicode-test", "13792", "13793", "test is wrong?"); - addExpectedFailure("with-leave", "false", "true", "task 233769"); addTestExclusion("debug-*", "not applicable"); addTestExclusion("mirror-*", "not applicable"); + addTestExclusion("array-concat", "Hangs on JSC backend"); + addTestExclusion("array-splice", "Hangs on JSC backend"); + addTestExclusion("sparse-array-reverse", "Hangs on JSC backend"); + addTestExclusion("string-case", "V8-specific behavior? (Doesn't pass on SpiderMonkey either)"); #ifdef Q_OS_WINCE @@ -254,6 +252,24 @@ tst_Suite::tst_Suite() addTestExclusion("mul-exhaustive", "Demands too much memory on WinCE"); #endif +#ifdef Q_OS_SYMBIAN + addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian"); + addTestExclusion("unicode-test", "Demands too much memory on Symbian"); +#endif + // Failures due to switch to JSC as back-end + addExpectedFailure("date-parse", "NaN", "946713600000", willFixInNextReleaseMessage); + addExpectedFailure("delete-global-properties", "true", "false", willFixInNextReleaseMessage); + addExpectedFailure("delete", "false", "true", willFixInNextReleaseMessage); + addExpectedFailure("function-arguments-null", "false", "true", willFixInNextReleaseMessage); + addExpectedFailure("function-caller", "null", "function eval() {\n [native code]\n}", willFixInNextReleaseMessage); + addExpectedFailure("function-prototype", "prototype", "disconnectconnect", willFixInNextReleaseMessage); + addExpectedFailure("number-tostring", "0", "0.0000a7c5ac471b4788", willFixInNextReleaseMessage); + addExpectedFailure("parse-int-float", "1e+21", "1", willFixInNextReleaseMessage); + addExpectedFailure("regexp", "false", "true", willFixInNextReleaseMessage); + addExpectedFailure("smi-negative-zero", "-Infinity", "Infinity", willFixInNextReleaseMessage); + addExpectedFailure("string-split", "4", "3", willFixInNextReleaseMessage); + addExpectedFailure("substr", "abcdefghijklmn", "", willFixInNextReleaseMessage); + static const char klass[] = "tst_QScriptV8TestSuite"; QVector<uint> *data = qt_meta_data_tst_Suite(); @@ -296,6 +312,14 @@ tst_Suite::tst_Suite() tst_Suite::~tst_Suite() { +#ifdef GENERATE_ADDEXPECTEDFAILURE_CODE + if (!generatedAddExpectedFailureCode.isEmpty()) { + QFile file("addexpectedfailures.cpp"); + file.open(QFile::WriteOnly); + QTextStream ts(&file); + ts << generatedAddExpectedFailureCode; + } +#endif } void tst_Suite::addExpectedFailure(const QString &testName, const QString &actual, |