diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-17 13:25:12 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:20:07 +0000 |
commit | f665c9b25dde5d34f14a47f2aa52f8141bc03fd1 (patch) | |
tree | 8c32c1e2eecd96c99d2751fb922951e1d53c857f /tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp | |
parent | eca0b30f22903443ac0ca5a91830a6762c546b43 (diff) |
Use the new test runner for the autotest
It's quite a bit faster than the old test runner.
Change-Id: If7e59dd175d740f3f702032f4affeff786be8a32
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp')
-rw-r--r-- | tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp b/tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp index 0d58d045b9..27d2822762 100644 --- a/tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp +++ b/tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp @@ -30,55 +30,37 @@ #include <QtTest/QtTest> #include <QProcess> #include <QLibraryInfo> +#include <qjstest/test262runner.h> class tst_EcmaScriptTests : public QObject { Q_OBJECT - void runTests(bool interpret); - private slots: void runInterpreted(); void runJitted(); }; -void tst_EcmaScriptTests::runTests(bool interpret) -{ -#if defined(Q_OS_LINUX) && defined(Q_PROCESSOR_X86_64) - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - if (interpret) - env.insert("QV4_FORCE_INTERPRETER", "1"); - else - env.insert("QV4_JIT_CALL_THRESHOLD", "0"); - - QProcess process; - process.setProcessChannelMode(QProcess::ForwardedChannels); - process.setWorkingDirectory(QLatin1String(SRCDIR)); - process.setProgram("python"); - process.setProcessEnvironment(env); - process.setArguments(QStringList() << "test262.py" << "--command=" + QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmljs" << "--parallel" << "--with-test-expectations"); - - qDebug() << "Going to run" << process.program() << process.arguments() << "in" << process.workingDirectory(); - - process.start(); - QVERIFY(process.waitForStarted()); - const int timeoutInMSecs = 20 * 60 * 1000; - QVERIFY2(process.waitForFinished(timeoutInMSecs), "Tests did not terminate in time -- see output above for details"); - QVERIFY2(process.exitStatus() == QProcess::NormalExit, "Running the test harness failed -- see output above for details"); - QVERIFY2(process.exitCode() == 0, "Tests failed -- see output above for details"); -#else - QSKIP("Currently the ecmascript tests are only run on Linux/x86-64"); -#endif -} - void tst_EcmaScriptTests::runInterpreted() { - runTests(true); +#if defined(Q_PROCESSOR_X86_64) + QDir::setCurrent(QLatin1String(SRCDIR)); + Test262Runner runner(QString(), "test262"); + runner.setFlags(Test262Runner::ForceBytecode|Test262Runner::WithTestExpectations|Test262Runner::Parallel|Test262Runner::Verbose); + bool result = runner.run(); + QVERIFY(result); +#endif } void tst_EcmaScriptTests::runJitted() { - runTests(false); +#if defined(Q_PROCESSOR_X86_64) + QDir::setCurrent(QLatin1String(SRCDIR)); + Test262Runner runner(QString(), "test262"); + runner.setFlags(Test262Runner::ForceJIT|Test262Runner::WithTestExpectations|Test262Runner::Parallel|Test262Runner::Verbose); + bool result = runner.run(); + QVERIFY(result); +#endif } QTEST_GUILESS_MAIN(tst_EcmaScriptTests) |