aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-02-01 14:38:38 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-10 20:41:07 +0000
commit4672e05f1352a8e5744ae121767d6857c3e11de8 (patch)
treec99e8eb82f2196abde12a5d0bf3a9f35d5e65a3b
parent5565c023e9c5c3f7cf8e45e05a4607699280f013 (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. Change-Id: I8ba1f6575120fcef533ae756d31cc40635c13370 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b85374f7c015784cc48afc002e9a80545d7caefa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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);