aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/ecmascripttests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-02-01 14:38:38 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2022-06-10 17:19:37 +0200
commitb85374f7c015784cc48afc002e9a80545d7caefa (patch)
treef1bf97b20f9ce1b953679458e1821f7d60a1f476 /tests/auto/qml/ecmascripttests
parentdff02466a01caad885b6bd0759cf482342332306 (diff)
Make uninteresting JS-test output easier to ignore
The JS-tests produce so much output that it routinely surpasses the maximum number of debug messages testlib is willing to produce, after which it cuts off and we don't get to see the output of failing tests, which we actually need to see. Add a logging category, just for this test, and condition the boring bits on this category being enabled. Those are all qCDebug()s, so disable the category for debug by default. In the process, re-enable a commented-out qDebug() by converting it to use the new logging category (and fixing the bit-rot that it had suffered while commented out). This should mean any future Coin failures in this test are reported more usefully. If seeing all the PASS lines is really important to you, enable category "qt.v4.ecma262.tests" in your Qt logging options and pass -maxwarnings with a huge value when you run the test. Pick-to: 6.4 Change-Id: I8ba1f6575120fcef533ae756d31cc40635c13370 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/ecmascripttests')
-rw-r--r--tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
index fef6e97960..2b3dd698c3 100644
--- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
+++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the V4VM module of the Qt Toolkit.
@@ -38,6 +38,7 @@
#include "private/qv4globalobject_p.h"
#include "private/qqmlbuiltinfunctions_p.h"
#include "private/qv4arraybuffer_p.h"
+#include <QtCore/QLoggingCategory>
#include "qrunnable.h"
@@ -110,6 +111,9 @@ static void initD262(ExecutionEngine *e)
QT_END_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcJsTest);
+Q_LOGGING_CATEGORY(lcJsTest, "qt.v4.ecma262.tests", QtWarningMsg);
+
Test262Runner::Test262Runner(const QString &command, const QString &dir)
: command(command), testDir(dir)
{
@@ -665,10 +669,12 @@ void Test262Runner::addResult(TestCase result)
;
} else if (result.strictResult == TestCase::Crashes) {
qDebug() << "FAIL:" << test << "crashed in strict mode!";
- } else if ((result.strictResult == TestCase::Fails) && (result.strictExpectation == TestCase::Fails)) {
- qDebug() << "PASS:" << test << "failed in strict mode as expected";
- } else if ((result.strictResult == TestCase::Passes) == (result.strictExpectation == TestCase::Passes)) {
- qDebug() << "PASS:" << test << "passed in strict mode";
+ } else if (result.strictResult == TestCase::Fails
+ && result.strictExpectation == TestCase::Fails) {
+ qCDebug(lcJsTest) << "PASS:" << test << "failed in strict mode as expected";
+ } else if ((result.strictResult == TestCase::Passes)
+ == (result.strictExpectation == TestCase::Passes)) {
+ qCDebug(lcJsTest) << "PASS:" << test << "passed in strict mode";
} else if (!(result.strictExpectation == TestCase::Fails)) {
qDebug() << "FAIL:" << test << "failed in strict mode";
} else {
@@ -679,10 +685,12 @@ void Test262Runner::addResult(TestCase result)
;
} else if (result.sloppyResult == TestCase::Crashes) {
qDebug() << "FAIL:" << test << "crashed in sloppy mode!";
- } else if ((result.sloppyResult == TestCase::Fails) && (result.sloppyExpectation == TestCase::Fails)) {
- qDebug() << "PASS:" << test << "failed in sloppy mode as expected";
- } else if ((result.sloppyResult == TestCase::Passes) == (result.sloppyExpectation == TestCase::Passes)) {
- qDebug() << "PASS:" << test << "passed in sloppy mode";
+ } else if (result.sloppyResult == TestCase::Fails
+ && result.sloppyExpectation == TestCase::Fails) {
+ qCDebug(lcJsTest) << "PASS:" << test << "failed in sloppy mode as expected";
+ } else if ((result.sloppyResult == TestCase::Passes)
+ == (result.sloppyExpectation == TestCase::Passes)) {
+ qCDebug(lcJsTest) << "PASS:" << test << "passed in sloppy mode";
} else if (!(result.sloppyExpectation == TestCase::Fails)) {
qDebug() << "FAIL:" << test << "failed in sloppy mode";
} else {
@@ -700,7 +708,7 @@ TestData Test262Runner::getTestData(const TestCase &testCase)
QByteArray content = testFile.readAll();
content.replace(QByteArrayLiteral("\r\n"), "\n");
-// qDebug() << "parsing test file" << test;
+ qCDebug(lcJsTest) << "parsing test file" << testCase.test;
TestData data(testCase);
parseYaml(content, &data);