From cea2b5510c28d1057018007d65589fecee62b0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Fri, 19 Oct 2018 12:39:12 +0200 Subject: Fix building tests with -no-gui Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746 Reviewed-by: Oswald Buddenhagen --- tests/auto/testlib/selftests/selftests.pri | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 498d1653c0..05ed6d9905 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -27,10 +27,8 @@ SUBPROGRAMS = \ findtestdata \ float \ globaldata \ - keyboard \ longstring \ maxwarnings \ - mouse \ multiexec \ pairdiagnostics \ printdatatags \ @@ -52,5 +50,9 @@ SUBPROGRAMS = \ warnings \ xunit +qtHaveModule(gui): SUBPROGRAMS += \ + keyboard \ + mouse + INCLUDEPATH += ../../../../shared/ HEADERS += ../../../../shared/emulationdetector.h -- cgit v1.2.3 From 30101884a6f3ab2f3d4d11426373eca3fca10652 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 17 Oct 2018 19:32:54 +0200 Subject: Simplify tst_Selftests::compareLine by handling the trivial case first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the two lines have identical texts, the comparison returns true. So don't complicate various other conditions on the way there with filtering out that case; deal with it first so they don't need to. Change-Id: Iebd230704ce5f53d12d5afa64aab30f83bb9d407 Reviewed-by: Jędrzej Nowacki --- tests/auto/testlib/selftests/tst_selftests.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index c5f847562e..2d3cfaf176 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -893,16 +893,19 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, const QString &actualLine, const QString &expectedLine, QString *errorMessage) const { - if (subdir == QLatin1String("assert") && actualLine.contains(QLatin1String("ASSERT: ")) - && expectedLine.contains(QLatin1String("ASSERT: ")) && actualLine != expectedLine) { + if (actualLine == expectedLine) + return true; + + if (subdir == QLatin1String("assert") + && actualLine.contains(QLatin1String("ASSERT: ")) + && expectedLine.contains(QLatin1String("ASSERT: "))) { // Q_ASSERT uses __FILE__, the exact contents of which are // undefined. If have we something that looks like a Q_ASSERT and we // were expecting to see a Q_ASSERT, we'll skip the line. return true; } - if (expectedLine.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce")) - && actualLine != expectedLine) { + if (expectedLine.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce"))) { // On some platforms we compile without RTTI, and as a result we never throw an exception if (actualLine.simplified() != QLatin1String("tst_Exception::throwException()")) { *errorMessage = QString::fromLatin1("'%1' != 'tst_Exception::throwException()'").arg(actualLine); @@ -941,9 +944,6 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:"))) return true; - if (actualLine == expectedLine) - return true; - *errorMessage = msgMismatch(actualLine, expectedLine); return false; } -- cgit v1.2.3 From b22e50acda53d32f5df12a8567a0c5f206e203ad Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 15 Oct 2018 19:48:13 +0200 Subject: generate_expected_output.py: match tst_selftest's test environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The testlib selftest sets various things in the environment for crashing tests; the generator for its expected output should set the same things, as they affect what output is produced. Change-Id: Iec2ed59982ea1043582573530c33619d8e8ed08e Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/generate_expected_output.py | 23 ++++++++++++++++++++-- tests/auto/testlib/selftests/tst_selftests.cpp | 3 +++ 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 1996416e8c..3c5f922c75 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -223,6 +223,7 @@ del re def generateTestData(testname, clean, formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity', 'tap'), + # Make sure this matches tst_Selftests::runSubTest_data(): extraArgs = { "commandlinedata": "fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2", "benchlibcallgrind": "-callgrind", @@ -236,7 +237,15 @@ def generateTestData(testname, clean, "silent": "-silent", "verbose1": "-v1", "verbose2": "-v2", - }): + }, + # Make sure this matches tst_Selftests::doRunSubTest(): + extraEnv = { + "crashes": { "QTEST_DISABLE_CORE_DUMP": "1", "QTEST_DISABLE_STACK_DUMP": "1" }, + }, + # These are actually *other* crashers, beside those in extraEnv; + # must match tst_Selftests::runSubTest_data(): + crashers = ("assert", "blacklisted", "crashedterminate", + "exceptionthrow", "fetchbogus", "silent")): """Run one test and save its cleaned results. Required arguments are the name of the test directory (the binary @@ -248,6 +257,16 @@ def generateTestData(testname, clean, if not os.path.isfile(path): print("Warning: directory", testname, "contains no test executable") return + env = None + try: + env = extraEnv[testname] + except KeyError: + if env in crashers: + env = extraEnv["crashes"] + if env: + data = os.environ.copy() + data.update(env) + env = data print(" running", testname) for format in formats: @@ -255,7 +274,7 @@ def generateTestData(testname, clean, if testname in extraArgs: cmd += extraArgs[testname].split() - data = subprocess.Popen(cmd, stdout=subprocess.PIPE, + data = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env, universal_newlines=True).communicate()[0] with open('expected_' + testname + '.' + format, 'w') as out: out.write('\n'.join(clean(data))) # write() appends a newline, too diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 2d3cfaf176..008cce6218 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -520,6 +520,7 @@ void tst_Selftests::runSubTest_data() foreach (QString const& subtest, tests) { QStringList arguments = loggerSet.arguments; + // Keep in sync with generateTestData()'s extraArgs in generate_expected_output.py: if (subtest == "commandlinedata") { arguments << QString("fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2").split(' '); } @@ -612,6 +613,7 @@ void tst_Selftests::runSubTest_data() if (loggerSet.name.contains("teamcity") && subtest.startsWith("benchlib")) continue; // Skip benchmark for TeamCity logger + // Keep in sync with generateTestData()'s crashers in generate_expected_output.py: const bool crashes = subtest == QLatin1String("assert") || subtest == QLatin1String("exceptionthrow") || subtest == QLatin1String("fetchbogus") || subtest == QLatin1String("crashedterminate") || subtest == QLatin1String("crashes") || subtest == QLatin1String("silent") @@ -687,6 +689,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QProcess proc; QProcessEnvironment environment = processEnvironment(); + // Keep in sync with generateTestData()'s extraEnv in generate_expected_output.py: if (crashes) { environment.insert("QTEST_DISABLE_CORE_DUMP", "1"); environment.insert("QTEST_DISABLE_STACK_DUMP", "1"); -- cgit v1.2.3 From 33d7f76f0e847d7e0fb00dd6056e7bba45b8b1e7 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 11 Oct 2018 15:11:38 +0200 Subject: Tweak a selftest blacklist to exercise more of the blacklisting code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the process, corrected an inaccurate XFAIL message (an XPASS is normally an error, unless blacklisting ignores it so turns it into a BPASS). Added the missing .tap file to its expected output. Documented the similarity to the silent/ selftest. Task-number: QTPM-1385 Change-Id: Id74a1353d54af2f3bfe2c764e33c1f051958ab21 Reviewed-by: Jędrzej Nowacki --- tests/auto/testlib/selftests/blacklisted/BLACKLIST | 14 +++++-- .../selftests/blacklisted/tst_blacklisted.cpp | 5 ++- .../selftests/expected_blacklisted.lightxml | 2 +- .../testlib/selftests/expected_blacklisted.tap | 43 ++++++++++++++++++++++ .../selftests/expected_blacklisted.teamcity | 2 +- .../testlib/selftests/expected_blacklisted.txt | 2 +- .../testlib/selftests/expected_blacklisted.xml | 2 +- .../selftests/expected_blacklisted.xunitxml | 4 +- 8 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 tests/auto/testlib/selftests/expected_blacklisted.tap (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/blacklisted/BLACKLIST b/tests/auto/testlib/selftests/blacklisted/BLACKLIST index 36b7699cbd..a923c11416 100644 --- a/tests/auto/testlib/selftests/blacklisted/BLACKLIST +++ b/tests/auto/testlib/selftests/blacklisted/BLACKLIST @@ -1,12 +1,20 @@ -[pass] +obscure # no such platform; is ignored * + +[pass] +!* + [skip] * + [fail] * -[xpass] -* + [xfail] * + +[xpass] +* + [messages] * diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp index 8578752e22..90520385ec 100644 --- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp +++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp @@ -45,7 +45,8 @@ private slots: void messages(); }; -// All the tests below have been blacklisted in blacklisted/BLACKLIST +// All the tests below except pass() have been blacklisted in blacklisted/BLACKLIST +// Contrast with ../silent/, for the same tests without blacklisting but with -silent void tst_Blacklisted::pass() { @@ -64,7 +65,7 @@ void tst_Blacklisted::fail() void tst_Blacklisted::xfail() { - QEXPECT_FAIL("", "This test should XFAIL then BFAIL", Abort); + QEXPECT_FAIL("", "This test should XFAIL then BPASS", Abort); QVERIFY(false); } diff --git a/tests/auto/testlib/selftests/expected_blacklisted.lightxml b/tests/auto/testlib/selftests/expected_blacklisted.lightxml index 4193628e7c..98d7a38ca9 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.lightxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.lightxml @@ -25,7 +25,7 @@ - + diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap new file mode 100644 index 0000000000..f26155ded0 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_blacklisted.tap @@ -0,0 +1,43 @@ +TAP version 13 +# tst_Blacklisted +ok 1 - initTestCase() +ok 2 - pass() # TODO +ok 3 - skip() # SKIP This test should SKIP +not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL) + --- + type: QVERIFY + message: This test should BFAIL + wanted: true (false) + found: false (false) + expected: true (false) + actual: false (false) + at: tst_Blacklisted::fail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:63) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 63 + ... +not ok 5 - xfail() # TODO This test should XFAIL then BPASS + --- + at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:69) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 69 + ... +ok 5 - xfail() # TODO +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS) +# This is a warning that should not appear in silent test output +# This is an internal testlib warning that should not appear in silent test output +# This is a debug message that should not appear in silent test output +# This is a critical message that should not appear in silent test output +# This is an info message that should not appear in silent test output +# This is an internal testlib info message that should not appear in silent test output +# This is a fatal error message that should still appear in silent test output +not ok 7 - messages() # TODO Received a fatal error. + --- + # Received a fatal error. + at: tst_Blacklisted::messages() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..7 +# tests 7 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_blacklisted.teamcity b/tests/auto/testlib/selftests/expected_blacklisted.teamcity index 8180a7ce76..df58208fb3 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.teamcity +++ b/tests/auto/testlib/selftests/expected_blacklisted.teamcity @@ -7,7 +7,7 @@ ##teamcity[testStarted name='fail()' flowId='tst_Blacklisted'] ##teamcity[testFinished name='fail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xfail()' flowId='tst_Blacklisted'] -##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BFAIL' flowId='tst_Blacklisted'] +##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BPASS' flowId='tst_Blacklisted'] ##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xpass()' flowId='tst_Blacklisted'] ##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)' flowId='tst_Blacklisted'] diff --git a/tests/auto/testlib/selftests/expected_blacklisted.txt b/tests/auto/testlib/selftests/expected_blacklisted.txt index 6fa2403b59..3cfe40eb12 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.txt +++ b/tests/auto/testlib/selftests/expected_blacklisted.txt @@ -6,7 +6,7 @@ SKIP : tst_Blacklisted::skip() This test should SKIP Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BFAIL : tst_Blacklisted::fail() 'false' returned FALSE. (This test should BFAIL) Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] -XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BFAIL +XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BPASS Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BPASS : tst_Blacklisted::xfail() XPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS) diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xml b/tests/auto/testlib/selftests/expected_blacklisted.xml index 443bc6b199..f0387bae00 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xml @@ -27,7 +27,7 @@ - + diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml index 2752bc18b4..e2d0cd009b 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + -- cgit v1.2.3 From d0f909f8dbdd8594b0d950822f0e7ab8728da513 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 26 Oct 2018 20:38:58 +0200 Subject: QTreeView/TableView: explicitly mark sortByColumn(int) as deprecated QTreeView/TableView::sortByColumn(int) was deprecated a long time ago but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13) so we can remove it with Qt6. Also sync the handling of the sort order changes in QTableView with the one from QTreeView. Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36 Reviewed-by: Luca Beldi Reviewed-by: Richard Moe Gustavsen --- .../testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp index 0593ae74bf..d37d332939 100644 --- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp +++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp @@ -81,7 +81,7 @@ void tst_QAbstractItemModelTester::treeWidgetModel() new QTreeWidgetItem(parent, QStringList("child")); widget.setItemHidden(parent, true); - widget.sortByColumn(0); + widget.sortByColumn(0, Qt::AscendingOrder); } void tst_QAbstractItemModelTester::standardItemModel() -- cgit v1.2.3 From 3e36fb641e15b92826792daf9153bbab7573a6f1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 15 Oct 2018 19:51:46 +0200 Subject: Test and document QTest::toHexRepresentation() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not actually exercised by anything in our source tree, but is potentially useful and has been part of the documented public API for some time. So mention that the caller is responsible for delete[]ing its return and add a test that exercises it. Task-number: QTPM-1385 Change-Id: Ifc5284b9eb1b678cf3c9708c681311e874838fc6 Reviewed-by: Jędrzej Nowacki --- tests/auto/testlib/outformat/outformat.pro | 7 +++ tests/auto/testlib/outformat/tst_outformat.cpp | 71 ++++++++++++++++++++++++++ tests/auto/testlib/testlib.pro | 7 +-- 3 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 tests/auto/testlib/outformat/outformat.pro create mode 100644 tests/auto/testlib/outformat/tst_outformat.cpp (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/outformat/outformat.pro b/tests/auto/testlib/outformat/outformat.pro new file mode 100644 index 0000000000..ea02f3167f --- /dev/null +++ b/tests/auto/testlib/outformat/outformat.pro @@ -0,0 +1,7 @@ +CONFIG += testcase +QT = core testlib + +SOURCES += tst_outformat.cpp +TARGET = outformat + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/outformat/tst_outformat.cpp b/tests/auto/testlib/outformat/tst_outformat.cpp new file mode 100644 index 0000000000..5d131159a9 --- /dev/null +++ b/tests/auto/testlib/outformat/tst_outformat.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +class tst_OutFormat : public QObject +{ + Q_OBJECT +private slots: + void toHex_data() const; + void toHex() const; + // other formats of interest ? +}; + +void tst_OutFormat::toHex_data() const +{ + QTest::addColumn("raw"); + QTest::addColumn("hex"); + + QTest::newRow("empty") << QByteArray("") << QByteArray(""); + QTest::newRow("long") + << QByteArray("Truncates in ellipsis when more than fifty characters long") + << QByteArray("54 72 75 6E 63 61 74 65 73 20 69 6E 20 65 6C 6C " + "69 70 73 69 73 20 77 68 65 6E 20 6D 6F 72 65 20 " + "74 68 61 6E 20 66 69 66 74 79 20 63 68 61 72 61 " + "63 74 ..."); + QTest::newRow("spaces") + << QByteArray(" \t\n\v\f\r") << QByteArray("20 09 0A 0B 0C 0D"); + QTest::newRow("ASCII-escapes") + << QByteArray("\a\b\\\"'\177") << QByteArray("07 08 5C 22 27 7F"); + // These are the ISO Latin-15  , pound, Euro, ..., y-umlaut + QTest::newRow("8-bit-sampler") + << QByteArray("\240\243\244\261\327\360\377") << QByteArray("A0 A3 A4 B1 D7 F0 FF"); +} + +void tst_OutFormat::toHex() const +{ + QFETCH(QByteArray, raw); + QFETCH(QByteArray, hex); + QScopedArrayPointer repr(QTest::toHexRepresentation(raw.constData(), raw.size())); + QCOMPARE(repr.data(), hex); +} + +QTEST_APPLESS_MAIN(tst_OutFormat) + +#include "tst_outformat.moc" diff --git a/tests/auto/testlib/testlib.pro b/tests/auto/testlib/testlib.pro index 25ccc591d6..587c76a189 100644 --- a/tests/auto/testlib/testlib.pro +++ b/tests/auto/testlib/testlib.pro @@ -1,6 +1,7 @@ -TEMPLATE=subdirs -SUBDIRS=\ +TEMPLATE = subdirs +SUBDIRS = \ + outformat \ qsignalspy \ selftests \ -qtHaveModule(widgets):SUBDIRS += qabstractitemmodeltester +qtHaveModule(widgets): SUBDIRS += qabstractitemmodeltester -- cgit v1.2.3 From 76bb804405f424708fffec502788995ea91206b8 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 31 Oct 2018 22:10:35 +0100 Subject: QTreeWidget: mark (is|set)Item(Selected|Hidden|Expanded) as deprecated QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated for a long time but not marked as such. Therefore explicitly mark them as deprecated so they can get removed with Qt6. Change-Id: Ie4971350de61326811e0788df0d359ed3c442869 Reviewed-by: Konstantin Shegunov Reviewed-by: Richard Moe Gustavsen --- .../testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp index d37d332939..60aa350145 100644 --- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp +++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp @@ -79,7 +79,7 @@ void tst_QAbstractItemModelTester::treeWidgetModel() root->removeChild(remove); QTreeWidgetItem *parent = new QTreeWidgetItem(&widget, QStringList("parent")); new QTreeWidgetItem(parent, QStringList("child")); - widget.setItemHidden(parent, true); + parent->setHidden(true); widget.sortByColumn(0, Qt::AscendingOrder); } -- cgit v1.2.3 From 27fb51fa529fb6501acfd4495adf597db326bb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 6 Nov 2018 14:16:05 +0100 Subject: macOS: Remove blacklist entries for no longer supported OS versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iae6552f1fdcf1dea07a03d3788d378af9140d1a7 Reviewed-by: Morten Johan Sørvig --- tests/auto/testlib/selftests/test/BLACKLIST | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tests/auto/testlib/selftests/test/BLACKLIST (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/test/BLACKLIST b/tests/auto/testlib/selftests/test/BLACKLIST deleted file mode 100644 index 2d4adf1feb..0000000000 --- a/tests/auto/testlib/selftests/test/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -#QTBUG-55155 -[runSubTest:maxwarnings all loggers] -osx-10.11 -- cgit v1.2.3 From 37f617c405ae4f26cbb6bb4f08d61d6ccc111a98 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 9 Nov 2018 14:05:35 +0100 Subject: Add qfloat16 support to QCOMPARE Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- .../auto/testlib/selftests/expected_float.lightxml | 27 ++++++++ tests/auto/testlib/selftests/expected_float.tap | 78 ++++++++++++++++------ .../auto/testlib/selftests/expected_float.teamcity | 13 ++++ tests/auto/testlib/selftests/expected_float.txt | 16 ++++- tests/auto/testlib/selftests/expected_float.xml | 27 ++++++++ .../auto/testlib/selftests/expected_float.xunitxml | 13 +++- tests/auto/testlib/selftests/float/tst_float.cpp | 39 +++++++++++ 7 files changed, 191 insertions(+), 22 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml index 0dbc5dd8c8..37ccbfc2c5 100644 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ b/tests/auto/testlib/selftests/expected_float.lightxml @@ -34,6 +34,33 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap index fae2dc9796..158eff1470 100644 --- a/tests/auto/testlib/selftests/expected_float.tap +++ b/tests/auto/testlib/selftests/expected_float.tap @@ -10,9 +10,9 @@ not ok 3 - floatComparisons(should FAIL 1) found: 1 (operandLeft) expected: 3 (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... not ok 4 - floatComparisons(should FAIL 2) --- @@ -22,9 +22,9 @@ not ok 4 - floatComparisons(should FAIL 2) found: 1e-07 (operandLeft) expected: 3e-07 (operandRight) actual: 1e-07 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... not ok 5 - floatComparisons(should FAIL 3) --- @@ -34,12 +34,50 @@ not ok 5 - floatComparisons(should FAIL 3) found: 99998 (operandLeft) expected: 99999 (operandRight) actual: 99998 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... ok 6 - floatComparisons(should SUCCEED 2) -not ok 7 - compareFloatTests(1e0) +ok 7 - float16Comparisons(should SUCCEED 1) +not ok 8 - float16Comparisons(should FAIL 1) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 3 (operandRight) + found: 1 (operandLeft) + expected: 3 (operandRight) + actual: 1 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +not ok 9 - float16Comparisons(should FAIL 2) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 0.0003 (operandRight) + found: 0.0001 (operandLeft) + expected: 0.0003 (operandRight) + actual: 0.0001 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +not ok 10 - float16Comparisons(should FAIL 3) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 99 (operandRight) + found: 98 (operandLeft) + expected: 99 (operandRight) + actual: 98 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +ok 11 - float16Comparisons(should SUCCEED 2) +not ok 12 - compareFloatTests(1e0) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -47,11 +85,11 @@ not ok 7 - compareFloatTests(1e0) found: 1 (t1) expected: 3 (t3) actual: 1 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -not ok 8 - compareFloatTests(1e-7) +not ok 13 - compareFloatTests(1e-7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -59,11 +97,11 @@ not ok 8 - compareFloatTests(1e-7) found: 1e-07 (t1) expected: 3e-07 (t3) actual: 1e-07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -not ok 9 - compareFloatTests(1e+7) +not ok 14 - compareFloatTests(1e+7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -71,12 +109,12 @@ not ok 9 - compareFloatTests(1e+7) found: 1e+07 (t1) expected: 3e+07 (t3) actual: 1e+07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -ok 10 - cleanupTestCase() -1..10 -# tests 10 -# pass 4 -# fail 6 +ok 15 - cleanupTestCase() +1..15 +# tests 15 +# pass 6 +# fail 9 diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity index d5b81593d8..140dc7edf9 100644 --- a/tests/auto/testlib/selftests/expected_float.teamcity +++ b/tests/auto/testlib/selftests/expected_float.teamcity @@ -14,6 +14,19 @@ ##teamcity[testFinished name='floatComparisons(should FAIL 3)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should SUCCEED 1)' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should SUCCEED 1)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.0001|n Expected (operandRight): 0.0003' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 98|n Expected (operandRight): 99' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should SUCCEED 2)' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should SUCCEED 2)' flowId='tst_float'] ##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float'] ##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float'] ##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float'] diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt index 8abea6a67e..4e3554758d 100644 --- a/tests/auto/testlib/selftests/expected_float.txt +++ b/tests/auto/testlib/selftests/expected_float.txt @@ -15,6 +15,20 @@ FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the Expected (operandRight): 99999 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should SUCCEED 2) +PASS : tst_float::float16Comparisons(should SUCCEED 1) +FAIL! : tst_float::float16Comparisons(should FAIL 1) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::float16Comparisons(should FAIL 2) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 0.0001 + Expected (operandRight): 0.0003 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::float16Comparisons(should FAIL 3) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 98 + Expected (operandRight): 99 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::float16Comparisons(should SUCCEED 2) FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare) Actual (t1): 1 Expected (t3): 3 @@ -28,5 +42,5 @@ FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fu Expected (t3): 3e+07 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::cleanupTestCase() -Totals: 4 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms +Totals: 6 passed, 9 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_float ********* diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml index 096e1a5b54..1f17d48d1b 100644 --- a/tests/auto/testlib/selftests/expected_float.xml +++ b/tests/auto/testlib/selftests/expected_float.xml @@ -36,6 +36,33 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml index 5de14e8d9b..87f11ccba5 100644 --- a/tests/auto/testlib/selftests/expected_float.xunitxml +++ b/tests/auto/testlib/selftests/expected_float.xunitxml @@ -1,5 +1,5 @@ - + @@ -17,6 +17,17 @@ Actual (operandLeft) : 99998 Expected (operandRight): 99999" result="fail"/> + + + + + ("operandRight"); + + QTest::newRow("should SUCCEED 1") + << qfloat16(0) + << qfloat16(0); + + QTest::newRow("should FAIL 1") + << qfloat16(1.000) + << qfloat16(3.000); + + QTest::newRow("should FAIL 2") + << qfloat16(1.000e-4f) + << qfloat16(3.000e-4f); + + // QCOMPARE for qfloat16s uses qFuzzyCompare() + + QTest::newRow("should FAIL 3") + << qfloat16(98) + << qfloat16(99); + + QTest::newRow("should SUCCEED 2") + << qfloat16(1001) + << qfloat16(1002); +} + void tst_float::compareFloatTests() const { QFETCH(float, t1); -- cgit v1.2.3 From 71bd06d516a2410ae0ea698e79dcb94aba9bc5b4 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Wed, 13 Jun 2018 16:35:40 +0300 Subject: Make developer build tests pass for boot2qt Some tests were fixed and others were skipped/blacklisted. Task-number: QTBUG-63152 Change-Id: Ica7df555f8d152ee589865911130525101d4b941 Reviewed-by: Liang Qi --- tests/auto/testlib/selftests/tst_selftests.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 63e5721e7e..26e3ccd0fb 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -659,6 +659,9 @@ static inline QByteArray msgProcessError(const QString &binary, const QStringLis void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& loggers, QStringList const& arguments, bool crashes) { + if (EmulationDetector::isRunningArmOnX86() && (subdir == "crashes")) + QSKIP("Skipping \"crashes\" due to QTBUG-71915"); + #if defined(__GNUC__) && defined(__i386) && defined(Q_OS_LINUX) if (arguments.contains("-callgrind")) { QProcess checkProcess; -- cgit v1.2.3 From dfcb7fce358269bb71e701efe17e5b3beddac951 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 11 Oct 2018 17:26:57 +0200 Subject: Test that mismatches of datatype in test data columns are rejected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One test for bad data for the column, another for a bad QFETCH. Incidentally extend blacklist testing by blacklisting them. Reorganise a QEMU condition that needed extended as part of this. Task-number: QTPM-1385 Change-Id: Iac72ada19760321c5c9264ddfff7740d1fdd0700 Reviewed-by: Jędrzej Nowacki --- .../selftests/expected_faildatatype.lightxml | 22 +++++++++ .../testlib/selftests/expected_faildatatype.tap | 16 ++++++ .../selftests/expected_faildatatype.teamcity | 8 +++ .../testlib/selftests/expected_faildatatype.txt | 9 ++++ .../testlib/selftests/expected_faildatatype.xml | 25 ++++++++++ .../selftests/expected_faildatatype.xunitxml | 18 +++++++ .../selftests/expected_failfetchtype.lightxml | 21 ++++++++ .../testlib/selftests/expected_failfetchtype.tap | 15 ++++++ .../selftests/expected_failfetchtype.teamcity | 8 +++ .../testlib/selftests/expected_failfetchtype.txt | 8 +++ .../testlib/selftests/expected_failfetchtype.xml | 24 +++++++++ .../selftests/expected_failfetchtype.xunitxml | 16 ++++++ .../auto/testlib/selftests/faildatatype/BLACKLIST | 4 ++ .../selftests/faildatatype/faildatatype.pro | 9 ++++ .../selftests/faildatatype/tst_faildatatype.cpp | 57 ++++++++++++++++++++++ .../auto/testlib/selftests/failfetchtype/BLACKLIST | 4 ++ .../selftests/failfetchtype/failfetchtype.pro | 9 ++++ .../selftests/failfetchtype/tst_failfetchtype.cpp | 55 +++++++++++++++++++++ .../testlib/selftests/generate_expected_output.py | 4 +- tests/auto/testlib/selftests/selftests.pri | 2 + tests/auto/testlib/selftests/tst_selftests.cpp | 23 ++++++--- 21 files changed, 347 insertions(+), 10 deletions(-) create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.lightxml create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.tap create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.teamcity create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.txt create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.xml create mode 100644 tests/auto/testlib/selftests/expected_faildatatype.xunitxml create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.lightxml create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.tap create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.teamcity create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.txt create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.xml create mode 100644 tests/auto/testlib/selftests/expected_failfetchtype.xunitxml create mode 100644 tests/auto/testlib/selftests/faildatatype/BLACKLIST create mode 100644 tests/auto/testlib/selftests/faildatatype/faildatatype.pro create mode 100644 tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp create mode 100644 tests/auto/testlib/selftests/failfetchtype/BLACKLIST create mode 100644 tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro create mode 100644 tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_faildatatype.lightxml b/tests/auto/testlib/selftests/expected_faildatatype.lightxml new file mode 100644 index 0000000000..24992b78af --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.lightxml @@ -0,0 +1,22 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_faildatatype.tap b/tests/auto/testlib/selftests/expected_faildatatype.tap new file mode 100644 index 0000000000..684cea4126 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.tap @@ -0,0 +1,16 @@ +TAP version 13 +# tst_FailDataType +ok 1 - initTestCase() +# expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string' +# ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0 +not ok 2 - value() + --- + # Received a fatal error. + at: tst_FailDataType::value() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_faildatatype.teamcity b/tests/auto/testlib/selftests/expected_faildatatype.teamcity new file mode 100644 index 0000000000..82731ae09e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_FailDataType' flowId='tst_FailDataType'] +##teamcity[testStarted name='initTestCase()' flowId='tst_FailDataType'] +##teamcity[testFinished name='initTestCase()' flowId='tst_FailDataType'] +##teamcity[testStarted name='value()' flowId='tst_FailDataType'] +##teamcity[testFailed name='value()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_FailDataType'] +##teamcity[testStdOut name='value()' out='QDEBUG: expected data of type |'QString|', got |'bool|' for element 0 of data with tag |'bool-as-string|'|nQFATAL: ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0' flowId='tst_FailDataType'] +##teamcity[testFinished name='value()' flowId='tst_FailDataType'] +##teamcity[testSuiteFinished name='tst_FailDataType' flowId='tst_FailDataType'] diff --git a/tests/auto/testlib/selftests/expected_faildatatype.txt b/tests/auto/testlib/selftests/expected_faildatatype.txt new file mode 100644 index 0000000000..4cfe3b7654 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.txt @@ -0,0 +1,9 @@ +********* Start testing of tst_FailDataType ********* +Config: Using QtTest library +PASS : tst_FailDataType::initTestCase() +QDEBUG : tst_FailDataType::value() expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string' +QFATAL : tst_FailDataType::value() ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0 +FAIL! : tst_FailDataType::value() Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_FailDataType ********* diff --git a/tests/auto/testlib/selftests/expected_faildatatype.xml b/tests/auto/testlib/selftests/expected_faildatatype.xml new file mode 100644 index 0000000000..8812bfab71 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.xml @@ -0,0 +1,25 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_faildatatype.xunitxml b/tests/auto/testlib/selftests/expected_faildatatype.xunitxml new file mode 100644 index 0000000000..fcc0db3892 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.xunitxml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.lightxml b/tests/auto/testlib/selftests/expected_failfetchtype.lightxml new file mode 100644 index 0000000000..f7c84a1876 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.lightxml @@ -0,0 +1,21 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.tap b/tests/auto/testlib/selftests/expected_failfetchtype.tap new file mode 100644 index 0000000000..94c3b6e1b2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.tap @@ -0,0 +1,15 @@ +TAP version 13 +# tst_FailFetchType +ok 1 - initTestCase() +# Requested type 'QString' does not match available type 'bool'. +not ok 2 - fetch(bool) + --- + # Received a fatal error. + at: tst_FailFetchType::fetch() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.teamcity b/tests/auto/testlib/selftests/expected_failfetchtype.teamcity new file mode 100644 index 0000000000..91cf0c6ae8 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_FailFetchType' flowId='tst_FailFetchType'] +##teamcity[testStarted name='initTestCase()' flowId='tst_FailFetchType'] +##teamcity[testFinished name='initTestCase()' flowId='tst_FailFetchType'] +##teamcity[testStarted name='fetch(bool)' flowId='tst_FailFetchType'] +##teamcity[testFailed name='fetch(bool)' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_FailFetchType'] +##teamcity[testStdOut name='fetch(bool)' out='QFATAL: Requested type |'QString|' does not match available type |'bool|'.' flowId='tst_FailFetchType'] +##teamcity[testFinished name='fetch(bool)' flowId='tst_FailFetchType'] +##teamcity[testSuiteFinished name='tst_FailFetchType' flowId='tst_FailFetchType'] diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.txt b/tests/auto/testlib/selftests/expected_failfetchtype.txt new file mode 100644 index 0000000000..d12cf0dc7d --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_FailFetchType ********* +Config: Using QtTest library +PASS : tst_FailFetchType::initTestCase() +QFATAL : tst_FailFetchType::fetch(bool) Requested type 'QString' does not match available type 'bool'. +FAIL! : tst_FailFetchType::fetch(bool) Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_FailFetchType ********* diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.xml b/tests/auto/testlib/selftests/expected_failfetchtype.xml new file mode 100644 index 0000000000..a349baa710 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.xml @@ -0,0 +1,24 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml b/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml new file mode 100644 index 0000000000..a54a37a913 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/faildatatype/BLACKLIST b/tests/auto/testlib/selftests/faildatatype/BLACKLIST new file mode 100644 index 0000000000..bb1cae98e5 --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/BLACKLIST @@ -0,0 +1,4 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +# Incidental test: exercise more of the blacklisting code +[value:bool-as-string] +* diff --git a/tests/auto/testlib/selftests/faildatatype/faildatatype.pro b/tests/auto/testlib/selftests/faildatatype/faildatatype.pro new file mode 100644 index 0000000000..4ff7352555 --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/faildatatype.pro @@ -0,0 +1,9 @@ +SOURCES += tst_faildatatype.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = faildatatype + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp b/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp new file mode 100644 index 0000000000..b49c7723ef --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +class tst_FailDataType: public QObject +{ +Q_OBJECT +private slots: + void value_data() const; + void value() const; +}; + +void tst_FailDataType::value_data() const +{ + QTest::addColumn("value"); + + QTest::newRow("bool-as-string") << true; // assertion should fail here +} + +/*! \internal + This function should never be run because its _data() fails. + */ +void tst_FailDataType::value() const +{ + QFAIL("ERROR: this function is NOT supposed to be run."); +} + +QTEST_APPLESS_MAIN(tst_FailDataType) + +#include "tst_faildatatype.moc" diff --git a/tests/auto/testlib/selftests/failfetchtype/BLACKLIST b/tests/auto/testlib/selftests/failfetchtype/BLACKLIST new file mode 100644 index 0000000000..20a502724a --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/BLACKLIST @@ -0,0 +1,4 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +# Incidental test: exercise more of the blacklisting code +[fetch:no-such-dataset] +* diff --git a/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro b/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro new file mode 100644 index 0000000000..5821018af4 --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro @@ -0,0 +1,9 @@ +SOURCES += tst_failfetchtype.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = failfetchtype + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp b/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp new file mode 100644 index 0000000000..2dd32a5a5e --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +class tst_FailFetchType: public QObject +{ +Q_OBJECT +private slots: + void fetch_data() const; + void fetch() const; +}; + +void tst_FailFetchType::fetch_data() const +{ + QTest::addColumn("value"); + + QTest::newRow("bool") << true; +} + +void tst_FailFetchType::fetch() const +{ + QFETCH(QString, value); // assertion should fail here + QFAIL("ERROR: this function is NOT supposed to be run."); +} + +QTEST_APPLESS_MAIN(tst_FailFetchType) + +#include "tst_failfetchtype.moc" diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 3c5f922c75..cbec0c4ebf 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -244,8 +244,8 @@ def generateTestData(testname, clean, }, # These are actually *other* crashers, beside those in extraEnv; # must match tst_Selftests::runSubTest_data(): - crashers = ("assert", "blacklisted", "crashedterminate", - "exceptionthrow", "fetchbogus", "silent")): + crashers = ("assert", "blacklisted", "crashedterminate", "exceptionthrow", + "faildatatype", "failfetchtype", "fetchbogus", "silent")): """Run one test and save its cleaned results. Required arguments are the name of the test directory (the binary diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 05ed6d9905..08d6d633f0 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -21,6 +21,8 @@ SUBPROGRAMS = \ exceptionthrow \ expectfail \ failcleanup \ + faildatatype \ + failfetchtype \ failinit \ failinitdata \ fetchbogus \ diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index f460ca3963..5c97ad01d1 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -468,10 +468,13 @@ void tst_Selftests::runSubTest_data() #endif << "expectfail" << "failcleanup" +#ifndef Q_OS_WIN // these assert, by design; so same problem as "assert" + << "faildatatype" + << "failfetchtype" +#endif << "failinit" << "failinitdata" -#if !defined(Q_OS_WIN) - // Disable this test on Windows, as the run-time will popup dialogs with warnings +#ifndef Q_OS_WIN // asserts, by design; so same problem as "assert" << "fetchbogus" #endif << "findtestdata" @@ -616,6 +619,7 @@ void tst_Selftests::runSubTest_data() // Keep in sync with generateTestData()'s crashers in generate_expected_output.py: const bool crashes = subtest == QLatin1String("assert") || subtest == QLatin1String("exceptionthrow") || subtest == QLatin1String("fetchbogus") || subtest == QLatin1String("crashedterminate") + || subtest == QLatin1String("faildatatype") || subtest == QLatin1String("failfetchtype") || subtest == QLatin1String("crashes") || subtest == QLatin1String("silent") || subtest == QLatin1String("blacklisted"); QTest::newRow(qPrintable(QString("%1 %2").arg(subtest).arg(loggerSet.name))) @@ -745,11 +749,13 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge #endif #ifdef Q_OS_LINUX // QEMU outputs to stderr about uncaught signals - && (!EmulationDetector::isRunningArmOnX86() || - (subdir != QLatin1String("blacklisted") - && subdir != QLatin1String("silent") - && subdir != QLatin1String("assert") - && subdir != QLatin1String("crashes") + && !(EmulationDetector::isRunningArmOnX86() && + (subdir == QLatin1String("assert") + || subdir == QLatin1String("blacklisted") + || subdir == QLatin1String("crashes") + || subdir == QLatin1String("faildatatype") + || subdir == QLatin1String("failfetchtype") + || subdir == QLatin1String("silent") ) ) #endif @@ -902,7 +908,8 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, if (actualLine == expectedLine) return true; - if (subdir == QLatin1String("assert") + if ((subdir == QLatin1String("assert") + || subdir == QLatin1String("faildatatype") || subdir == QLatin1String("failfetchtype")) && actualLine.contains(QLatin1String("ASSERT: ")) && expectedLine.contains(QLatin1String("ASSERT: "))) { // Q_ASSERT uses __FILE__, the exact contents of which are -- cgit v1.2.3 From c3e6551d4d6712668e5fc8e307b3425db80af96d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 13 Nov 2018 20:10:19 +0100 Subject: generate_expected_output.py: refine environment used for subtests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match the environment tst_selftests.cpp uses for subtests more faithfully. Extends b22e50acda. In the process, tweak how crashers are handling, in preparation for the watchdog test. Change-Id: I09a046460f6f3bff0b12069fad6c1437d89572ce Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/generate_expected_output.py | 90 +++++++++++++++------- 1 file changed, 64 insertions(+), 26 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index cbec0c4ebf..175b5756a3 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -221,6 +221,65 @@ class Scanner (object): print('tst_selftests.cpp names', d, "as a test, but it doesn't exist") del re +# Keep in sync with tst_selftests.cpp's processEnvironment(): +def baseEnv(platname=None, + keep=('PATH', 'QT_QPA_PLATFORM'), + posix=('HOME', 'USER', 'QEMU_SET_ENV', 'QEMU_LD_PREFIX'), + nonapple=('DISPLAY', 'XAUTHLOCALHOSTNAME'), # and XDG_* + # Don't actually know how to test for QNX, so this is ignored: + qnx=('GRAPHICS_ROOT', 'TZ'), + # Probably not actually relevant + preserveLib=('QT_PLUGIN_PATH', 'LD_LIBRARY_PATH'), + # Shall be modified on first call (a *copy* is returned): + cached={}): + """Lazily-evaluated standard environment for sub-tests to run in. + + This prunes the parent process environment, selecting a only those + variables we chose to keep. The platname passed to the first call + helps select which variables to keep. The environment computed + then is cached: a copy of this is returned on that call and each + subsequent call.\n""" + + if not cached: + xdg = False + # The platform module may be more apt for the platform tests here. + if os.name == 'posix': + keep += posix + if platname != 'darwin': + keep += nonapple + xdg = True + if 'QT_PRESERVE_TESTLIB_PATH' in os.environ: + keep += preserveLib + + cached = dict( + LC_ALL = 'C', # Use standard locale + # Avoid interference from any qtlogging.ini files, e.g. in + # /etc/xdg/QtProject/, (must match tst_selftests.cpp's + # processEnvironment()'s value): + QT_LOGGING_RULES = '*.debug=true;qt.*=false') + + for k, v in os.environ.items(): + if k in keep or (xdg and k.startswith('XDG_')): + cached[k] = v + + return cached.copy() + +def testEnv(testname, + # Make sure this matches tst_Selftests::doRunSubTest(): + extraEnv = { + "crashers": { "QTEST_DISABLE_CORE_DUMP": "1", "QTEST_DISABLE_STACK_DUMP": "1" }, + }, + # Must match tst_Selftests::runSubTest_data(): + crashers = ("assert", "blacklisted", "crashes", "crashedterminate", "exceptionthrow", + "faildatatype", "failfetchtype", "fetchbogus", "silent")): + """Determine the environment in which to run a test.""" + data = baseEnv() + if testname in crashers: + data.update(extraEnv["crashers"]) + if testname in extraEnv: + data.update(extraEnv[testname]) + return data + def generateTestData(testname, clean, formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity', 'tap'), # Make sure this matches tst_Selftests::runSubTest_data(): @@ -237,15 +296,7 @@ def generateTestData(testname, clean, "silent": "-silent", "verbose1": "-v1", "verbose2": "-v2", - }, - # Make sure this matches tst_Selftests::doRunSubTest(): - extraEnv = { - "crashes": { "QTEST_DISABLE_CORE_DUMP": "1", "QTEST_DISABLE_STACK_DUMP": "1" }, - }, - # These are actually *other* crashers, beside those in extraEnv; - # must match tst_Selftests::runSubTest_data(): - crashers = ("assert", "blacklisted", "crashedterminate", "exceptionthrow", - "faildatatype", "failfetchtype", "fetchbogus", "silent")): + }): """Run one test and save its cleaned results. Required arguments are the name of the test directory (the binary @@ -257,16 +308,9 @@ def generateTestData(testname, clean, if not os.path.isfile(path): print("Warning: directory", testname, "contains no test executable") return - env = None - try: - env = extraEnv[testname] - except KeyError: - if env in crashers: - env = extraEnv["crashes"] - if env: - data = os.environ.copy() - data.update(env) - env = data + + # Prepare environment in which to run tests: + env = testEnv(testname) print(" running", testname) for format in formats: @@ -281,13 +325,6 @@ def generateTestData(testname, clean, def main(name, *args): """Minimal argument parsing and driver for the real work""" - os.environ.update( - LC_ALL = 'C', # Use standard locale - # Avoid interference from any qtlogging.ini files, e.g. in - # /etc/xdg/QtProject/, (must match tst_selftests.cpp's - # processEnvironment()'s value): - QT_LOGGING_RULES = '*.debug=true;qt.*=false') - herePath = os.getcwd() cleaner = Cleaner(herePath, name) @@ -299,6 +336,7 @@ def main(name, *args): if __name__ == '__main__': # Executed when script is run, not when imported (e.g. to debug) import sys + baseEnv(sys.platform) # initializes its cache if sys.platform.startswith('win'): print("This script does not work on Windows.") -- cgit v1.2.3 From 7c7e007794fb6dc34c7c816732d2ba0a911e488c Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 15 Oct 2018 17:47:42 +0200 Subject: Add a testlib selftest for the watchdog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify that it does cut in after the specified time has elapsed. Task-number: QTPM-1385 Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1 Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/expected_watchdog.lightxml | 19 ++++++++ tests/auto/testlib/selftests/expected_watchdog.tap | 15 +++++++ .../testlib/selftests/expected_watchdog.teamcity | 8 ++++ tests/auto/testlib/selftests/expected_watchdog.txt | 8 ++++ tests/auto/testlib/selftests/expected_watchdog.xml | 22 ++++++++++ .../testlib/selftests/expected_watchdog.xunitxml | 16 +++++++ .../testlib/selftests/generate_expected_output.py | 9 ++-- tests/auto/testlib/selftests/selftests.pri | 1 + tests/auto/testlib/selftests/tst_selftests.cpp | 6 ++- .../testlib/selftests/watchdog/tst_watchdog.cpp | 51 ++++++++++++++++++++++ tests/auto/testlib/selftests/watchdog/watchdog.pro | 14 ++++++ 11 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 tests/auto/testlib/selftests/expected_watchdog.lightxml create mode 100644 tests/auto/testlib/selftests/expected_watchdog.tap create mode 100644 tests/auto/testlib/selftests/expected_watchdog.teamcity create mode 100644 tests/auto/testlib/selftests/expected_watchdog.txt create mode 100644 tests/auto/testlib/selftests/expected_watchdog.xml create mode 100644 tests/auto/testlib/selftests/expected_watchdog.xunitxml create mode 100644 tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp create mode 100644 tests/auto/testlib/selftests/watchdog/watchdog.pro (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_watchdog.lightxml b/tests/auto/testlib/selftests/expected_watchdog.lightxml new file mode 100644 index 0000000000..1070324f2a --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.lightxml @@ -0,0 +1,19 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_watchdog.tap b/tests/auto/testlib/selftests/expected_watchdog.tap new file mode 100644 index 0000000000..3d4890b67e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.tap @@ -0,0 +1,15 @@ +TAP version 13 +# tst_Watchdog +ok 1 - initTestCase() +# Test function timed out +not ok 2 - delay() + --- + # Received a fatal error. + at: tst_Watchdog::delay() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_watchdog.teamcity b/tests/auto/testlib/selftests/expected_watchdog.teamcity new file mode 100644 index 0000000000..0d77bf70d5 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_Watchdog' flowId='tst_Watchdog'] +##teamcity[testStarted name='initTestCase()' flowId='tst_Watchdog'] +##teamcity[testFinished name='initTestCase()' flowId='tst_Watchdog'] +##teamcity[testStarted name='delay()' flowId='tst_Watchdog'] +##teamcity[testFailed name='delay()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_Watchdog'] +##teamcity[testStdOut name='delay()' out='QFATAL: Test function timed out' flowId='tst_Watchdog'] +##teamcity[testFinished name='delay()' flowId='tst_Watchdog'] +##teamcity[testSuiteFinished name='tst_Watchdog' flowId='tst_Watchdog'] diff --git a/tests/auto/testlib/selftests/expected_watchdog.txt b/tests/auto/testlib/selftests/expected_watchdog.txt new file mode 100644 index 0000000000..4c9cde4ea2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_Watchdog ********* +Config: Using QtTest library +PASS : tst_Watchdog::initTestCase() +QFATAL : tst_Watchdog::delay() Test function timed out +FAIL! : tst_Watchdog::delay() Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_Watchdog ********* diff --git a/tests/auto/testlib/selftests/expected_watchdog.xml b/tests/auto/testlib/selftests/expected_watchdog.xml new file mode 100644 index 0000000000..f1642fba79 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.xml @@ -0,0 +1,22 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_watchdog.xunitxml b/tests/auto/testlib/selftests/expected_watchdog.xunitxml new file mode 100644 index 0000000000..7e16ab2c34 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.xunitxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 175b5756a3..92588c614d 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -267,11 +267,14 @@ def baseEnv(platname=None, def testEnv(testname, # Make sure this matches tst_Selftests::doRunSubTest(): extraEnv = { - "crashers": { "QTEST_DISABLE_CORE_DUMP": "1", "QTEST_DISABLE_STACK_DUMP": "1" }, + "crashers": { "QTEST_DISABLE_CORE_DUMP": "1", + "QTEST_DISABLE_STACK_DUMP": "1" }, + "watchdog": { "QTEST_FUNCTION_TIMEOUT": "100" }, }, # Must match tst_Selftests::runSubTest_data(): - crashers = ("assert", "blacklisted", "crashes", "crashedterminate", "exceptionthrow", - "faildatatype", "failfetchtype", "fetchbogus", "silent")): + crashers = ("assert", "blacklisted", "crashes", "crashedterminate", + "exceptionthrow", "faildatatype", "failfetchtype", + "fetchbogus", "silent", "watchdog")): """Determine the environment in which to run a test.""" data = baseEnv() if testname in crashers: diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 08d6d633f0..bc5a74a20a 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -50,6 +50,7 @@ SUBPROGRAMS = \ verbose2 \ verifyexceptionthrown \ warnings \ + watchdog \ xunit qtHaveModule(gui): SUBPROGRAMS += \ diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 5c97ad01d1..a5094c8b9e 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -505,6 +505,7 @@ void tst_Selftests::runSubTest_data() << "verifyexceptionthrown" #endif //!QT_NO_EXCEPTIONS << "warnings" + << "watchdog" << "xunit" ; @@ -621,7 +622,7 @@ void tst_Selftests::runSubTest_data() || subtest == QLatin1String("fetchbogus") || subtest == QLatin1String("crashedterminate") || subtest == QLatin1String("faildatatype") || subtest == QLatin1String("failfetchtype") || subtest == QLatin1String("crashes") || subtest == QLatin1String("silent") - || subtest == QLatin1String("blacklisted"); + || subtest == QLatin1String("blacklisted") || subtest == QLatin1String("watchdog"); QTest::newRow(qPrintable(QString("%1 %2").arg(subtest).arg(loggerSet.name))) << subtest << loggers @@ -700,6 +701,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge if (crashes) { environment.insert("QTEST_DISABLE_CORE_DUMP", "1"); environment.insert("QTEST_DISABLE_STACK_DUMP", "1"); + if (subdir == QLatin1String("watchdog")) + environment.insert("QTEST_FUNCTION_TIMEOUT", "100"); } proc.setProcessEnvironment(environment); const QString path = subdir + QLatin1Char('/') + subdir; @@ -742,6 +745,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge if (subdir != QLatin1String("exceptionthrow") && subdir != QLatin1String("cmptest") // QImage comparison requires QGuiApplication && subdir != QLatin1String("fetchbogus") + && subdir != QLatin1String("watchdog") && subdir != QLatin1String("xunit") #ifdef Q_CC_MINGW && subdir != QLatin1String("blacklisted") // calls qFatal() diff --git a/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp b/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp new file mode 100644 index 0000000000..2f29609f71 --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +class tst_Watchdog : public QObject +{ + Q_OBJECT +private slots: + void delay() const; +}; + +void tst_Watchdog::delay() const +{ + bool ok = false; + const int fiveMinutes = 5 * 60 * 1000; + // Use the same env.var as the watch-dog and add a little to it: + const int timeout = qEnvironmentVariableIntValue("QTEST_FUNCTION_TIMEOUT", &ok); + QTest::qSleep(5000 + (ok && timeout > 0 ? timeout : fiveMinutes)); + // The watchdog timer should have interrupted us by now. + QFAIL("ERROR: this function should be interrupted."); +} + +QTEST_APPLESS_MAIN(tst_Watchdog) + +#include "tst_watchdog.moc" diff --git a/tests/auto/testlib/selftests/watchdog/watchdog.pro b/tests/auto/testlib/selftests/watchdog/watchdog.pro new file mode 100644 index 0000000000..ddcc3f6ca2 --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/watchdog.pro @@ -0,0 +1,14 @@ +SOURCES += tst_watchdog.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = watchdog + +# The test deliberately times out; so tell it to do so quickly +checkenv.name = QTEST_FUNCTION_TIMEOUT +checkenv.value = 100 +QT_TOOL_ENV += checkenv + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) -- cgit v1.2.3 From a53500f5bf75a89e2a616781c806553568531e5a Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 16 Jan 2019 13:47:12 +0100 Subject: Eliminate some stray misleading paths from expected output files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output files for the tuplediagnostics selftest of testlib had a stray non-canoical path fragment in them; so replaced with its canonical form. Change-Id: Ib421380036c3fb1b91447eb8c87be4ad0dfe5c96 Reviewed-by: Jędrzej Nowacki --- tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml | 4 ++-- tests/auto/testlib/selftests/expected_tuplediagnostics.tap | 8 ++++---- tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity | 4 ++-- tests/auto/testlib/selftests/expected_tuplediagnostics.txt | 4 ++-- tests/auto/testlib/selftests/expected_tuplediagnostics.xml | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml index 810941d894..85f8fac42a 100644 --- a/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml +++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml @@ -12,7 +12,7 @@ - + {1}): std::tuple(1) Expected (std::tuple{2}): std::tuple(2)]]> @@ -20,7 +20,7 @@ - + diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.tap b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap index 9e007c14e1..a079a9bf40 100644 --- a/tests/auto/testlib/selftests/expected_tuplediagnostics.tap +++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap @@ -10,8 +10,8 @@ not ok 3 - testSimpleTuple() found: std::tuple(1) (std::tuple{1}) expected: std::tuple(2) (std::tuple{2}) actual: std::tuple(1) (std::tuple{1}) - at: tst_TupleDiagnostics::testSimpleTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53) - file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp + at: tst_TupleDiagnostics::testSimpleTuple() (qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53) + file: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp line: 53 ... not ok 4 - testTuple() @@ -22,8 +22,8 @@ not ok 4 - testTuple() found: std::tuple(42, 'Y', "tuple1") (tuple1) expected: std::tuple(42, 'Y', "tuple2") (tuple2) actual: std::tuple(42, 'Y', "tuple1") (tuple1) - at: tst_TupleDiagnostics::testTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60) - file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp + at: tst_TupleDiagnostics::testTuple() (qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60) + file: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp line: 60 ... ok 5 - cleanupTestCase() diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity index a395857c60..7256992518 100644 --- a/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity +++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity @@ -4,10 +4,10 @@ ##teamcity[testStarted name='testEmptyTuple()' flowId='tst_TupleDiagnostics'] ##teamcity[testFinished name='testEmptyTuple()' flowId='tst_TupleDiagnostics'] ##teamcity[testStarted name='testSimpleTuple()' flowId='tst_TupleDiagnostics'] -##teamcity[testFailed name='testSimpleTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (std::tuple{1}): std::tuple(1)|n Expected (std::tuple{2}): std::tuple(2)' flowId='tst_TupleDiagnostics'] +##teamcity[testFailed name='testSimpleTuple()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (std::tuple{1}): std::tuple(1)|n Expected (std::tuple{2}): std::tuple(2)' flowId='tst_TupleDiagnostics'] ##teamcity[testFinished name='testSimpleTuple()' flowId='tst_TupleDiagnostics'] ##teamcity[testStarted name='testTuple()' flowId='tst_TupleDiagnostics'] -##teamcity[testFailed name='testTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (tuple1): std::tuple(42, |'Y|', "tuple1")|n Expected (tuple2): std::tuple(42, |'Y|', "tuple2")' flowId='tst_TupleDiagnostics'] +##teamcity[testFailed name='testTuple()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (tuple1): std::tuple(42, |'Y|', "tuple1")|n Expected (tuple2): std::tuple(42, |'Y|', "tuple2")' flowId='tst_TupleDiagnostics'] ##teamcity[testFinished name='testTuple()' flowId='tst_TupleDiagnostics'] ##teamcity[testStarted name='cleanupTestCase()' flowId='tst_TupleDiagnostics'] ##teamcity[testFinished name='cleanupTestCase()' flowId='tst_TupleDiagnostics'] diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt index ce568bf6c0..8d121acc83 100644 --- a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt +++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt @@ -5,11 +5,11 @@ PASS : tst_TupleDiagnostics::testEmptyTuple() FAIL! : tst_TupleDiagnostics::testSimpleTuple() Compared values are not the same Actual (std::tuple{1}): std::tuple(1) Expected (std::tuple{2}): std::tuple(2) - Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)] + Loc: [qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)] FAIL! : tst_TupleDiagnostics::testTuple() Compared values are not the same Actual (tuple1): std::tuple(42, 'Y', "tuple1") Expected (tuple2): std::tuple(42, 'Y', "tuple2") - Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)] + Loc: [qtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)] PASS : tst_TupleDiagnostics::cleanupTestCase() Totals: 3 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_TupleDiagnostics ********* diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.xml b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml index 4c55a6d393..f32974adb4 100644 --- a/tests/auto/testlib/selftests/expected_tuplediagnostics.xml +++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml @@ -14,7 +14,7 @@ - + {1}): std::tuple(1) Expected (std::tuple{2}): std::tuple(2)]]> @@ -22,7 +22,7 @@ - + -- cgit v1.2.3 From f3de22b2117f083308a45cc3ed80979db421e274 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 16 Oct 2018 19:07:14 +0200 Subject: Add assorted tests to exercise more QTest functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coverage analysis reveals some unexercised code. Task-number: QTPM-1385 Change-Id: Ib3fdbcf778e7af14ca6dfa1a11bcb4943276de69 Reviewed-by: Volker Hilsheimer Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/expected_testlib.lightxml | 45 ++++++++++ tests/auto/testlib/selftests/expected_testlib.tap | 22 +++++ .../testlib/selftests/expected_testlib.teamcity | 23 +++++ tests/auto/testlib/selftests/expected_testlib.txt | 15 ++++ tests/auto/testlib/selftests/expected_testlib.xml | 48 +++++++++++ .../testlib/selftests/expected_testlib.xunitxml | 16 ++++ tests/auto/testlib/selftests/selftests.pri | 1 + tests/auto/testlib/selftests/testlib/testlib.pro | 7 ++ .../auto/testlib/selftests/testlib/tst_testlib.cpp | 97 ++++++++++++++++++++++ tests/auto/testlib/selftests/tst_selftests.cpp | 1 + 10 files changed, 275 insertions(+) create mode 100644 tests/auto/testlib/selftests/expected_testlib.lightxml create mode 100644 tests/auto/testlib/selftests/expected_testlib.tap create mode 100644 tests/auto/testlib/selftests/expected_testlib.teamcity create mode 100644 tests/auto/testlib/selftests/expected_testlib.txt create mode 100644 tests/auto/testlib/selftests/expected_testlib.xml create mode 100644 tests/auto/testlib/selftests/expected_testlib.xunitxml create mode 100644 tests/auto/testlib/selftests/testlib/testlib.pro create mode 100644 tests/auto/testlib/selftests/testlib/tst_testlib.cpp (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_testlib.lightxml b/tests/auto/testlib/selftests/expected_testlib.lightxml new file mode 100644 index 0000000000..47f5edc07d --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.lightxml @@ -0,0 +1,45 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_testlib.tap b/tests/auto/testlib/selftests/expected_testlib.tap new file mode 100644 index 0000000000..d85b23b7d4 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.tap @@ -0,0 +1,22 @@ +TAP version 13 +# tst_TestLib +ok 1 - initTestCase() +not ok 2 - basics() + --- + # Compared pointers are not the same + at: tst_TestLib::basics() (qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp:54) + file: qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp + line: 54 + ... +ok 3 - delays() +ok 4 - reals(zero) +ok 5 - reals(self-qQNaN) +ok 6 - reals(self-qInf) +ok 7 - reals(infineg) +ok 8 - reals(Sin(turn/4)) +ok 9 - reals(Cos(turn/2)) +ok 10 - cleanupTestCase() +1..10 +# tests 10 +# pass 9 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_testlib.teamcity b/tests/auto/testlib/selftests/expected_testlib.teamcity new file mode 100644 index 0000000000..11617121e2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.teamcity @@ -0,0 +1,23 @@ +##teamcity[testSuiteStarted name='tst_TestLib' flowId='tst_TestLib'] +##teamcity[testStarted name='initTestCase()' flowId='tst_TestLib'] +##teamcity[testFinished name='initTestCase()' flowId='tst_TestLib'] +##teamcity[testStarted name='basics()' flowId='tst_TestLib'] +##teamcity[testFailed name='basics()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp(0)|]' details='Compared pointers are not the same' flowId='tst_TestLib'] +##teamcity[testFinished name='basics()' flowId='tst_TestLib'] +##teamcity[testStarted name='delays()' flowId='tst_TestLib'] +##teamcity[testFinished name='delays()' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(zero)' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(zero)' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(self-qQNaN)' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(self-qQNaN)' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(self-qInf)' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(self-qInf)' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(infineg)' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(infineg)' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(Sin(turn/4))' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(Sin(turn/4))' flowId='tst_TestLib'] +##teamcity[testStarted name='reals(Cos(turn/2))' flowId='tst_TestLib'] +##teamcity[testFinished name='reals(Cos(turn/2))' flowId='tst_TestLib'] +##teamcity[testStarted name='cleanupTestCase()' flowId='tst_TestLib'] +##teamcity[testFinished name='cleanupTestCase()' flowId='tst_TestLib'] +##teamcity[testSuiteFinished name='tst_TestLib' flowId='tst_TestLib'] diff --git a/tests/auto/testlib/selftests/expected_testlib.txt b/tests/auto/testlib/selftests/expected_testlib.txt new file mode 100644 index 0000000000..a3f463e7d4 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.txt @@ -0,0 +1,15 @@ +********* Start testing of tst_TestLib ********* +Config: Using QtTest library +PASS : tst_TestLib::initTestCase() +FAIL! : tst_TestLib::basics() Compared pointers are not the same + Loc: [qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp(0)] +PASS : tst_TestLib::delays() +PASS : tst_TestLib::reals(zero) +PASS : tst_TestLib::reals(self-qQNaN) +PASS : tst_TestLib::reals(self-qInf) +PASS : tst_TestLib::reals(infineg) +PASS : tst_TestLib::reals(Sin(turn/4)) +PASS : tst_TestLib::reals(Cos(turn/2)) +PASS : tst_TestLib::cleanupTestCase() +Totals: 9 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_TestLib ********* diff --git a/tests/auto/testlib/selftests/expected_testlib.xml b/tests/auto/testlib/selftests/expected_testlib.xml new file mode 100644 index 0000000000..3aca904ac1 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.xml @@ -0,0 +1,48 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_testlib.xunitxml b/tests/auto/testlib/selftests/expected_testlib.xunitxml new file mode 100644 index 0000000000..c9c67c7c9a --- /dev/null +++ b/tests/auto/testlib/selftests/expected_testlib.xunitxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index bc5a74a20a..b4568dd3e1 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -45,6 +45,7 @@ SUBPROGRAMS = \ sleep \ strcmp \ subtest \ + testlib \ tuplediagnostics \ verbose1 \ verbose2 \ diff --git a/tests/auto/testlib/selftests/testlib/testlib.pro b/tests/auto/testlib/selftests/testlib/testlib.pro new file mode 100644 index 0000000000..a909c1c213 --- /dev/null +++ b/tests/auto/testlib/selftests/testlib/testlib.pro @@ -0,0 +1,7 @@ +SOURCES += tst_testlib.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = testlib diff --git a/tests/auto/testlib/selftests/testlib/tst_testlib.cpp b/tests/auto/testlib/selftests/testlib/tst_testlib.cpp new file mode 100644 index 0000000000..38a71be732 --- /dev/null +++ b/tests/auto/testlib/selftests/testlib/tst_testlib.cpp @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +/* Test QTest functions not covered by other parts of the selftest. Tests that + * involve crashing or exiting should be added as separate tests in their own + * right. Tests that form a coherent group on a related theme should also go in + * their own directory. Tests that fail in order to exercise QTest internals + * are fine. + */ + +class tst_TestLib : public QObject +{ +Q_OBJECT +private slots: + void basics() const; + void delays() const; + void reals_data() const; + void reals() const; +}; + +void tst_TestLib::basics() const +{ + QVERIFY(QByteArray(QTest::currentAppName()).contains("testlib")); + + QCOMPARE(QTest::testObject(), nullptr); // last, because it should fail +} + +QT_BEGIN_NAMESPACE + +namespace QTest { + // Defined; not declared in the public header, but used by qtdeclarative. + int defaultKeyDelay(); + int defaultMouseDelay(); +} + +QT_END_NAMESPACE + +void tst_TestLib::delays() const +{ + QVERIFY(QTest::defaultMouseDelay() >= 0); + QVERIFY(QTest::defaultKeyDelay() >= 0); +} + +void tst_TestLib::reals_data() const +{ + QTest::addColumn("actual"); + QTest::addColumn("expected"); + + QTest::newRow("zero") << 0.0 << 0.0; +#define ADDROW(func) QTest::addRow("self-%s", #func) << func() << func() + ADDROW(qQNaN); + ADDROW(qInf); +#undef ADDROW // Just used so as to exercise addRow() + QTest::newRow("infineg") << -qInf() << -qInf(); + QTest::newRow("Sin(turn/4)") << qSin(9 * M_PI_2) << 1.0; + QTest::newRow("Cos(turn/2)") << qCos(15 * M_PI) << -1.0; +} + +void tst_TestLib::reals() const +{ + QFETCH(double, actual); + QFETCH(double, expected); + QCOMPARE(actual, expected); +} + +QTEST_APPLESS_MAIN(tst_TestLib) + +#include "tst_testlib.moc" diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index a5094c8b9e..6ef0ca19ed 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -497,6 +497,7 @@ void tst_Selftests::runSubTest_data() << "sleep" << "strcmp" << "subtest" + << "testlib" << "tuplediagnostics" << "verbose1" << "verbose2" -- cgit v1.2.3 From 3a5f86d78452714f2a57772f33f8e6c6b49b6f22 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 Aug 2018 17:07:07 +0200 Subject: Add a feature to enable CodeCoverage analysis of testlib Based on Asmo Saarela's advice (QTPM-686), adapted on advice from FrogLogic support and converted to a feature so that the selftest and testlib qmake config can be co-ordinated. Task-number: QTPM-1385 Change-Id: Icd706f086009e1e08b3f8c5cd553f792402e28c0 Reviewed-by: Volker Hilsheimer --- .../auto/testlib/qabstractitemmodeltester/qabstractitemmodeltester.pro | 2 ++ tests/auto/testlib/qsignalspy/qsignalspy.pro | 2 ++ tests/auto/testlib/selftests/alive/alive.pro | 2 ++ tests/auto/testlib/selftests/assert/assert.pro | 2 ++ tests/auto/testlib/selftests/badxml/badxml.pro | 2 ++ tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro | 2 ++ tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro | 2 ++ .../testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro | 2 ++ tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro | 2 ++ .../auto/testlib/selftests/benchlibtickcounter/benchlibtickcounter.pro | 2 ++ tests/auto/testlib/selftests/benchlibwalltime/benchlibwalltime.pro | 2 ++ tests/auto/testlib/selftests/blacklisted/blacklisted.pro | 2 ++ tests/auto/testlib/selftests/cmptest/cmptest.pro | 2 ++ tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro | 2 ++ tests/auto/testlib/selftests/counting/counting.pro | 2 ++ tests/auto/testlib/selftests/crashes/crashes.pro | 2 ++ tests/auto/testlib/selftests/datatable/datatable.pro | 2 ++ tests/auto/testlib/selftests/datetime/datetime.pro | 2 ++ tests/auto/testlib/selftests/deleteLater/deleteLater.pro | 2 ++ tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro | 2 ++ tests/auto/testlib/selftests/differentexec/differentexec.pro | 2 ++ tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro | 2 ++ tests/auto/testlib/selftests/expectfail/expectfail.pro | 2 ++ tests/auto/testlib/selftests/failcleanup/failcleanup.pro | 2 ++ tests/auto/testlib/selftests/failinit/failinit.pro | 2 ++ tests/auto/testlib/selftests/failinitdata/failinitdata.pro | 2 ++ tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro | 2 ++ tests/auto/testlib/selftests/findtestdata/findtestdata.pro | 2 ++ tests/auto/testlib/selftests/float/float.pro | 2 ++ tests/auto/testlib/selftests/globaldata/globaldata.pro | 2 ++ tests/auto/testlib/selftests/keyboard/keyboard.pro | 2 ++ tests/auto/testlib/selftests/longstring/longstring.pro | 2 ++ tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro | 2 ++ tests/auto/testlib/selftests/mouse/mouse.pro | 2 ++ tests/auto/testlib/selftests/multiexec/multiexec.pro | 2 ++ tests/auto/testlib/selftests/pairdiagnostics/pairdiagnostics.pro | 2 ++ tests/auto/testlib/selftests/printdatatags/printdatatags.pro | 2 ++ .../printdatatagswithglobaltags/printdatatagswithglobaltags.pro | 2 ++ tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro | 2 ++ tests/auto/testlib/selftests/silent/silent.pro | 2 ++ tests/auto/testlib/selftests/singleskip/singleskip.pro | 2 ++ tests/auto/testlib/selftests/skip/skip.pro | 2 ++ tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro | 2 ++ tests/auto/testlib/selftests/skipinit/skipinit.pro | 2 ++ tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro | 2 ++ tests/auto/testlib/selftests/sleep/sleep.pro | 2 ++ tests/auto/testlib/selftests/strcmp/strcmp.pro | 2 ++ tests/auto/testlib/selftests/subtest/subtest.pro | 2 ++ tests/auto/testlib/selftests/test/test.pro | 1 + tests/auto/testlib/selftests/testlib/testlib.pro | 2 ++ tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro | 2 ++ tests/auto/testlib/selftests/verbose1/verbose1.pro | 2 ++ tests/auto/testlib/selftests/verbose2/verbose2.pro | 2 ++ .../testlib/selftests/verifyexceptionthrown/verifyexceptionthrown.pro | 2 ++ tests/auto/testlib/selftests/warnings/warnings.pro | 2 ++ tests/auto/testlib/selftests/xunit/xunit.pro | 2 ++ 56 files changed, 111 insertions(+) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/qabstractitemmodeltester/qabstractitemmodeltester.pro b/tests/auto/testlib/qabstractitemmodeltester/qabstractitemmodeltester.pro index 306e8089f3..1aefc544d1 100644 --- a/tests/auto/testlib/qabstractitemmodeltester/qabstractitemmodeltester.pro +++ b/tests/auto/testlib/qabstractitemmodeltester/qabstractitemmodeltester.pro @@ -11,3 +11,5 @@ SOURCES += \ HEADERS += \ $${mtdir}/dynamictreemodel.h + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/qsignalspy/qsignalspy.pro b/tests/auto/testlib/qsignalspy/qsignalspy.pro index 1578802bf8..5343a98c14 100644 --- a/tests/auto/testlib/qsignalspy/qsignalspy.pro +++ b/tests/auto/testlib/qsignalspy/qsignalspy.pro @@ -2,3 +2,5 @@ CONFIG += testcase TARGET = tst_qsignalspy SOURCES += tst_qsignalspy.cpp QT = core testlib + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/alive/alive.pro b/tests/auto/testlib/selftests/alive/alive.pro index d3df09b10d..bda0db2282 100644 --- a/tests/auto/testlib/selftests/alive/alive.pro +++ b/tests/auto/testlib/selftests/alive/alive.pro @@ -6,3 +6,5 @@ CONFIG -= debug_and_release_target TARGET = alive + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/assert/assert.pro b/tests/auto/testlib/selftests/assert/assert.pro index cfc6a0c6b3..0692b6bdf2 100644 --- a/tests/auto/testlib/selftests/assert/assert.pro +++ b/tests/auto/testlib/selftests/assert/assert.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = assert + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/badxml/badxml.pro b/tests/auto/testlib/selftests/badxml/badxml.pro index 7b3b0f701c..4e15886504 100644 --- a/tests/auto/testlib/selftests/badxml/badxml.pro +++ b/tests/auto/testlib/selftests/badxml/badxml.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = badxml + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro b/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro index 6cbefe518c..12f068843e 100644 --- a/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro +++ b/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = benchlibcallgrind + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro b/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro index b495995eac..786511d057 100644 --- a/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro +++ b/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = benchlibcounting + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro b/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro index 5e2b963491..98fa0e4567 100644 --- a/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro +++ b/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = benchlibeventcounter + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro b/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro index f4bcc92129..0b627ecb10 100644 --- a/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro +++ b/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = benchliboptions + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchlibtickcounter/benchlibtickcounter.pro b/tests/auto/testlib/selftests/benchlibtickcounter/benchlibtickcounter.pro index ce0ec7012c..f0741d5c26 100644 --- a/tests/auto/testlib/selftests/benchlibtickcounter/benchlibtickcounter.pro +++ b/tests/auto/testlib/selftests/benchlibtickcounter/benchlibtickcounter.pro @@ -6,3 +6,5 @@ CONFIG -= debug_and_release_target TARGET = benchlibtickcounter + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/benchlibwalltime/benchlibwalltime.pro b/tests/auto/testlib/selftests/benchlibwalltime/benchlibwalltime.pro index 0e689871ab..80d97a2422 100644 --- a/tests/auto/testlib/selftests/benchlibwalltime/benchlibwalltime.pro +++ b/tests/auto/testlib/selftests/benchlibwalltime/benchlibwalltime.pro @@ -6,3 +6,5 @@ CONFIG -= debug_and_release_target TARGET = benchlibwalltime + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/blacklisted/blacklisted.pro b/tests/auto/testlib/selftests/blacklisted/blacklisted.pro index 5bd22910b1..a8602ee266 100644 --- a/tests/auto/testlib/selftests/blacklisted/blacklisted.pro +++ b/tests/auto/testlib/selftests/blacklisted/blacklisted.pro @@ -5,3 +5,5 @@ mac: CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = blacklisted + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/cmptest/cmptest.pro b/tests/auto/testlib/selftests/cmptest/cmptest.pro index 2d5dd071a9..f38f5ecce1 100644 --- a/tests/auto/testlib/selftests/cmptest/cmptest.pro +++ b/tests/auto/testlib/selftests/cmptest/cmptest.pro @@ -6,3 +6,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = cmptest + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro b/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro index 056388333a..8032ba5a02 100644 --- a/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro +++ b/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = commandlinedata + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/counting/counting.pro b/tests/auto/testlib/selftests/counting/counting.pro index 8aa2fe5753..be3a5339b0 100644 --- a/tests/auto/testlib/selftests/counting/counting.pro +++ b/tests/auto/testlib/selftests/counting/counting.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = counting + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/crashes/crashes.pro b/tests/auto/testlib/selftests/crashes/crashes.pro index 25e24243d1..00fa07a415 100644 --- a/tests/auto/testlib/selftests/crashes/crashes.pro +++ b/tests/auto/testlib/selftests/crashes/crashes.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = crashes + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/datatable/datatable.pro b/tests/auto/testlib/selftests/datatable/datatable.pro index 72fa851ae6..12a1f697b1 100644 --- a/tests/auto/testlib/selftests/datatable/datatable.pro +++ b/tests/auto/testlib/selftests/datatable/datatable.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = datatable + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/datetime/datetime.pro b/tests/auto/testlib/selftests/datetime/datetime.pro index d65c59354f..1524281090 100644 --- a/tests/auto/testlib/selftests/datetime/datetime.pro +++ b/tests/auto/testlib/selftests/datetime/datetime.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = datetime + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/deleteLater/deleteLater.pro b/tests/auto/testlib/selftests/deleteLater/deleteLater.pro index 6847238b1d..9a10096461 100644 --- a/tests/auto/testlib/selftests/deleteLater/deleteLater.pro +++ b/tests/auto/testlib/selftests/deleteLater/deleteLater.pro @@ -5,3 +5,5 @@ CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = tst_deleteLater + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro b/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro index f860a767cd..6f2b253c14 100644 --- a/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro +++ b/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro @@ -5,3 +5,5 @@ CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = tst_deleteLater_noApp + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/differentexec/differentexec.pro b/tests/auto/testlib/selftests/differentexec/differentexec.pro index 7f148ba996..339962f609 100644 --- a/tests/auto/testlib/selftests/differentexec/differentexec.pro +++ b/tests/auto/testlib/selftests/differentexec/differentexec.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = differentexec + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro b/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro index fe89f6f3cd..5473ec32c3 100644 --- a/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro +++ b/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro @@ -6,3 +6,5 @@ CONFIG -= debug_and_release_target CONFIG += exceptions TARGET = exceptionthrow + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/expectfail/expectfail.pro b/tests/auto/testlib/selftests/expectfail/expectfail.pro index c1849990f2..db383bee6a 100644 --- a/tests/auto/testlib/selftests/expectfail/expectfail.pro +++ b/tests/auto/testlib/selftests/expectfail/expectfail.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = expectfail + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/failcleanup/failcleanup.pro b/tests/auto/testlib/selftests/failcleanup/failcleanup.pro index 426d7cc45b..12da5920fb 100644 --- a/tests/auto/testlib/selftests/failcleanup/failcleanup.pro +++ b/tests/auto/testlib/selftests/failcleanup/failcleanup.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = failcleanup + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/failinit/failinit.pro b/tests/auto/testlib/selftests/failinit/failinit.pro index 6a30a5af68..46b1c3a6c4 100644 --- a/tests/auto/testlib/selftests/failinit/failinit.pro +++ b/tests/auto/testlib/selftests/failinit/failinit.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = failinit + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/failinitdata/failinitdata.pro b/tests/auto/testlib/selftests/failinitdata/failinitdata.pro index b608c67dbb..63b32cb6d6 100644 --- a/tests/auto/testlib/selftests/failinitdata/failinitdata.pro +++ b/tests/auto/testlib/selftests/failinitdata/failinitdata.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = failinitdata + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro b/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro index 33b306ca75..0fbb5e4c00 100644 --- a/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro +++ b/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = fetchbogus + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/findtestdata/findtestdata.pro b/tests/auto/testlib/selftests/findtestdata/findtestdata.pro index f04a640c59..7fbdaea3a3 100644 --- a/tests/auto/testlib/selftests/findtestdata/findtestdata.pro +++ b/tests/auto/testlib/selftests/findtestdata/findtestdata.pro @@ -7,3 +7,5 @@ CONFIG -= debug_and_release_target RESOURCES = findtestdata.qrc TARGET = findtestdata + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/float/float.pro b/tests/auto/testlib/selftests/float/float.pro index 95980eeac8..479eb152c5 100644 --- a/tests/auto/testlib/selftests/float/float.pro +++ b/tests/auto/testlib/selftests/float/float.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = float + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/globaldata/globaldata.pro b/tests/auto/testlib/selftests/globaldata/globaldata.pro index c0b1554c0f..621416c5b8 100644 --- a/tests/auto/testlib/selftests/globaldata/globaldata.pro +++ b/tests/auto/testlib/selftests/globaldata/globaldata.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = globaldata + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/keyboard/keyboard.pro b/tests/auto/testlib/selftests/keyboard/keyboard.pro index 0097318797..488c992e62 100644 --- a/tests/auto/testlib/selftests/keyboard/keyboard.pro +++ b/tests/auto/testlib/selftests/keyboard/keyboard.pro @@ -5,3 +5,5 @@ macos:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = keyboard + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/longstring/longstring.pro b/tests/auto/testlib/selftests/longstring/longstring.pro index d16ba85095..d8961203f3 100644 --- a/tests/auto/testlib/selftests/longstring/longstring.pro +++ b/tests/auto/testlib/selftests/longstring/longstring.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = longstring + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro index 79451af1ec..bdca0225d3 100644 --- a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro +++ b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = maxwarnings + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/mouse/mouse.pro b/tests/auto/testlib/selftests/mouse/mouse.pro index 7c06b8aa64..e5701eee0f 100644 --- a/tests/auto/testlib/selftests/mouse/mouse.pro +++ b/tests/auto/testlib/selftests/mouse/mouse.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = mouse + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/multiexec/multiexec.pro b/tests/auto/testlib/selftests/multiexec/multiexec.pro index 2038acbd31..e9b2b7b587 100644 --- a/tests/auto/testlib/selftests/multiexec/multiexec.pro +++ b/tests/auto/testlib/selftests/multiexec/multiexec.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = multiexec + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/pairdiagnostics/pairdiagnostics.pro b/tests/auto/testlib/selftests/pairdiagnostics/pairdiagnostics.pro index 1c07c93e9d..25f5bfe809 100644 --- a/tests/auto/testlib/selftests/pairdiagnostics/pairdiagnostics.pro +++ b/tests/auto/testlib/selftests/pairdiagnostics/pairdiagnostics.pro @@ -4,3 +4,5 @@ QT = core testlib CONFIG -= app_bundle debug_and_release_target TARGET = pairdiagnostics + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/printdatatags/printdatatags.pro b/tests/auto/testlib/selftests/printdatatags/printdatatags.pro index cd06384835..83f171aac5 100644 --- a/tests/auto/testlib/selftests/printdatatags/printdatatags.pro +++ b/tests/auto/testlib/selftests/printdatatags/printdatatags.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = printdatatags + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro b/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro index f1cf25d104..00ca4a0e62 100644 --- a/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro +++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = printdatatagswithglobaltags + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro b/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro index bd967f32e6..4d7af8ab40 100644 --- a/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro +++ b/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = qexecstringlist + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/silent/silent.pro b/tests/auto/testlib/selftests/silent/silent.pro index 3150f65a5e..3f6325a010 100644 --- a/tests/auto/testlib/selftests/silent/silent.pro +++ b/tests/auto/testlib/selftests/silent/silent.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = silent + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/singleskip/singleskip.pro b/tests/auto/testlib/selftests/singleskip/singleskip.pro index 9f63e62747..a32c22c943 100644 --- a/tests/auto/testlib/selftests/singleskip/singleskip.pro +++ b/tests/auto/testlib/selftests/singleskip/singleskip.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = singleskip + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/skip/skip.pro b/tests/auto/testlib/selftests/skip/skip.pro index 8780d295cf..19a01908af 100644 --- a/tests/auto/testlib/selftests/skip/skip.pro +++ b/tests/auto/testlib/selftests/skip/skip.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = skip + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro b/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro index f98cda7596..059132b5a6 100644 --- a/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro +++ b/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = skipcleanup + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/skipinit/skipinit.pro b/tests/auto/testlib/selftests/skipinit/skipinit.pro index 7defce9a52..6605226993 100644 --- a/tests/auto/testlib/selftests/skipinit/skipinit.pro +++ b/tests/auto/testlib/selftests/skipinit/skipinit.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = skipinit + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro b/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro index cd806c2a43..176955500b 100644 --- a/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro +++ b/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = skipinitdata + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/sleep/sleep.pro b/tests/auto/testlib/selftests/sleep/sleep.pro index affcba22ee..b109bf6253 100644 --- a/tests/auto/testlib/selftests/sleep/sleep.pro +++ b/tests/auto/testlib/selftests/sleep/sleep.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = sleep + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/strcmp/strcmp.pro b/tests/auto/testlib/selftests/strcmp/strcmp.pro index f5f6eecc88..35a4c5e858 100644 --- a/tests/auto/testlib/selftests/strcmp/strcmp.pro +++ b/tests/auto/testlib/selftests/strcmp/strcmp.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = strcmp + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/subtest/subtest.pro b/tests/auto/testlib/selftests/subtest/subtest.pro index 09dee1b1b9..b5c294aed6 100644 --- a/tests/auto/testlib/selftests/subtest/subtest.pro +++ b/tests/auto/testlib/selftests/subtest/subtest.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = subtest + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro index ec1633ebff..fce8e48ca2 100644 --- a/tests/auto/testlib/selftests/test/test.pro +++ b/tests/auto/testlib/selftests/test/test.pro @@ -19,3 +19,4 @@ RESOURCES += expected_files include(../selftests.pri) !android:!winrt: for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}" +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/testlib/testlib.pro b/tests/auto/testlib/selftests/testlib/testlib.pro index a909c1c213..8798f86b18 100644 --- a/tests/auto/testlib/selftests/testlib/testlib.pro +++ b/tests/auto/testlib/selftests/testlib/testlib.pro @@ -5,3 +5,5 @@ darwin: CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = testlib + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro b/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro index 7a29e0e5e1..f338170b81 100644 --- a/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro +++ b/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro @@ -4,3 +4,5 @@ QT = core testlib CONFIG -= app_bundle debug_and_release_target TARGET = tuplediagnostics + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/verbose1/verbose1.pro b/tests/auto/testlib/selftests/verbose1/verbose1.pro index f00ae69d17..1f16d70d66 100644 --- a/tests/auto/testlib/selftests/verbose1/verbose1.pro +++ b/tests/auto/testlib/selftests/verbose1/verbose1.pro @@ -8,3 +8,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = verbose1 + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/verbose2/verbose2.pro b/tests/auto/testlib/selftests/verbose2/verbose2.pro index 796cdeb975..bf54904488 100644 --- a/tests/auto/testlib/selftests/verbose2/verbose2.pro +++ b/tests/auto/testlib/selftests/verbose2/verbose2.pro @@ -8,3 +8,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = verbose2 + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/verifyexceptionthrown/verifyexceptionthrown.pro b/tests/auto/testlib/selftests/verifyexceptionthrown/verifyexceptionthrown.pro index 51f108c9d7..198d35dc6c 100644 --- a/tests/auto/testlib/selftests/verifyexceptionthrown/verifyexceptionthrown.pro +++ b/tests/auto/testlib/selftests/verifyexceptionthrown/verifyexceptionthrown.pro @@ -6,3 +6,5 @@ CONFIG -= debug_and_release_target CONFIG += exceptions TARGET = verifyexceptionthrown + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/warnings/warnings.pro b/tests/auto/testlib/selftests/warnings/warnings.pro index 0c6cddcefb..a0bd2c62ba 100644 --- a/tests/auto/testlib/selftests/warnings/warnings.pro +++ b/tests/auto/testlib/selftests/warnings/warnings.pro @@ -5,3 +5,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = warnings + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/xunit/xunit.pro b/tests/auto/testlib/selftests/xunit/xunit.pro index b8c606e828..becb46ce8b 100644 --- a/tests/auto/testlib/selftests/xunit/xunit.pro +++ b/tests/auto/testlib/selftests/xunit/xunit.pro @@ -6,3 +6,5 @@ mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target TARGET = xunit + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) -- cgit v1.2.3 From 991c498905e2083fadfa8ef6e1ea84d5488e92ad Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Wed, 16 Jan 2019 16:07:28 +0100 Subject: Fix inline ASM to use local labels for jump operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-local ASM labels break for this test when compiled with clang. Change-Id: I15bd250a991c3b03bbc88459a6358090bd157444 Reviewed-by: Jesus Fernandez Reviewed-by: Thiago Macieira Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp index 0d3e884a56..fe83ee6608 100644 --- a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp +++ b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp @@ -68,9 +68,9 @@ void tst_BenchlibCallgrind::twoHundredMillionInstructions() QBENCHMARK { __asm__ __volatile__( "mov $100000000,%%eax \n" - "LOOPTOP: \n" + "1: \n" "dec %%eax \n" - "jnz LOOPTOP \n" + "jnz 1b \n" : /* no output */ : /* no input */ : /* clobber */ "eax" -- cgit v1.2.3 From 9906cc57ed3eed64d534f43c677bb16e08561bb6 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 15 Jan 2019 09:58:34 +0100 Subject: testlib: Add BXPASS and BXFAIL Prioritize blacklisting over QEXPECT_FAIL so that a test that is blacklisted no longer fails if QEXPECT_FAIL returns true unexpectedly. To reflect this state properly, the two values of BXPASS and BXFAIL were added to testlib's output. [ChangeLog][Important Behavior Changes][QtTestLib] Blacklisting of tests will be taken into account for XPASS and XFAIL. A blacklisted test that causes an XPASS will no longer be a fail. Task-number: QTBUG-72928 Change-Id: Ia2232fdc714d405fa3fd9aea6c89eb2836bc5950 Reviewed-by: Edward Welbourne --- tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp | 6 +++--- tests/auto/testlib/selftests/expected_blacklisted.lightxml | 8 ++++---- tests/auto/testlib/selftests/expected_blacklisted.teamcity | 3 +-- tests/auto/testlib/selftests/expected_blacklisted.txt | 6 +++--- tests/auto/testlib/selftests/expected_blacklisted.xml | 8 ++++---- tests/auto/testlib/selftests/expected_blacklisted.xunitxml | 11 +++-------- 6 files changed, 18 insertions(+), 24 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp index 8578752e22..b25489ca00 100644 --- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp +++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp @@ -64,14 +64,14 @@ void tst_Blacklisted::fail() void tst_Blacklisted::xfail() { - QEXPECT_FAIL("", "This test should XFAIL then BFAIL", Abort); + QEXPECT_FAIL("", "This test should BXFAIL then BPASS", Abort); QVERIFY(false); } void tst_Blacklisted::xpass() { - QEXPECT_FAIL("", "This test should XPASS", Abort); - QVERIFY2(true, "This test should XPASS, blacklist ignored for XPASS"); + QEXPECT_FAIL("", "This test should BXPASS", Abort); + QVERIFY2(true, "This test should BXPASS"); } void tst_Blacklisted::messages() diff --git a/tests/auto/testlib/selftests/expected_blacklisted.lightxml b/tests/auto/testlib/selftests/expected_blacklisted.lightxml index 4193628e7c..5cf62ed104 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.lightxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.lightxml @@ -24,15 +24,15 @@ - - + + - - + + diff --git a/tests/auto/testlib/selftests/expected_blacklisted.teamcity b/tests/auto/testlib/selftests/expected_blacklisted.teamcity index 8180a7ce76..42b75b752b 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.teamcity +++ b/tests/auto/testlib/selftests/expected_blacklisted.teamcity @@ -7,10 +7,9 @@ ##teamcity[testStarted name='fail()' flowId='tst_Blacklisted'] ##teamcity[testFinished name='fail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xfail()' flowId='tst_Blacklisted'] -##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BFAIL' flowId='tst_Blacklisted'] +##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted'] ##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xpass()' flowId='tst_Blacklisted'] -##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)' flowId='tst_Blacklisted'] ##teamcity[testFinished name='xpass()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='messages()' flowId='tst_Blacklisted'] ##teamcity[testStdOut name='messages()' out='QWARN: This is a warning that should not appear in silent test output|nWARNING |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This is an internal testlib warning that should not appear in silent test output|nQDEBUG: This is a debug message that should not appear in silent test output|nQSYSTEM: This is a critical message that should not appear in silent test output|nQINFO: This is an info message that should not appear in silent test output|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This is an internal testlib info message that should not appear in silent test output|nQFATAL: This is a fatal error message that should still appear in silent test output' flowId='tst_Blacklisted'] diff --git a/tests/auto/testlib/selftests/expected_blacklisted.txt b/tests/auto/testlib/selftests/expected_blacklisted.txt index 6fa2403b59..fccaa7d8c3 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.txt +++ b/tests/auto/testlib/selftests/expected_blacklisted.txt @@ -6,10 +6,10 @@ SKIP : tst_Blacklisted::skip() This test should SKIP Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BFAIL : tst_Blacklisted::fail() 'false' returned FALSE. (This test should BFAIL) Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] -XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BFAIL +BXFAIL : tst_Blacklisted::xfail() This test should BXFAIL then BPASS Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BPASS : tst_Blacklisted::xfail() -XPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS) +BXPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should BXPASS) Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] QWARN : tst_Blacklisted::messages() This is a warning that should not appear in silent test output WARNING: tst_Blacklisted::messages() This is an internal testlib warning that should not appear in silent test output @@ -22,5 +22,5 @@ INFO : tst_Blacklisted::messages() This is an internal testlib info message th QFATAL : tst_Blacklisted::messages() This is a fatal error message that should still appear in silent test output BFAIL : tst_Blacklisted::messages() Received a fatal error. Loc: [Unknown file(0)] -Totals: 1 passed, 1 failed, 1 skipped, 4 blacklisted, 0ms +Totals: 1 passed, 0 failed, 1 skipped, 5 blacklisted, 0ms ********* Finished testing of tst_Blacklisted ********* diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xml b/tests/auto/testlib/selftests/expected_blacklisted.xml index 443bc6b199..04d7e6c828 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xml @@ -26,15 +26,15 @@ - - + + - - + + diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml index 2752bc18b4..6e192687fb 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml @@ -1,5 +1,5 @@ - + @@ -11,12 +11,8 @@ - - - - - - + + @@ -28,7 +24,6 @@ - -- cgit v1.2.3 From 7dd41b32678b8cedc6e03932ac4330d147f25f4a Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 30 Jan 2019 12:02:27 +0100 Subject: generate_expected_output.py: placate FutureWarning from python Regexes have long specified that a [ as the first character inside a [...] is just a literal [, but apparently we need to escape it now, to avoid a "nested set" FutureWarning. Change-Id: I76a48c9aafb0684a1d6b0d5284fe9852c9ea0e43 Reviewed-by: Friedemann Kleint Reviewed-by: Samuel Gaist --- tests/auto/testlib/selftests/generate_expected_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 1996416e8c..111870b3fb 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -132,7 +132,7 @@ class Cleaner (object): # Add path to specific sources and to tst_*.cpp if missing (for in-source builds): patterns += ((r'(^|[^/])\b(qtestcase.cpp)\b', r'\1qtbase/src/testlib/\2'), # Add more special cases here, if they show up ! - (r'([[" ])\.\./(counting/tst_counting.cpp)\b', + (r'([\[" ])\.\./(counting/tst_counting.cpp)\b', r'\1' + os.path.sep.join(hereNames + (r'\2',))), # The common pattern: (r'(^|[^/])\b(tst_)?([a-z]+\d*)\.cpp\b', -- cgit v1.2.3 From d84912838c1df383d2a9537aefa34e06a9780f08 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 16 Jan 2019 13:49:06 +0100 Subject: Add some missing expected_*.tap files for the testlib selftest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only for tests that have existing expected_*.* files for other formats, though. Change-Id: I34ca1900d88454f300e04d849a608c378009489b Reviewed-by: Tor Arne Vestbø --- .../selftests/expected_benchlibcallgrind.tap | 15 ++++++ .../testlib/selftests/expected_benchliboptions.tap | 27 +++++++++++ .../testlib/selftests/expected_blacklisted.tap | 44 ++++++++++++++++++ .../testlib/selftests/expected_differentexec.tap | 21 +++++++++ .../auto/testlib/selftests/expected_multiexec.tap | 45 ++++++++++++++++++ .../testlib/selftests/expected_qexecstringlist.tap | 54 ++++++++++++++++++++++ tests/auto/testlib/selftests/expected_silent.tap | 42 +++++++++++++++++ 7 files changed, 248 insertions(+) create mode 100644 tests/auto/testlib/selftests/expected_benchlibcallgrind.tap create mode 100644 tests/auto/testlib/selftests/expected_benchliboptions.tap create mode 100644 tests/auto/testlib/selftests/expected_blacklisted.tap create mode 100644 tests/auto/testlib/selftests/expected_differentexec.tap create mode 100644 tests/auto/testlib/selftests/expected_multiexec.tap create mode 100644 tests/auto/testlib/selftests/expected_qexecstringlist.tap create mode 100644 tests/auto/testlib/selftests/expected_silent.tap (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.tap b/tests/auto/testlib/selftests/expected_benchlibcallgrind.tap new file mode 100644 index 0000000000..953756ac9e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.tap @@ -0,0 +1,15 @@ +TAP version 13 +# tst_BenchlibCallgrind +TAP version 13 +# tst_BenchlibCallgrind +ok 1 - initTestCase() +ok 2 - twoHundredMillionInstructions() # SKIP This test is only defined for gcc and x86. +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 2 +# fail 0 +1..0 +# tests 0 +# pass 0 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.tap b/tests/auto/testlib/selftests/expected_benchliboptions.tap new file mode 100644 index 0000000000..6a006ea881 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchliboptions.tap @@ -0,0 +1,27 @@ +TAP version 13 +# tst_BenchlibOptions +ok 1 - initTestCase() +ok 2 - threeEvents() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_BenchlibFifteenIterations +ok 1 - initTestCase() +ok 2 - threeEvents() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_BenchlibOneHundredMinimum +ok 1 - initTestCase() +ok 2 - threeEvents() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap new file mode 100644 index 0000000000..7d3b2b0cc8 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_blacklisted.tap @@ -0,0 +1,44 @@ +TAP version 13 +# tst_Blacklisted +ok 1 - initTestCase() +ok 2 - pass() # TODO +ok 3 - skip() # SKIP This test should SKIP +not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL) + --- + type: QVERIFY + message: This test should BFAIL + wanted: true (false) + found: false (false) + expected: true (false) + actual: false (false) + at: tst_Blacklisted::fail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:62) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 62 + ... +not ok 4 - xfail() # TODO This test should BXFAIL then BPASS + --- + # This test should BXFAIL then BPASS + at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:68) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 68 + ... +ok 5 - xfail() # TODO +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS) +# This is a warning that should not appear in silent test output +# This is an internal testlib warning that should not appear in silent test output +# This is a debug message that should not appear in silent test output +# This is a critical message that should not appear in silent test output +# This is an info message that should not appear in silent test output +# This is an internal testlib info message that should not appear in silent test output +# This is a fatal error message that should still appear in silent test output +not ok 7 - messages() # TODO Received a fatal error. + --- + # Received a fatal error. + at: tst_Blacklisted::messages() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..7 +# tests 7 +# pass 1 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_differentexec.tap b/tests/auto/testlib/selftests/expected_differentexec.tap new file mode 100644 index 0000000000..30ee50bc08 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_differentexec.tap @@ -0,0 +1,21 @@ +********* Start testing of tst_TestA ********* +Config: Using QtTest library +PASS : tst_TestA::initTestCase() +PASS : tst_TestA::slotName() +PASS : tst_TestA::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_TestA ********* +********* Start testing of tst_TestA ********* +Config: Using QtTest library +PASS : tst_TestA::initTestCase() +PASS : tst_TestA::slotName() +PASS : tst_TestA::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_TestA ********* +********* Start testing of tst_TestB ********* +Config: Using QtTest library +PASS : tst_TestB::initTestCase() +PASS : tst_TestB::slotName() +PASS : tst_TestB::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_TestB ********* diff --git a/tests/auto/testlib/selftests/expected_multiexec.tap b/tests/auto/testlib/selftests/expected_multiexec.tap new file mode 100644 index 0000000000..ce6a7b37dd --- /dev/null +++ b/tests/auto/testlib/selftests/expected_multiexec.tap @@ -0,0 +1,45 @@ +TAP version 13 +# tst_Nothing +ok 1 - initTestCase() +ok 2 - nothing() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_Nothing +ok 1 - initTestCase() +ok 2 - nothing() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_Nothing +ok 1 - initTestCase() +ok 2 - nothing() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_Nothing +ok 1 - initTestCase() +ok 2 - nothing() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 +TAP version 13 +# tst_Nothing +ok 1 - initTestCase() +ok 2 - nothing() +ok 3 - cleanupTestCase() +1..3 +# tests 3 +# pass 3 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.tap b/tests/auto/testlib/selftests/expected_qexecstringlist.tap new file mode 100644 index 0000000000..45aa7c4a3c --- /dev/null +++ b/tests/auto/testlib/selftests/expected_qexecstringlist.tap @@ -0,0 +1,54 @@ +TAP version 13 +# tst_QExecStringList +ok 1 - initTestCase() +ok 2 - testA() +ok 3 - testB(Data1) +ok 4 - testB(Data2) +ok 5 - testB(Data3) +ok 6 - testC() +ok 7 - cleanupTestCase() +1..7 +# tests 7 +# pass 7 +# fail 0 +********* Start testing of tst_QExecStringList ********* +Config: Using QtTest library +PASS : tst_QExecStringList::initTestCase() +PASS : tst_QExecStringList::testA() +PASS : tst_QExecStringList::testB(Data1) +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::testB(Data3) +PASS : tst_QExecStringList::testC() +PASS : tst_QExecStringList::cleanupTestCase() +Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_QExecStringList ********* +********* Start testing of tst_QExecStringList ********* +Config: Using QtTest library +PASS : tst_QExecStringList::initTestCase() +PASS : tst_QExecStringList::testA() +PASS : tst_QExecStringList::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_QExecStringList ********* +********* Start testing of tst_QExecStringList ********* +Config: Using QtTest library +PASS : tst_QExecStringList::initTestCase() +PASS : tst_QExecStringList::testB(Data1) +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::testB(Data3) +PASS : tst_QExecStringList::cleanupTestCase() +Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_QExecStringList ********* +********* Start testing of tst_QExecStringList ********* +Config: Using QtTest library +PASS : tst_QExecStringList::initTestCase() +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_QExecStringList ********* +********* Start testing of tst_QExecStringList ********* +Config: Using QtTest library +PASS : tst_QExecStringList::initTestCase() +PASS : tst_QExecStringList::testC() +PASS : tst_QExecStringList::cleanupTestCase() +Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_QExecStringList ********* diff --git a/tests/auto/testlib/selftests/expected_silent.tap b/tests/auto/testlib/selftests/expected_silent.tap new file mode 100644 index 0000000000..c5f7716390 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_silent.tap @@ -0,0 +1,42 @@ +TAP version 13 +# tst_Silent +ok 1 - initTestCase() +ok 2 - pass() +ok 3 - skip() # SKIP This test should skip +not ok 4 - fail() + --- + type: QVERIFY + message: This test should fail + wanted: true (false) + found: false (false) + expected: true (false) + actual: false (false) + at: tst_Silent::fail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:60) + file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp + line: 60 + ... +not ok 5 - xfail() # TODO This test should XFAIL + --- + at: tst_Silent::xfail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:66) + file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp + line: 66 + ... +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should XPASS) +# This is a warning that should not appear in silent test output +# This is an internal testlib warning that should not appear in silent test output +# This is a debug message that should not appear in silent test output +# This is a critical message that should not appear in silent test output +# This is an info message that should not appear in silent test output +# This is an internal testlib info message that should not appear in silent test output +# This is a fatal error message that should still appear in silent test output +not ok 7 - messages() + --- + # Received a fatal error. + at: tst_Silent::messages() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..7 +# tests 7 +# pass 3 +# fail 3 -- cgit v1.2.3 From 150c6fb74bb7bc702d1d319a1e9acba6b644944b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 14 Jan 2019 20:50:41 +0100 Subject: Add testlib selftests for double and for non-finite float and double Tidied up the existing float tests in the process. (In particular, s/SUCCESS/PASS/ since that matches real test output.) These verify that QCOMPARE() handles floats and doubles as intended. Extended the existing qFuzzyCompare tests to probe the boundaries of the ranges of values of both types, in the process. Revised the toString that qCompare() uses to give enough precision to actually show some of the differences being tested there (12 digits, to match what qFuzzyCompare tests, so as to show different values rather than, e.g. 1e12 for both expected and actual) and to give consistent results for infinities and NaN (MinGW had eccentric versions for these, leading to different output from tests, which thus failed); did the latter also for toString and fixed stray zeros in MinGW's exponents (which made a kludge in tst_selftest.cpp redundant, so I removed that, too). That's further complicated handling of floating-point types, so let's just keep an eye on how expensive that's getting by adding a benchmark test for QTest::toString(). Unfortunately, default settings only get runs that take modest numbers of milliseconds (some as low as 40) while increasing this with -minumumvalue 100 or more gets the process killed - and I'm unable to find out who's doing the killing (it's not QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell). So results are rather noisy; the integral tests exhibit speed-ups by factors up to 5, and slow-downs by factors up to 100, between runs with and without this change, which does not affec the integral tests. The relatively modest slow-downs and speed-ups in the floating point tests thus seem likely to be happenstance rather than signal. Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e Reviewed-by: Ulf Hermann --- .../auto/testlib/selftests/expected_float.lightxml | 403 ++++++++++- tests/auto/testlib/selftests/expected_float.tap | 778 ++++++++++++++++++++- .../auto/testlib/selftests/expected_float.teamcity | 211 +++++- tests/auto/testlib/selftests/expected_float.txt | 258 ++++++- tests/auto/testlib/selftests/expected_float.xml | 403 ++++++++++- .../auto/testlib/selftests/expected_float.xunitxml | 185 ++++- tests/auto/testlib/selftests/float/tst_float.cpp | 150 +++- tests/auto/testlib/selftests/tst_selftests.cpp | 9 - 8 files changed, 2316 insertions(+), 81 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml index 0dbc5dd8c8..79ce33627d 100644 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ b/tests/auto/testlib/selftests/expected_float.lightxml @@ -7,30 +7,423 @@ - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Actual (operandLeft) : 99999 + Expected (operandRight): 99998]]> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap index fae2dc9796..1896bb2fb3 100644 --- a/tests/auto/testlib/selftests/expected_float.tap +++ b/tests/auto/testlib/selftests/expected_float.tap @@ -1,8 +1,386 @@ TAP version 13 # tst_float ok 1 - initTestCase() -ok 2 - floatComparisons(should SUCCEED 1) -not ok 3 - floatComparisons(should FAIL 1) +ok 2 - doubleComparisons(should PASS 1) +not ok 3 - doubleComparisons(should FAIL 1) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 3 (operandRight) + found: 1 (operandLeft) + expected: 3 (operandRight) + actual: 1 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 4 - doubleComparisons(should FAIL 2) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 3e-07 (operandRight) + found: 1e-07 (operandLeft) + expected: 3e-07 (operandRight) + actual: 1e-07 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +ok 5 - doubleComparisons(should PASS 2) +not ok 6 - doubleComparisons(should FAIL 3) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 999999999998 (operandRight) + found: 999999999999 (operandLeft) + expected: 999999999998 (operandRight) + actual: 999999999999 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +ok 7 - doubleComparisons(should PASS 3) +not ok 8 - doubleComparisons(should FAIL 4) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 9.99999999997e-311 (operandRight) + found: 9.99999999999e-311 (operandLeft) + expected: 9.99999999997e-311 (operandRight) + actual: 9.99999999999e-311 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +ok 9 - doubleComparisons(should PASS 4) +not ok 10 - doubleComparisons(should FAIL 5) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 9.99999999997e+306 (operandRight) + found: 9.99999999999e+306 (operandLeft) + expected: 9.99999999997e+306 (operandRight) + actual: 9.99999999999e+306 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +ok 11 - doubleComparisons(should PASS: NaN == NaN) +not ok 12 - doubleComparisons(should FAIL: NaN != 0) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: nan (operandLeft) + expected: 0 (operandRight) + actual: nan (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 13 - doubleComparisons(should FAIL: 0 != NaN) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: nan (operandRight) + found: 0 (operandLeft) + expected: nan (operandRight) + actual: 0 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 14 - doubleComparisons(should FAIL: NaN != 1) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: nan (operandLeft) + expected: 1 (operandRight) + actual: nan (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 15 - doubleComparisons(should FAIL: 1 != NaN) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: nan (operandRight) + found: 1 (operandLeft) + expected: nan (operandRight) + actual: 1 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +ok 16 - doubleComparisons(should PASS: inf == inf) +ok 17 - doubleComparisons(should PASS: -inf == -inf) +not ok 18 - doubleComparisons(should FAIL: inf != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: inf (operandLeft) + expected: -inf (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 19 - doubleComparisons(should FAIL: -inf != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: -inf (operandLeft) + expected: inf (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 20 - doubleComparisons(should FAIL: inf != nan) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: nan (operandRight) + found: inf (operandLeft) + expected: nan (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 21 - doubleComparisons(should FAIL: nan != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: nan (operandLeft) + expected: inf (operandRight) + actual: nan (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 22 - doubleComparisons(should FAIL: -inf != nan) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: nan (operandRight) + found: -inf (operandLeft) + expected: nan (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 23 - doubleComparisons(should FAIL: nan != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: nan (operandLeft) + expected: -inf (operandRight) + actual: nan (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 24 - doubleComparisons(should FAIL: inf != 0) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: inf (operandLeft) + expected: 0 (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 25 - doubleComparisons(should FAIL: 0 != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 0 (operandLeft) + expected: inf (operandRight) + actual: 0 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 26 - doubleComparisons(should FAIL: -inf != 0) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: -inf (operandLeft) + expected: 0 (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 27 - doubleComparisons(should FAIL: 0 != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 0 (operandLeft) + expected: -inf (operandRight) + actual: 0 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 28 - doubleComparisons(should FAIL: inf != 1) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: inf (operandLeft) + expected: 1 (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 29 - doubleComparisons(should FAIL: 1 != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 1 (operandLeft) + expected: inf (operandRight) + actual: 1 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 30 - doubleComparisons(should FAIL: -inf != 1) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: -inf (operandLeft) + expected: 1 (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 31 - doubleComparisons(should FAIL: 1 != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 1 (operandLeft) + expected: -inf (operandRight) + actual: 1 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 32 - doubleComparisons(should FAIL: inf != max) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 1.79769313486e+308 (operandRight) + found: inf (operandLeft) + expected: 1.79769313486e+308 (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 33 - doubleComparisons(should FAIL: inf != -max) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -1.79769313486e+308 (operandRight) + found: inf (operandLeft) + expected: -1.79769313486e+308 (operandRight) + actual: inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 34 - doubleComparisons(should FAIL: max != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 1.79769313486e+308 (operandLeft) + expected: inf (operandRight) + actual: 1.79769313486e+308 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 35 - doubleComparisons(should FAIL: -max != inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: inf (operandRight) + found: -1.79769313486e+308 (operandLeft) + expected: inf (operandRight) + actual: -1.79769313486e+308 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 36 - doubleComparisons(should FAIL: -inf != max) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: 1.79769313486e+308 (operandRight) + found: -inf (operandLeft) + expected: 1.79769313486e+308 (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 37 - doubleComparisons(should FAIL: -inf != -max) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -1.79769313486e+308 (operandRight) + found: -inf (operandLeft) + expected: -1.79769313486e+308 (operandRight) + actual: -inf (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 38 - doubleComparisons(should FAIL: max != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 1.79769313486e+308 (operandLeft) + expected: -inf (operandRight) + actual: 1.79769313486e+308 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 39 - doubleComparisons(should FAIL: -max != -inf) + --- + type: QCOMPARE + message: Compared doubles are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: -1.79769313486e+308 (operandLeft) + expected: -inf (operandRight) + actual: -1.79769313486e+308 (operandLeft) + at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 51 + ... +not ok 40 - floatComparisons(should FAIL 1) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -10,11 +388,12 @@ not ok 3 - floatComparisons(should FAIL 1) found: 1 (operandLeft) expected: 3 (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 124 ... -not ok 4 - floatComparisons(should FAIL 2) +ok 41 - floatComparisons(should PASS 1) +not ok 42 - floatComparisons(should FAIL 2) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -22,24 +401,365 @@ not ok 4 - floatComparisons(should FAIL 2) found: 1e-07 (operandLeft) expected: 3e-07 (operandRight) actual: 1e-07 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +ok 43 - floatComparisons(should PASS 2) +not ok 44 - floatComparisons(should FAIL 3) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 99998 (operandRight) + found: 99999 (operandLeft) + expected: 99998 (operandRight) + actual: 99999 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +ok 45 - floatComparisons(should PASS 3) +not ok 46 - floatComparisons(should FAIL 4) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 9.99971e-40 (operandRight) + found: 9.9999e-40 (operandLeft) + expected: 9.99971e-40 (operandRight) + actual: 9.9999e-40 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +ok 47 - floatComparisons(should PASS 4) +not ok 48 - floatComparisons(should FAIL 5) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 9.9997e+37 (operandRight) + found: 9.9999e+37 (operandLeft) + expected: 9.9997e+37 (operandRight) + actual: 9.9999e+37 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +ok 49 - floatComparisons(should PASS: NaN == NaN) +not ok 50 - floatComparisons(should FAIL: NaN != 0) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: nan (operandLeft) + expected: 0 (operandRight) + actual: nan (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 51 - floatComparisons(should FAIL: 0 != NaN) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: nan (operandRight) + found: 0 (operandLeft) + expected: nan (operandRight) + actual: 0 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 52 - floatComparisons(should FAIL: NaN != 1) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: nan (operandLeft) + expected: 1 (operandRight) + actual: nan (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 53 - floatComparisons(should FAIL: 1 != NaN) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: nan (operandRight) + found: 1 (operandLeft) + expected: nan (operandRight) + actual: 1 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +ok 54 - floatComparisons(should PASS: inf == inf) +ok 55 - floatComparisons(should PASS: -inf == -inf) +not ok 56 - floatComparisons(should FAIL: inf != -inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: inf (operandLeft) + expected: -inf (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 57 - floatComparisons(should FAIL: -inf != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: -inf (operandLeft) + expected: inf (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 58 - floatComparisons(should FAIL: inf != nan) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: nan (operandRight) + found: inf (operandLeft) + expected: nan (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 59 - floatComparisons(should FAIL: nan != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: nan (operandLeft) + expected: inf (operandRight) + actual: nan (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 60 - floatComparisons(should FAIL: -inf != nan) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: nan (operandRight) + found: -inf (operandLeft) + expected: nan (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 61 - floatComparisons(should FAIL: nan != -inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: nan (operandLeft) + expected: -inf (operandRight) + actual: nan (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 62 - floatComparisons(should FAIL: inf != 0) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: inf (operandLeft) + expected: 0 (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 63 - floatComparisons(should FAIL: 0 != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 0 (operandLeft) + expected: inf (operandRight) + actual: 0 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 64 - floatComparisons(should FAIL: -inf != 0) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 0 (operandRight) + found: -inf (operandLeft) + expected: 0 (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 65 - floatComparisons(should FAIL: 0 != -inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 0 (operandLeft) + expected: -inf (operandRight) + actual: 0 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 66 - floatComparisons(should FAIL: inf != 1) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: inf (operandLeft) + expected: 1 (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 67 - floatComparisons(should FAIL: 1 != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 1 (operandLeft) + expected: inf (operandRight) + actual: 1 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 68 - floatComparisons(should FAIL: -inf != 1) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 1 (operandRight) + found: -inf (operandLeft) + expected: 1 (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 69 - floatComparisons(should FAIL: 1 != -inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 1 (operandLeft) + expected: -inf (operandRight) + actual: 1 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 70 - floatComparisons(should FAIL: inf != max) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 3.40282e+38 (operandRight) + found: inf (operandLeft) + expected: 3.40282e+38 (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 71 - floatComparisons(should FAIL: inf != -max) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -3.40282e+38 (operandRight) + found: inf (operandLeft) + expected: -3.40282e+38 (operandRight) + actual: inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 72 - floatComparisons(should FAIL: max != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: 3.40282e+38 (operandLeft) + expected: inf (operandRight) + actual: 3.40282e+38 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 73 - floatComparisons(should FAIL: -max != inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: inf (operandRight) + found: -3.40282e+38 (operandLeft) + expected: inf (operandRight) + actual: -3.40282e+38 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 74 - floatComparisons(should FAIL: -inf != max) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: 3.40282e+38 (operandRight) + found: -inf (operandLeft) + expected: 3.40282e+38 (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 75 - floatComparisons(should FAIL: -inf != -max) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -3.40282e+38 (operandRight) + found: -inf (operandLeft) + expected: -3.40282e+38 (operandRight) + actual: -inf (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 124 + ... +not ok 76 - floatComparisons(should FAIL: max != -inf) + --- + type: QCOMPARE + message: Compared floats are not the same (fuzzy compare) + wanted: -inf (operandRight) + found: 3.40282e+38 (operandLeft) + expected: -inf (operandRight) + actual: 3.40282e+38 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 124 ... -not ok 5 - floatComparisons(should FAIL 3) +not ok 77 - floatComparisons(should FAIL: -max != -inf) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) - wanted: 99999 (operandRight) - found: 99998 (operandLeft) - expected: 99999 (operandRight) - actual: 99998 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + wanted: -inf (operandRight) + found: -3.40282e+38 (operandLeft) + expected: -inf (operandRight) + actual: -3.40282e+38 (operandLeft) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:124) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 124 ... -ok 6 - floatComparisons(should SUCCEED 2) -not ok 7 - compareFloatTests(1e0) +not ok 78 - compareFloatTests(1e0) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -47,11 +767,11 @@ not ok 7 - compareFloatTests(1e0) found: 1 (t1) expected: 3 (t3) actual: 1 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:206) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 206 ... -not ok 8 - compareFloatTests(1e-7) +not ok 79 - compareFloatTests(1e-7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -59,11 +779,11 @@ not ok 8 - compareFloatTests(1e-7) found: 1e-07 (t1) expected: 3e-07 (t3) actual: 1e-07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:206) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 206 ... -not ok 9 - compareFloatTests(1e+7) +not ok 80 - compareFloatTests(1e+7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -71,12 +791,12 @@ not ok 9 - compareFloatTests(1e+7) found: 1e+07 (t1) expected: 3e+07 (t3) actual: 1e+07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:206) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 206 ... -ok 10 - cleanupTestCase() -1..10 -# tests 10 -# pass 4 -# fail 6 +ok 81 - cleanupTestCase() +1..81 +# tests 81 +# pass 16 +# fail 65 diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity index d5b81593d8..9166f644af 100644 --- a/tests/auto/testlib/selftests/expected_float.teamcity +++ b/tests/auto/testlib/selftests/expected_float.teamcity @@ -1,19 +1,220 @@ ##teamcity[testSuiteStarted name='tst_float' flowId='tst_float'] ##teamcity[testStarted name='initTestCase()' flowId='tst_float'] ##teamcity[testFinished name='initTestCase()' flowId='tst_float'] -##teamcity[testStarted name='floatComparisons(should SUCCEED 1)' flowId='tst_float'] -##teamcity[testFinished name='floatComparisons(should SUCCEED 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS 1)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-07|n Expected (operandRight): 3e-07' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS 2)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS 2)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 999999999999|n Expected (operandRight): 999999999998' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS 3)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS 3)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL 4)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 9.99999999999e-311|n Expected (operandRight): 9.99999999997e-311' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL 4)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS 4)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS 4)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL 5)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 9.99999999999e+306|n Expected (operandRight): 9.99999999997e+306' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL 5)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS: NaN == NaN)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS: NaN == NaN)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: NaN != 0)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: NaN != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: NaN != 0)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 0 != NaN)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 0 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 0 != NaN)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: NaN != 1)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: NaN != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: NaN != 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 1 != NaN)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 1 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 1 != NaN)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS: inf == inf)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS: inf == inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should PASS: -inf == -inf)' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should PASS: -inf == -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != nan)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != nan)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: nan != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: nan != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: nan != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != nan)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != nan)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: nan != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: nan != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: nan != -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != 0)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != 0)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 0 != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 0 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 0 != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != 0)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != 0)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 0 != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 0 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 0 != -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != 1)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 1 != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 1 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 1 != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != 1)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != 1)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: 1 != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: 1 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: 1 != -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != max)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 1.79769313486e+308' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != max)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: inf != -max)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -1.79769313486e+308' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: inf != -max)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: max != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1.79769313486e+308|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: max != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -max != inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -1.79769313486e+308|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -max != inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != max)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 1.79769313486e+308' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != max)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -inf != -max)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): -1.79769313486e+308' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -inf != -max)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: max != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1.79769313486e+308|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: max != -inf)' flowId='tst_float'] +##teamcity[testStarted name='doubleComparisons(should FAIL: -max != -inf)' flowId='tst_float'] +##teamcity[testFailed name='doubleComparisons(should FAIL: -max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : -1.79769313486e+308|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='doubleComparisons(should FAIL: -max != -inf)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should FAIL 1)' flowId='tst_float'] ##teamcity[testFailed name='floatComparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS 1)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS 1)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should FAIL 2)' flowId='tst_float'] ##teamcity[testFailed name='floatComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-07|n Expected (operandRight): 3e-07' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS 2)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS 2)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should FAIL 3)' flowId='tst_float'] -##teamcity[testFailed name='floatComparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 99998|n Expected (operandRight): 99999' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 99999|n Expected (operandRight): 99998' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should FAIL 3)' flowId='tst_float'] -##teamcity[testStarted name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] -##teamcity[testFinished name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS 3)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS 3)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL 4)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 9.9999e-40|n Expected (operandRight): 9.99971e-40' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL 4)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS 4)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS 4)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL 5)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 9.9999e+37|n Expected (operandRight): 9.9997e+37' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL 5)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS: NaN == NaN)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS: NaN == NaN)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: NaN != 0)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: NaN != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: NaN != 0)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 0 != NaN)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 0 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 0 != NaN)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: NaN != 1)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: NaN != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: NaN != 1)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 1 != NaN)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 1 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 1 != NaN)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS: inf == inf)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS: inf == inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should PASS: -inf == -inf)' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should PASS: -inf == -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != nan)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != nan)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: nan != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: nan != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: nan != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != nan)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): nan' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != nan)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: nan != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: nan != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: nan != -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != 0)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != 0)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 0 != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 0 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 0 != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != 0)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 0' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != 0)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 0 != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 0 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 0 != -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != 1)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != 1)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 1 != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 1 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 1 != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != 1)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 1' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != 1)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: 1 != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: 1 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: 1 != -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != max)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 3.40282e+38' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != max)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: inf != -max)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -3.40282e+38' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: inf != -max)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: max != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 3.40282e+38|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: max != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -max != inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -3.40282e+38|n Expected (operandRight): inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -max != inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != max)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 3.40282e+38' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != max)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -inf != -max)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): -3.40282e+38' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -inf != -max)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: max != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 3.40282e+38|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: max != -inf)' flowId='tst_float'] +##teamcity[testStarted name='floatComparisons(should FAIL: -max != -inf)' flowId='tst_float'] +##teamcity[testFailed name='floatComparisons(should FAIL: -max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -3.40282e+38|n Expected (operandRight): -inf' flowId='tst_float'] +##teamcity[testFinished name='floatComparisons(should FAIL: -max != -inf)' flowId='tst_float'] ##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float'] ##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float'] ##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float'] diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt index 8abea6a67e..3134196a9c 100644 --- a/tests/auto/testlib/selftests/expected_float.txt +++ b/tests/auto/testlib/selftests/expected_float.txt @@ -1,20 +1,268 @@ ********* Start testing of tst_float ********* Config: Using QtTest library PASS : tst_float::initTestCase() -PASS : tst_float::floatComparisons(should SUCCEED 1) +PASS : tst_float::doubleComparisons(should PASS 1) +FAIL! : tst_float::doubleComparisons(should FAIL 1) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL 2) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1e-07 + Expected (operandRight): 3e-07 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::doubleComparisons(should PASS 2) +FAIL! : tst_float::doubleComparisons(should FAIL 3) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 999999999999 + Expected (operandRight): 999999999998 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::doubleComparisons(should PASS 3) +FAIL! : tst_float::doubleComparisons(should FAIL 4) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 9.99999999999e-311 + Expected (operandRight): 9.99999999997e-311 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::doubleComparisons(should PASS 4) +FAIL! : tst_float::doubleComparisons(should FAIL 5) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 9.99999999999e+306 + Expected (operandRight): 9.99999999997e+306 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::doubleComparisons(should PASS: NaN == NaN) +FAIL! : tst_float::doubleComparisons(should FAIL: NaN != 0) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 0 != NaN) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: NaN != 1) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 1 != NaN) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::doubleComparisons(should PASS: inf == inf) +PASS : tst_float::doubleComparisons(should PASS: -inf == -inf) +FAIL! : tst_float::doubleComparisons(should FAIL: inf != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: inf != nan) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: nan != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != nan) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: nan != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: inf != 0) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 0 != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != 0) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 0 != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: inf != 1) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 1 != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != 1) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: 1 != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: inf != max) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 1.79769313486e+308 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: inf != -max) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): -1.79769313486e+308 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: max != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1.79769313486e+308 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -max != inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -1.79769313486e+308 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != max) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 1.79769313486e+308 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -inf != -max) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): -1.79769313486e+308 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: max != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : 1.79769313486e+308 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::doubleComparisons(should FAIL: -max != -inf) Compared doubles are not the same (fuzzy compare) + Actual (operandLeft) : -1.79769313486e+308 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] FAIL! : tst_float::floatComparisons(should FAIL 1) Compared floats are not the same (fuzzy compare) Actual (operandLeft) : 1 Expected (operandRight): 3 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS 1) FAIL! : tst_float::floatComparisons(should FAIL 2) Compared floats are not the same (fuzzy compare) Actual (operandLeft) : 1e-07 Expected (operandRight): 3e-07 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS 2) FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the same (fuzzy compare) - Actual (operandLeft) : 99998 - Expected (operandRight): 99999 + Actual (operandLeft) : 99999 + Expected (operandRight): 99998 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS 3) +FAIL! : tst_float::floatComparisons(should FAIL 4) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 9.9999e-40 + Expected (operandRight): 9.99971e-40 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS 4) +FAIL! : tst_float::floatComparisons(should FAIL 5) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 9.9999e+37 + Expected (operandRight): 9.9997e+37 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS: NaN == NaN) +FAIL! : tst_float::floatComparisons(should FAIL: NaN != 0) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 0 != NaN) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: NaN != 1) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 1 != NaN) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::floatComparisons(should PASS: inf == inf) +PASS : tst_float::floatComparisons(should PASS: -inf == -inf) +FAIL! : tst_float::floatComparisons(should FAIL: inf != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: inf != nan) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: nan != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != nan) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): nan + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: nan != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : nan + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: inf != 0) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 0 != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != 0) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 0 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 0 != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 0 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: inf != 1) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 1 != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != 1) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 1 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: 1 != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: inf != max) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): 3.40282e+38 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: inf != -max) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : inf + Expected (operandRight): -3.40282e+38 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: max != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 3.40282e+38 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -max != inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -3.40282e+38 + Expected (operandRight): inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != max) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): 3.40282e+38 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -inf != -max) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -inf + Expected (operandRight): -3.40282e+38 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: max != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : 3.40282e+38 + Expected (operandRight): -inf + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::floatComparisons(should FAIL: -max != -inf) Compared floats are not the same (fuzzy compare) + Actual (operandLeft) : -3.40282e+38 + Expected (operandRight): -inf Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] -PASS : tst_float::floatComparisons(should SUCCEED 2) FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare) Actual (t1): 1 Expected (t3): 3 @@ -28,5 +276,5 @@ FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fu Expected (t3): 3e+07 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::cleanupTestCase() -Totals: 4 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms +Totals: 16 passed, 65 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_float ********* diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml index 096e1a5b54..da934eead3 100644 --- a/tests/auto/testlib/selftests/expected_float.xml +++ b/tests/auto/testlib/selftests/expected_float.xml @@ -9,30 +9,423 @@ - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Actual (operandLeft) : 99999 + Expected (operandRight): 99998]]> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml index 5de14e8d9b..ba96b16fe6 100644 --- a/tests/auto/testlib/selftests/expected_float.xunitxml +++ b/tests/auto/testlib/selftests/expected_float.xunitxml @@ -1,11 +1,106 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Actual (operandLeft) : 99999 + Expected (operandRight): 99998" result="fail"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + ("operandRight"); + + QTest::newRow("should PASS 1") << 0. << 0.; + QTest::newRow("should FAIL 1") << 1.00000 << 3.00000; + QTest::newRow("should FAIL 2") << 1.00000e-7 << 3.00000e-7; + + // QCOMPARE for doubles uses qFuzzyCompare(), which succeeds if the numbers + // differ by no more than 1e-12 times the smaller value. Thus + // QCOMPARE(1e12-2, 1e12-1) should fail, while QCOMPARE(1e12+1, 1e12+2) + // should pass. + + QTest::newRow("should PASS 2") << 1e12 + 1. << 1e12 + 2.; + QTest::newRow("should FAIL 3") << 1e12 - 1. << 1e12 - 2.; + // ... but rounding makes that a bit unrelaible when scaled close to the bounds. + QTest::newRow("should PASS 3") << 1e-310 + 1e-322 << 1e-310 + 2e-322; + QTest::newRow("should FAIL 4") << 1e-310 - 1e-322 << 1e-310 - 3e-322; + QTest::newRow("should PASS 4") << 1e307 + 1e295 << 1e307 + 2e295; + QTest::newRow("should FAIL 5") << 1e307 - 1e295 << 1e307 - 3e295; + + // QCOMPARE special-cases non-finite values + if (std::numeric_limits::has_quiet_NaN) { + const double nan = std::numeric_limits::quiet_NaN(); + QTest::newRow("should PASS: NaN == NaN") << nan << nan; + QTest::newRow("should FAIL: NaN != 0") << nan << 0.; + QTest::newRow("should FAIL: 0 != NaN") << 0. << nan; + QTest::newRow("should FAIL: NaN != 1") << nan << 1.; + QTest::newRow("should FAIL: 1 != NaN") << 1. << nan; + } + if (std::numeric_limits::has_infinity) { + const double uge = std::numeric_limits::infinity(); + QTest::newRow("should PASS: inf == inf") << uge << uge; + QTest::newRow("should PASS: -inf == -inf") << -uge << -uge; + QTest::newRow("should FAIL: inf != -inf") << uge << -uge; + QTest::newRow("should FAIL: -inf != inf") << -uge << uge; + if (std::numeric_limits::has_quiet_NaN) { + const double nan = std::numeric_limits::quiet_NaN(); + QTest::newRow("should FAIL: inf != nan") << uge << nan; + QTest::newRow("should FAIL: nan != inf") << nan << uge; + QTest::newRow("should FAIL: -inf != nan") << -uge << nan; + QTest::newRow("should FAIL: nan != -inf") << nan << -uge; + } + QTest::newRow("should FAIL: inf != 0") << uge << 0.; + QTest::newRow("should FAIL: 0 != inf") << 0. << uge; + QTest::newRow("should FAIL: -inf != 0") << -uge << 0.; + QTest::newRow("should FAIL: 0 != -inf") << 0. << -uge; + QTest::newRow("should FAIL: inf != 1") << uge << 1.; + QTest::newRow("should FAIL: 1 != inf") << 1. << uge; + QTest::newRow("should FAIL: -inf != 1") << -uge << 1.; + QTest::newRow("should FAIL: 1 != -inf") << 1. << -uge; + + const double big = std::numeric_limits::max(); + QTest::newRow("should FAIL: inf != max") << uge << big; + QTest::newRow("should FAIL: inf != -max") << uge << -big; + QTest::newRow("should FAIL: max != inf") << big << uge; + QTest::newRow("should FAIL: -max != inf") << -big << uge; + QTest::newRow("should FAIL: -inf != max") << -uge << big; + QTest::newRow("should FAIL: -inf != -max") << -uge << -big; + QTest::newRow("should FAIL: max != -inf") << big << -uge; + QTest::newRow("should FAIL: -max != -inf") << -big << -uge; + } +} + void tst_float::floatComparisons() const { QFETCH(float, operandLeft); @@ -53,30 +129,64 @@ void tst_float::floatComparisons_data() const QTest::addColumn("operandLeft"); QTest::addColumn("operandRight"); - QTest::newRow("should SUCCEED 1") - << float(0) - << float(0); - - QTest::newRow("should FAIL 1") - << float(1.00000) - << float(3.00000); - - QTest::newRow("should FAIL 2") - << float(1.00000e-7f) - << float(3.00000e-7f); + QTest::newRow("should FAIL 1") << 1.00000f << 3.00000f; + QTest::newRow("should PASS 1") << 0.f << 0.f; + QTest::newRow("should FAIL 2") << 1.00000e-7f << 3.00000e-7f; // QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers - // differ by no more than 1/100,000th of the smaller value. Thus - // QCOMPARE(99998, 99999) should fail, while QCOMPARE(100001, 100002) + // differ by no more than 1e-5 times the smaller value. Thus + // QCOMPARE(1e5-2, 1e5-1) should fail, while QCOMPARE(1e5+1, 1e5+2) // should pass. - QTest::newRow("should FAIL 3") - << float(99998) - << float(99999); - - QTest::newRow("should SUCCEED 2") - << float(100001) - << float(100002); + QTest::newRow("should PASS 2") << 1e5f + 1.f << 1e5f + 2.f; + QTest::newRow("should FAIL 3") << 1e5f - 1.f << 1e5f - 2.f; + // ... but rounding makes that a bit unrelaible when scaled close to the bounds. + QTest::newRow("should PASS 3") << 1e-39f + 1e-44f << 1e-39f + 2e-44f; + QTest::newRow("should FAIL 4") << 1e-39f - 1e-44f << 1e-39f - 3e-44f; + QTest::newRow("should PASS 4") << 1e38f + 1e33f << 1e38f + 2e33f; + QTest::newRow("should FAIL 5") << 1e38f - 1e33f << 1e38f - 3e33f; + + // QCOMPARE special-cases non-finite values + if (std::numeric_limits::has_quiet_NaN) { + const float nan = std::numeric_limits::quiet_NaN(); + QTest::newRow("should PASS: NaN == NaN") << nan << nan; + QTest::newRow("should FAIL: NaN != 0") << nan << 0.f; + QTest::newRow("should FAIL: 0 != NaN") << 0.f << nan; + QTest::newRow("should FAIL: NaN != 1") << nan << 1.f; + QTest::newRow("should FAIL: 1 != NaN") << 1.f << nan; + } + if (std::numeric_limits::has_infinity) { + const float uge = std::numeric_limits::infinity(); + QTest::newRow("should PASS: inf == inf") << uge << uge; + QTest::newRow("should PASS: -inf == -inf") << -uge << -uge; + QTest::newRow("should FAIL: inf != -inf") << uge << -uge; + QTest::newRow("should FAIL: -inf != inf") << -uge << uge; + if (std::numeric_limits::has_quiet_NaN) { + const float nan = std::numeric_limits::quiet_NaN(); + QTest::newRow("should FAIL: inf != nan") << uge << nan; + QTest::newRow("should FAIL: nan != inf") << nan << uge; + QTest::newRow("should FAIL: -inf != nan") << -uge << nan; + QTest::newRow("should FAIL: nan != -inf") << nan << -uge; + } + QTest::newRow("should FAIL: inf != 0") << uge << 0.f; + QTest::newRow("should FAIL: 0 != inf") << 0.f << uge; + QTest::newRow("should FAIL: -inf != 0") << -uge << 0.f; + QTest::newRow("should FAIL: 0 != -inf") << 0.f << -uge; + QTest::newRow("should FAIL: inf != 1") << uge << 1.f; + QTest::newRow("should FAIL: 1 != inf") << 1.f << uge; + QTest::newRow("should FAIL: -inf != 1") << -uge << 1.f; + QTest::newRow("should FAIL: 1 != -inf") << 1.f << -uge; + + const float big = std::numeric_limits::max(); + QTest::newRow("should FAIL: inf != max") << uge << big; + QTest::newRow("should FAIL: inf != -max") << uge << -big; + QTest::newRow("should FAIL: max != inf") << big << uge; + QTest::newRow("should FAIL: -max != inf") << -big << uge; + QTest::newRow("should FAIL: -inf != max") << -uge << big; + QTest::newRow("should FAIL: -inf != -max") << -uge << -big; + QTest::newRow("should FAIL: max != -inf") << big << -uge; + QTest::newRow("should FAIL: -max != -inf") << -big << -uge; + } } void tst_float::compareFloatTests() const diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 08c6dec191..8baca5bdad 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -782,15 +782,6 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QString expectedFileName = expectedFileNameFromTest(subdir, logger); QByteArrayList exp = expectedResult(expectedFileName); if (!exp.isEmpty()) { -#ifdef Q_CC_MINGW - // MinGW formats double numbers differently (last verified with 7.1) - if (n == 0 && subdir == QStringLiteral("float")) { - for (int i = 0; i < exp.size(); ++i) { - exp[i].replace("e-07", "e-007"); - exp[i].replace("e+07", "e+007"); - } - } -#endif if (!compareOutput(logger, subdir, actualOutputs[n], res, exp, &errorMessage)) { errorMessage.prepend(QLatin1Char('"') + logger + QLatin1String("\", ") + expectedFileName + QLatin1Char(' ')); -- cgit v1.2.3 From f20adcde3079227b063b747e6bd91f8fd94c4866 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 20 Nov 2018 19:57:25 +0100 Subject: Dodge qFatal() so as to get coverage results despite it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The silent and blacklisted selftests of testlib end in a qFatal(), to test its messaging is handled correctly. However, this prevents hooks in main() from saving coverage data when we're gathering that. So use a transient signal handler that longjmp()s back to a setjmp() just before the qFatal() to let the test complete normally (but, since qFatal() does something different on MS-Win, don't apply this to it). Note that testlib's internal FatalSignalHandler handles all fatal signals *except* SIGABRT, so this isn't over-riding it. (In any case, this restores the prior signal handler in setjmp()'s catch branch.) Added missing expected_silent.tap test output while checking that this change doesn't affect (the rest of) the test output. Change-Id: I7e460581ad93e26639c066b3229438a66fd299de Reviewed-by: Tor Arne Vestbø --- .../selftests/blacklisted/tst_blacklisted.cpp | 21 ++++++++++- tests/auto/testlib/selftests/expected_silent.tap | 42 ++++++++++++++++++++++ tests/auto/testlib/selftests/silent/tst_silent.cpp | 21 ++++++++++- 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 tests/auto/testlib/selftests/expected_silent.tap (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp index 90520385ec..9c08af382a 100644 --- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp +++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp @@ -75,6 +75,17 @@ void tst_Blacklisted::xpass() QVERIFY2(true, "This test should XPASS, blacklist ignored for XPASS"); } +#ifndef Q_OS_WIN +#include +#include + +static jmp_buf state; +static void abort_handler(int signal) +{ + longjmp(state, 1); +} +#endif + void tst_Blacklisted::messages() { qWarning("This is a warning that should not appear in silent test output"); @@ -83,7 +94,15 @@ void tst_Blacklisted::messages() qCritical("This is a critical message that should not appear in silent test output"); qInfo("This is an info message that should not appear in silent test output"); QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__); - qFatal("This is a fatal error message that should still appear in silent test output"); + +#ifndef Q_OS_WIN + // We're testing qFatal, but we don't want to actually std::abort() ! + auto prior = signal(SIGABRT, abort_handler); + if (setjmp(state)) + signal(SIGABRT, prior); + else +#endif + qFatal("This is a fatal error message that should still appear in silent test output"); } QTEST_MAIN(tst_Blacklisted) diff --git a/tests/auto/testlib/selftests/expected_silent.tap b/tests/auto/testlib/selftests/expected_silent.tap new file mode 100644 index 0000000000..c5f7716390 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_silent.tap @@ -0,0 +1,42 @@ +TAP version 13 +# tst_Silent +ok 1 - initTestCase() +ok 2 - pass() +ok 3 - skip() # SKIP This test should skip +not ok 4 - fail() + --- + type: QVERIFY + message: This test should fail + wanted: true (false) + found: false (false) + expected: true (false) + actual: false (false) + at: tst_Silent::fail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:60) + file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp + line: 60 + ... +not ok 5 - xfail() # TODO This test should XFAIL + --- + at: tst_Silent::xfail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:66) + file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp + line: 66 + ... +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should XPASS) +# This is a warning that should not appear in silent test output +# This is an internal testlib warning that should not appear in silent test output +# This is a debug message that should not appear in silent test output +# This is a critical message that should not appear in silent test output +# This is an info message that should not appear in silent test output +# This is an internal testlib info message that should not appear in silent test output +# This is a fatal error message that should still appear in silent test output +not ok 7 - messages() + --- + # Received a fatal error. + at: tst_Silent::messages() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..7 +# tests 7 +# pass 3 +# fail 3 diff --git a/tests/auto/testlib/selftests/silent/tst_silent.cpp b/tests/auto/testlib/selftests/silent/tst_silent.cpp index 97fbbfd30a..cf3c35dec4 100644 --- a/tests/auto/testlib/selftests/silent/tst_silent.cpp +++ b/tests/auto/testlib/selftests/silent/tst_silent.cpp @@ -72,6 +72,17 @@ void tst_Silent::xpass() QVERIFY2(true, "This test should XPASS"); } +#ifndef Q_OS_WIN +#include +#include + +static jmp_buf state; +static void abort_handler(int signal) +{ + longjmp(state, 1); +} +#endif + void tst_Silent::messages() { qWarning("This is a warning that should not appear in silent test output"); @@ -80,7 +91,15 @@ void tst_Silent::messages() qCritical("This is a critical message that should not appear in silent test output"); qInfo("This is an info message that should not appear in silent test output"); QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__); - qFatal("This is a fatal error message that should still appear in silent test output"); + +#ifndef Q_OS_WIN + // We're testing qFatal, but we don't want to actually std::abort() ! + auto prior = signal(SIGABRT, abort_handler); + if (setjmp(state)) + signal(SIGABRT, prior); + else +#endif + qFatal("This is a fatal error message that should still appear in silent test output"); } QTEST_MAIN(tst_Silent) -- cgit v1.2.3 From ab53f0f24e6ed01124b189a285686087a337b31b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 21 Feb 2019 20:53:15 +0100 Subject: QtTestLib: unify handling of float and double using suitable templates The QTest::qCompare() implementations were almost duplicates; pull the common code out into a templated version. Tweaked the QTest::toString() specialization for float and double (a macro) and fixed a bous modifier in double's format. The doubleComparisons and floatComparisons tests in the tst_float.cpp selftest shared a large block of tests in common, aside from the difference of type. Break this out into a templated static function to save duplication. This prepares the way for using the same templated code for qfloat16. Change-Id: I2823fd006910c5ff88335d625d1fa05cb7753513 Reviewed-by: Thiago Macieira --- .../auto/testlib/selftests/expected_float.lightxml | 6 +- tests/auto/testlib/selftests/expected_float.tap | 276 ++++++++++----------- .../auto/testlib/selftests/expected_float.teamcity | 4 +- tests/auto/testlib/selftests/expected_float.txt | 2 +- tests/auto/testlib/selftests/expected_float.xml | 6 +- tests/auto/testlib/selftests/float/tst_float.cpp | 155 +++++------- 6 files changed, 210 insertions(+), 239 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml index 458f2277e6..54d6eabdbd 100644 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ b/tests/auto/testlib/selftests/expected_float.lightxml @@ -8,15 +8,15 @@ - - - + + + - - - + + + +static void nonFinite_data(F zero, F one) +{ + using Bounds = std::numeric_limits; + + // QCOMPARE special-cases non-finite values + if (Bounds::has_quiet_NaN) { + const F nan = Bounds::quiet_NaN(); + QTest::newRow("should PASS: NaN == NaN") << nan << nan; + QTest::newRow("should FAIL: NaN != 0") << nan << zero; + QTest::newRow("should FAIL: 0 != NaN") << zero << nan; + QTest::newRow("should FAIL: NaN != 1") << nan << one; + QTest::newRow("should FAIL: 1 != NaN") << one << nan; + } + + if (Bounds::has_infinity) { + const F uge = Bounds::infinity(); + QTest::newRow("should PASS: inf == inf") << uge << uge; + QTest::newRow("should PASS: -inf == -inf") << -uge << -uge; + QTest::newRow("should FAIL: inf != -inf") << uge << -uge; + QTest::newRow("should FAIL: -inf != inf") << -uge << uge; + if (Bounds::has_quiet_NaN) { + const F nan = Bounds::quiet_NaN(); + QTest::newRow("should FAIL: inf != nan") << uge << nan; + QTest::newRow("should FAIL: nan != inf") << nan << uge; + QTest::newRow("should FAIL: -inf != nan") << -uge << nan; + QTest::newRow("should FAIL: nan != -inf") << nan << -uge; + } + QTest::newRow("should FAIL: inf != 0") << uge << zero; + QTest::newRow("should FAIL: 0 != inf") << zero << uge; + QTest::newRow("should FAIL: -inf != 0") << -uge << zero; + QTest::newRow("should FAIL: 0 != -inf") << zero << -uge; + QTest::newRow("should FAIL: inf != 1") << uge << one; + QTest::newRow("should FAIL: 1 != inf") << one << uge; + QTest::newRow("should FAIL: -inf != 1") << -uge << one; + QTest::newRow("should FAIL: 1 != -inf") << one << -uge; + + const F big = Bounds::max(); + QTest::newRow("should FAIL: inf != max") << uge << big; + QTest::newRow("should FAIL: inf != -max") << uge << -big; + QTest::newRow("should FAIL: max != inf") << big << uge; + QTest::newRow("should FAIL: -max != inf") << -big << uge; + QTest::newRow("should FAIL: -inf != max") << -uge << big; + QTest::newRow("should FAIL: -inf != -max") << -uge << -big; + QTest::newRow("should FAIL: max != -inf") << big << -uge; + QTest::newRow("should FAIL: -max != -inf") << -big << -uge; + } +} + void tst_float::doubleComparisons() const { QFETCH(double, operandLeft); @@ -58,65 +107,26 @@ void tst_float::doubleComparisons_data() const { QTest::addColumn("operandLeft"); QTest::addColumn("operandRight"); + double zero(0.), one(1.); - QTest::newRow("should PASS 1") << 0. << 0.; - QTest::newRow("should FAIL 1") << 1.00000 << 3.00000; - QTest::newRow("should FAIL 2") << 1.00000e-7 << 3.00000e-7; + QTest::newRow("should FAIL 1") << one << 3.; + QTest::newRow("should PASS 1") << zero << zero; + QTest::newRow("should FAIL 2") << 1.e-7 << 3.e-7; // QCOMPARE for doubles uses qFuzzyCompare(), which succeeds if the numbers // differ by no more than 1e-12 times the smaller value. Thus // QCOMPARE(1e12-2, 1e12-1) should fail, while QCOMPARE(1e12+1, 1e12+2) // should pass. - QTest::newRow("should PASS 2") << 1e12 + 1. << 1e12 + 2.; - QTest::newRow("should FAIL 3") << 1e12 - 1. << 1e12 - 2.; + QTest::newRow("should PASS 2") << 1e12 + one << 1e12 + 2.; + QTest::newRow("should FAIL 3") << 1e12 - one << 1e12 - 2.; // ... but rounding makes that a bit unrelaible when scaled close to the bounds. QTest::newRow("should PASS 3") << 1e-310 + 1e-322 << 1e-310 + 2e-322; QTest::newRow("should FAIL 4") << 1e-310 - 1e-322 << 1e-310 - 3e-322; QTest::newRow("should PASS 4") << 1e307 + 1e295 << 1e307 + 2e295; QTest::newRow("should FAIL 5") << 1e307 - 1e295 << 1e307 - 3e295; - // QCOMPARE special-cases non-finite values - if (std::numeric_limits::has_quiet_NaN) { - const double nan = std::numeric_limits::quiet_NaN(); - QTest::newRow("should PASS: NaN == NaN") << nan << nan; - QTest::newRow("should FAIL: NaN != 0") << nan << 0.; - QTest::newRow("should FAIL: 0 != NaN") << 0. << nan; - QTest::newRow("should FAIL: NaN != 1") << nan << 1.; - QTest::newRow("should FAIL: 1 != NaN") << 1. << nan; - } - if (std::numeric_limits::has_infinity) { - const double uge = std::numeric_limits::infinity(); - QTest::newRow("should PASS: inf == inf") << uge << uge; - QTest::newRow("should PASS: -inf == -inf") << -uge << -uge; - QTest::newRow("should FAIL: inf != -inf") << uge << -uge; - QTest::newRow("should FAIL: -inf != inf") << -uge << uge; - if (std::numeric_limits::has_quiet_NaN) { - const double nan = std::numeric_limits::quiet_NaN(); - QTest::newRow("should FAIL: inf != nan") << uge << nan; - QTest::newRow("should FAIL: nan != inf") << nan << uge; - QTest::newRow("should FAIL: -inf != nan") << -uge << nan; - QTest::newRow("should FAIL: nan != -inf") << nan << -uge; - } - QTest::newRow("should FAIL: inf != 0") << uge << 0.; - QTest::newRow("should FAIL: 0 != inf") << 0. << uge; - QTest::newRow("should FAIL: -inf != 0") << -uge << 0.; - QTest::newRow("should FAIL: 0 != -inf") << 0. << -uge; - QTest::newRow("should FAIL: inf != 1") << uge << 1.; - QTest::newRow("should FAIL: 1 != inf") << 1. << uge; - QTest::newRow("should FAIL: -inf != 1") << -uge << 1.; - QTest::newRow("should FAIL: 1 != -inf") << 1. << -uge; - - const double big = std::numeric_limits::max(); - QTest::newRow("should FAIL: inf != max") << uge << big; - QTest::newRow("should FAIL: inf != -max") << uge << -big; - QTest::newRow("should FAIL: max != inf") << big << uge; - QTest::newRow("should FAIL: -max != inf") << -big << uge; - QTest::newRow("should FAIL: -inf != max") << -uge << big; - QTest::newRow("should FAIL: -inf != -max") << -uge << -big; - QTest::newRow("should FAIL: max != -inf") << big << -uge; - QTest::newRow("should FAIL: -max != -inf") << -big << -uge; - } + nonFinite_data(zero, one); } void tst_float::floatComparisons() const @@ -131,65 +141,26 @@ void tst_float::floatComparisons_data() const { QTest::addColumn("operandLeft"); QTest::addColumn("operandRight"); + float zero(0.f), one(1.f); - QTest::newRow("should FAIL 1") << 1.00000f << 3.00000f; - QTest::newRow("should PASS 1") << 0.f << 0.f; - QTest::newRow("should FAIL 2") << 1.00000e-7f << 3.00000e-7f; + QTest::newRow("should FAIL 1") << one << 3.f; + QTest::newRow("should PASS 1") << zero << zero; + QTest::newRow("should FAIL 2") << 1.e-7f << 3.e-7f; // QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers // differ by no more than 1e-5 times the smaller value. Thus // QCOMPARE(1e5-2, 1e5-1) should fail, while QCOMPARE(1e5+1, 1e5+2) // should pass. - QTest::newRow("should PASS 2") << 1e5f + 1.f << 1e5f + 2.f; - QTest::newRow("should FAIL 3") << 1e5f - 1.f << 1e5f - 2.f; + QTest::newRow("should PASS 2") << 1e5f + one << 1e5f + 2.f; + QTest::newRow("should FAIL 3") << 1e5f - one << 1e5f - 2.f; // ... but rounding makes that a bit unrelaible when scaled close to the bounds. QTest::newRow("should PASS 3") << 1e-39f + 1e-44f << 1e-39f + 2e-44f; QTest::newRow("should FAIL 4") << 1e-39f - 1e-44f << 1e-39f - 3e-44f; QTest::newRow("should PASS 4") << 1e38f + 1e33f << 1e38f + 2e33f; QTest::newRow("should FAIL 5") << 1e38f - 1e33f << 1e38f - 3e33f; - // QCOMPARE special-cases non-finite values - if (std::numeric_limits::has_quiet_NaN) { - const float nan = std::numeric_limits::quiet_NaN(); - QTest::newRow("should PASS: NaN == NaN") << nan << nan; - QTest::newRow("should FAIL: NaN != 0") << nan << 0.f; - QTest::newRow("should FAIL: 0 != NaN") << 0.f << nan; - QTest::newRow("should FAIL: NaN != 1") << nan << 1.f; - QTest::newRow("should FAIL: 1 != NaN") << 1.f << nan; - } - if (std::numeric_limits::has_infinity) { - const float uge = std::numeric_limits::infinity(); - QTest::newRow("should PASS: inf == inf") << uge << uge; - QTest::newRow("should PASS: -inf == -inf") << -uge << -uge; - QTest::newRow("should FAIL: inf != -inf") << uge << -uge; - QTest::newRow("should FAIL: -inf != inf") << -uge << uge; - if (std::numeric_limits::has_quiet_NaN) { - const float nan = std::numeric_limits::quiet_NaN(); - QTest::newRow("should FAIL: inf != nan") << uge << nan; - QTest::newRow("should FAIL: nan != inf") << nan << uge; - QTest::newRow("should FAIL: -inf != nan") << -uge << nan; - QTest::newRow("should FAIL: nan != -inf") << nan << -uge; - } - QTest::newRow("should FAIL: inf != 0") << uge << 0.f; - QTest::newRow("should FAIL: 0 != inf") << 0.f << uge; - QTest::newRow("should FAIL: -inf != 0") << -uge << 0.f; - QTest::newRow("should FAIL: 0 != -inf") << 0.f << -uge; - QTest::newRow("should FAIL: inf != 1") << uge << 1.f; - QTest::newRow("should FAIL: 1 != inf") << 1.f << uge; - QTest::newRow("should FAIL: -inf != 1") << -uge << 1.f; - QTest::newRow("should FAIL: 1 != -inf") << 1.f << -uge; - - const float big = std::numeric_limits::max(); - QTest::newRow("should FAIL: inf != max") << uge << big; - QTest::newRow("should FAIL: inf != -max") << uge << -big; - QTest::newRow("should FAIL: max != inf") << big << uge; - QTest::newRow("should FAIL: -max != inf") << -big << uge; - QTest::newRow("should FAIL: -inf != max") << -uge << big; - QTest::newRow("should FAIL: -inf != -max") << -uge << -big; - QTest::newRow("should FAIL: max != -inf") << big << -uge; - QTest::newRow("should FAIL: -max != -inf") << -big << -uge; - } + nonFinite_data(zero, one); } void tst_float::float16Comparisons() const -- cgit v1.2.3 From e75e89f9dedcdd4b9fe1caa04a2d8c5e759ea068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 26 Feb 2019 16:09:59 +0100 Subject: Test QTest's signal dumper It has been completely untested for a while and saw some breakage. So let's add a selftest for it. ('-vs' when running tests) Change-Id: Ibfb5ac0a2d741de7c3f519d91202d4977996045e Reviewed-by: Qt CI Bot Reviewed-by: Edward Welbourne --- .../selftests/expected_signaldumper.lightxml | 578 ++++++++++++++++++++ .../testlib/selftests/expected_signaldumper.tap | 151 ++++++ .../selftests/expected_signaldumper.teamcity | 61 +++ .../testlib/selftests/expected_signaldumper.txt | 149 ++++++ .../testlib/selftests/expected_signaldumper.xml | 581 +++++++++++++++++++++ .../selftests/expected_signaldumper.xunitxml | 284 ++++++++++ .../testlib/selftests/generate_expected_output.py | 12 + tests/auto/testlib/selftests/selftests.pri | 1 + .../selftests/signaldumper/signaldumper.pro | 9 + .../selftests/signaldumper/tst_signaldumper.cpp | 417 +++++++++++++++ tests/auto/testlib/selftests/tst_selftests.cpp | 27 + 11 files changed, 2270 insertions(+) create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.lightxml create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.tap create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.teamcity create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.txt create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.xml create mode 100644 tests/auto/testlib/selftests/expected_signaldumper.xunitxml create mode 100644 tests/auto/testlib/selftests/signaldumper/signaldumper.pro create mode 100644 tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_signaldumper.lightxml b/tests/auto/testlib/selftests/expected_signaldumper.lightxml new file mode 100644 index 0000000000..f68834e1a2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.lightxml @@ -0,0 +1,578 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ())]]> + + + ())]]> + + + &)@_POINTER_)]]> + + + ())]]> + + + *)_POINTER_)]]> + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_signaldumper.tap b/tests/auto/testlib/selftests/expected_signaldumper.tap new file mode 100644 index 0000000000..04d7d94745 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.tap @@ -0,0 +1,151 @@ +TAP version 13 +# tst_Signaldumper +# Signal: QThread(_POINTER_) started () +ok 1 - initTestCase() +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +ok 2 - noConnections() +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 3 - oneSlot(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 4 - oneSlot(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 5 - oneSlotOldSyntax(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 6 - oneSlotOldSyntax(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 7 - twoSlots(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 8 - twoSlots(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 9 - twoSlotsOldSyntax(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 10 - twoSlotsOldSyntax(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 11 - signalForwarding(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +ok 12 - signalForwarding(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Slot: SignalSlotClass(_POINTER_) nestedSignal() +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char) +# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Slot: SignalSlotClass(_POINTER_) nestedSignal() +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 13 - signalForwardingOldSyntax(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +ok 14 - signalForwardingOldSyntax(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 15 - slotEmittingSignal(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +ok 16 - slotEmittingSignal(queued) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Slot: SignalSlotClass(_POINTER_) emitSecondSignal() +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +ok 17 - slotEmittingSignalOldSyntax(direct) +# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +# Signal: QEventDispatcherPlatform(_POINTER_) awake () +# Signal: SignalSlotClass(_POINTER_) nestedSignal () +ok 18 - slotEmittingSignalOldSyntax(queued) +# Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string)) +# Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_) +# Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string)) +# Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray)) +# Signal: SignalSlotClass(_POINTER_) qListSignal (QList()) +# Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector()) +# Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector&)@_POINTER_) +# Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector()) +# Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector*)_POINTER_) +# Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal () +# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant()) +# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant()) +ok 19 - variousTypes() +ok 20 - cleanupTestCase() +# Signal: QThread(_POINTER_) finished () +1..20 +# tests 20 +# pass 20 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_signaldumper.teamcity b/tests/auto/testlib/selftests/expected_signaldumper.teamcity new file mode 100644 index 0000000000..3b8cf8c54f --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.teamcity @@ -0,0 +1,61 @@ +##teamcity[testSuiteStarted name='tst_Signaldumper' flowId='tst_Signaldumper'] +##teamcity[testStarted name='initTestCase()' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='initTestCase()' out='INFO: Signal: QThread(_POINTER_) started ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='initTestCase()' flowId='tst_Signaldumper'] +##teamcity[testStarted name='noConnections()' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='noConnections()' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))' flowId='tst_Signaldumper'] +##teamcity[testFinished name='noConnections()' flowId='tst_Signaldumper'] +##teamcity[testStarted name='oneSlot(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='oneSlot(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='oneSlot(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='oneSlot(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='oneSlot(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='oneSlot(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='oneSlotOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='oneSlotOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='twoSlots(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='twoSlots(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='twoSlots(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='twoSlots(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='twoSlots(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='twoSlots(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='twoSlotsOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='twoSlotsOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='signalForwarding(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='signalForwarding(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='signalForwarding(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='signalForwarding(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='signalForwarding(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='signalForwarding(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='signalForwardingOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='signalForwardingOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='slotEmittingSignal(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='slotEmittingSignal(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='slotEmittingSignal(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='slotEmittingSignal(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='slotEmittingSignal(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='slotEmittingSignal(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='slotEmittingSignalOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) emitSecondSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='slotEmittingSignalOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper'] +##teamcity[testStarted name='variousTypes()' flowId='tst_Signaldumper'] +##teamcity[testStdOut name='variousTypes()' out='INFO: Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))|nINFO: Signal: SignalSlotClass(_POINTER_) qListSignal (QList())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector*)_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())' flowId='tst_Signaldumper'] +##teamcity[testFinished name='variousTypes()' flowId='tst_Signaldumper'] +##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Signaldumper'] +##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Signaldumper'] +##teamcity[testSuiteFinished name='tst_Signaldumper' flowId='tst_Signaldumper'] diff --git a/tests/auto/testlib/selftests/expected_signaldumper.txt b/tests/auto/testlib/selftests/expected_signaldumper.txt new file mode 100644 index 0000000000..f89c31afe5 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.txt @@ -0,0 +1,149 @@ +********* Start testing of tst_Signaldumper ********* +Config: Using QtTest library +INFO : tst_Signaldumper::initTestCase() Signal: QThread(_POINTER_) started () +PASS : tst_Signaldumper::initTestCase() +INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +PASS : tst_Signaldumper::noConnections() +INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::oneSlot(direct) +INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::oneSlot(queued) +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::oneSlotOldSyntax(direct) +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::oneSlotOldSyntax(queued) +INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::twoSlots(direct) +INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::twoSlots(queued) +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char) +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters() +INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::twoSlotsOldSyntax(direct) +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::twoSlotsOldSyntax(queued) +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::signalForwarding(direct) +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +PASS : tst_Signaldumper::signalForwarding(queued) +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal() +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char) +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal() +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::signalForwardingOldSyntax(direct) +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m)) +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +PASS : tst_Signaldumper::signalForwardingOldSyntax(queued) +INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::slotEmittingSignal(direct) +INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +PASS : tst_Signaldumper::slotEmittingSignal(queued) +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) emitSecondSignal() +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal () +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake () +PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters () +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake () +INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal () +PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string)) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string)) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray)) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qListSignal (QList()) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector()) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector&)@_POINTER_) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector()) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector*)_POINTER_) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal () +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant()) +INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant()) +PASS : tst_Signaldumper::variousTypes() +PASS : tst_Signaldumper::cleanupTestCase() +INFO : tst_Signaldumper::UnknownTestFunc() Signal: QThread(_POINTER_) finished () +Totals: 20 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_Signaldumper ********* diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xml b/tests/auto/testlib/selftests/expected_signaldumper.xml new file mode 100644 index 0000000000..82959c62df --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.xml @@ -0,0 +1,581 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ())]]> + + + ())]]> + + + &)@_POINTER_)]]> + + + ())]]> + + + *)_POINTER_)]]> + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xunitxml b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml new file mode 100644 index 0000000000..930dc97262 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +())]]> +())]]> +&)@_POINTER_)]]> +())]]> +*)_POINTER_)]]> + + + + + + diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 9ec87c8fc6..48ecbf0289 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -92,6 +92,17 @@ class Cleaner (object): (r'(Loc: \[[^[\]()]+)\(\d+\)', r'\1(0)'), # txt (r'(\[Loc: [^[\]()]+)\(\d+\)', r'\1(0)'), # teamcity (r'(<(?:Incident|Message)\b.*\bfile=.*\bline=)"\d+"', r'\1"0"'), # lightxml, xml + # Pointers printed by signal dumper: + (r'\(\b[a-f0-9]{8,}\b\)', r'(_POINTER_)'), + # Example/for reference: + # ((QString&)@55f5fbb8dd40) + # ((const QVector*)7ffd671d4558) + (r'\((\((?:const )?\w+(?:<[^>]+>)?[*&]*\)@?)\b[a-f\d]{8,}\b\)', r'(\1_POINTER_)'), + # For xml output there is no '<', '>' or '&', so we need an alternate version for that: + # ((QVector<int>&)@5608b455e640) + (r'\((\((?:const )?\w+(?:<(?:[^&]|&(?!gt;))*>)?(?:\*|&)?\)@?)[a-z\d]+\b\)', r'(\1_POINTER_)'), + # QEventDispatcher{Glib,Win32,etc.} + (r'\bQEventDispatcher\w+\b', r'QEventDispatcherPlatform'), ), precook = re.compile): """Private implementation details of __init__().""" @@ -296,6 +307,7 @@ def generateTestData(testname, clean, "benchlibcounting": "-eventcounter", "printdatatags": "-datatags", "printdatatagswithglobaltags": "-datatags", + "signaldumper": "-vs", "silent": "-silent", "verbose1": "-v1", "verbose2": "-v2", diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index b4568dd3e1..668eaeb6b5 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -37,6 +37,7 @@ SUBPROGRAMS = \ printdatatagswithglobaltags \ qexecstringlist \ silent \ + signaldumper \ singleskip \ skip \ skipcleanup \ diff --git a/tests/auto/testlib/selftests/signaldumper/signaldumper.pro b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro new file mode 100644 index 0000000000..8780b18419 --- /dev/null +++ b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro @@ -0,0 +1,9 @@ +SOURCES += tst_signaldumper.cpp +QT = core testlib-private + +macos:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = signaldumper + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp new file mode 100644 index 0000000000..f6cd0d510e --- /dev/null +++ b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp @@ -0,0 +1,417 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_Signaldumper : public QObject +{ + Q_OBJECT + + void addConnectionTypeData(); + +private slots: + void noConnections(); + void oneSlot_data(); + void oneSlot(); + void oneSlotOldSyntax_data(); + void oneSlotOldSyntax(); + void twoSlots_data(); + void twoSlots(); + void twoSlotsOldSyntax_data(); + void twoSlotsOldSyntax(); + void signalForwarding_data(); + void signalForwarding(); + void signalForwardingOldSyntax_data(); + void signalForwardingOldSyntax(); + void slotEmittingSignal_data(); + void slotEmittingSignal(); + void slotEmittingSignalOldSyntax_data(); + void slotEmittingSignalOldSyntax(); + + void variousTypes(); +}; + +void tst_Signaldumper::addConnectionTypeData() +{ + QTest::addColumn("connectionType"); + QTest::newRow("direct") << Qt::ConnectionType::DirectConnection; + QTest::newRow("queued") << Qt::ConnectionType::QueuedConnection; +} + +/* + Simple class to keep the slots and signals separate from the test +*/ +class SignalSlotClass : public QObject +{ + Q_OBJECT + +public: + SignalSlotClass(); + +public slots: + void slotWithoutParameters() {} + void slotWithParameters(int i, char c) { Q_UNUSED(i); Q_UNUSED(c); } + void emitSecondSignal() { emit nestedSignal(); } + +signals: + void signalWithoutParameters(); + void signalWithParameters(int i, char c); + + void nestedSignal(); + void nestedSignalWithParameters(int i, char c); + + // For the "variousTypes" test + void qStringSignal(QString string); + void qStringRefSignal(QString &string); + void qStringConstRefSignal(const QString &string); + void qByteArraySignal(QByteArray byteArray); + void qListSignal(QList list); + void qVectorSignal(QVector vector); + void qVectorRefSignal(QVector &vector); + void qVectorConstRefSignal(const QVector &vector); + void qVectorConstPointerSignal(const QVector *vector); + void qVectorPointerConstSignal(QVector *const vector); + void qVariantSignal(QVariant variant); +}; + +SignalSlotClass::SignalSlotClass() +{ + // For printing signal argument in "variousTypes" test + qRegisterMetaType>(); + qRegisterMetaType>(); +} + +void tst_Signaldumper::noConnections() +{ + SignalSlotClass signalSlotOwner; + + emit signalSlotOwner.signalWithoutParameters(); + emit signalSlotOwner.signalWithParameters(242, 'm'); +} + +void tst_Signaldumper::oneSlot_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::oneSlot() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + // parameterless to parameterless + auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameters to parameters + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameters to no parameters + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::oneSlotOldSyntax_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::oneSlotOldSyntax() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + // parameterless to parameterless + auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameters to parameters + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameters to no parameters + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::twoSlots_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::twoSlots() +{ + QFETCH(Qt::ConnectionType, connectionType); + + // Now, instead of creating two slots or two objects, we will just do the same connection twice. + // The same slot will then be invoked twice. + + SignalSlotClass signalSlotOwner; + // parameterless to parameterless + auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + auto connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); + + // parameters to parameters + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType); + connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); + + // parameters to no parameters + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); +} + +void tst_Signaldumper::twoSlotsOldSyntax_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::twoSlotsOldSyntax() +{ + QFETCH(Qt::ConnectionType, connectionType); + + // Now, instead of creating two slots or two objects, we will just do the same connection twice. + // The same slot will then be invoked twice. + + SignalSlotClass signalSlotOwner; + // parameterless to parameterless + auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + auto connection2 = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); + + // parameters to parameters + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType); + connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); + + // parameters to no parameters + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + disconnect(connection2); +} + +void tst_Signaldumper::signalForwarding_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::signalForwarding() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + + // parameterless signal to parameterless signal + auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters, + &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameter(full) signal to parameter(full) signal + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::nestedSignalWithParameters, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameter(full) signal to parameterless signal + connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters, + &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::signalForwardingOldSyntax_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::signalForwardingOldSyntax() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + + // parameterless signal to parameterless signal + auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()), + &signalSlotOwner, SIGNAL(nestedSignal()), connectionType); + emit signalSlotOwner.signalWithoutParameters(); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameter(full) signal to parameter(full) signal + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SIGNAL(nestedSignalWithParameters(int, char)), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); + + // parameter(full) signal to parameterless signal + connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)), + &signalSlotOwner, SIGNAL(nestedSignal()), connectionType); + emit signalSlotOwner.signalWithParameters(242, 'm'); + + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::slotEmittingSignal_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::slotEmittingSignal() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + + auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters, + &signalSlotOwner, &SignalSlotClass::emitSecondSignal, connectionType); + emit signalSlotOwner.signalWithoutParameters(); + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::slotEmittingSignalOldSyntax_data() +{ + addConnectionTypeData(); +} + +void tst_Signaldumper::slotEmittingSignalOldSyntax() +{ + QFETCH(Qt::ConnectionType, connectionType); + + SignalSlotClass signalSlotOwner; + + auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()), + &signalSlotOwner, SLOT(emitSecondSignal()), connectionType); + emit signalSlotOwner.signalWithoutParameters(); + QCoreApplication::processEvents(); + disconnect(connection); +} + +void tst_Signaldumper::variousTypes() +{ + SignalSlotClass signalSlotOwner; + QString string = QString::fromLatin1("Test string"); + emit signalSlotOwner.qStringSignal(string); + emit signalSlotOwner.qStringRefSignal(string); + emit signalSlotOwner.qStringConstRefSignal(string); + emit signalSlotOwner.qByteArraySignal(QByteArray("Test bytearray")); + + QList list{1, 2, 3, 242}; + emit signalSlotOwner.qListSignal(list); + + QVector vector{1, 2, 3, 242}; + emit signalSlotOwner.qVectorSignal(vector); + emit signalSlotOwner.qVectorRefSignal(vector); + emit signalSlotOwner.qVectorConstRefSignal(vector); + emit signalSlotOwner.qVectorConstPointerSignal(&vector); + emit signalSlotOwner.qVectorPointerConstSignal(&vector); + + QVariant variant = 24; + emit signalSlotOwner.qVariantSignal(variant); + variant = QVariant(string); + emit signalSlotOwner.qVariantSignal(variant); +} + +QTEST_MAIN(tst_Signaldumper) +#include "tst_signaldumper.moc" diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 3ef15b9261..7216c6a373 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -488,6 +488,7 @@ void tst_Selftests::runSubTest_data() << "printdatatags" << "printdatatagswithglobaltags" << "qexecstringlist" + << "signaldumper" << "silent" << "singleskip" << "skip" @@ -553,6 +554,9 @@ void tst_Selftests::runSubTest_data() else if (subtest == "printdatatagswithglobaltags") { arguments << "-datatags"; } + else if (subtest == "signaldumper") { + arguments << "-vs"; + } else if (subtest == "silent") { arguments << "-silent"; } @@ -953,6 +957,29 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:"))) return true; + const QLatin1String pointerPlaceholder("_POINTER_"); + if (expectedLine.contains(pointerPlaceholder) + && (expectedLine.contains(QLatin1String("Signal: ")) + || expectedLine.contains(QLatin1String("Slot: ")))) { + QString actual = actualLine; + // We don't care about the pointer of the object to whom the signal belongs, so we + // replace it with _POINTER_, e.g.: + // Signal: SignalSlotClass(7ffd72245410) signalWithoutParameters () + // Signal: QThread(7ffd72245410) started () + // After this instance pointer we may have further pointers and + // references (with an @ prefix) as parameters of the signal or + // slot being invoked. + // Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@55f5fbb8dd40) + actual.replace(QRegularExpression("\\b[a-f0-9]{8,}\\b"), pointerPlaceholder); + // Also change QEventDispatcher{Glib,Win32,etc.} to QEventDispatcherPlatform + actual.replace(QRegularExpression("\\b(QEventDispatcher)\\w+\\b"), QLatin1String("\\1Platform")); + if (actual != expectedLine) { + *errorMessage = msgMismatch(actual, expectedLine); + return false; + } + return true; + } + *errorMessage = msgMismatch(actualLine, expectedLine); return false; } -- cgit v1.2.3 From 369305a9be0eb96513be66a70611259d33842cfc Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 18 Jul 2017 18:43:56 +0200 Subject: Tidy up tst_globaldata to use better namings and document what it tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In particular, document the mis-behavior it takes for granted in one test. Renamed some variables so that they're visually distinct from one another and actually mean something intelligible. Renamed the sub-tests to say what's actually happening. Reading the test output now at least makes it possible to see what's wrong. I'll fix that in a later commit. Task-number: QTBUG-61774 Change-Id: I3e5f83b8baa3c6afbca9231b5bbc89d17f3e57e2 Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/expected_globaldata.lightxml | 126 ++++++++++----------- .../auto/testlib/selftests/expected_globaldata.tap | 62 +++++----- .../testlib/selftests/expected_globaldata.teamcity | 46 ++++---- .../auto/testlib/selftests/expected_globaldata.txt | 84 +++++++------- .../auto/testlib/selftests/expected_globaldata.xml | 126 ++++++++++----------- .../testlib/selftests/expected_globaldata.xunitxml | 112 +++++++++--------- .../selftests/globaldata/tst_globaldata.cpp | 43 +++---- 7 files changed, 300 insertions(+), 299 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml index f66c4c552d..e536031899 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.lightxml +++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml @@ -12,174 +12,174 @@ - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - + diff --git a/tests/auto/testlib/selftests/expected_globaldata.tap b/tests/auto/testlib/selftests/expected_globaldata.tap index 580cf3a7a8..318299992f 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.tap +++ b/tests/auto/testlib/selftests/expected_globaldata.tap @@ -2,48 +2,48 @@ TAP version 13 # tst_globaldata # initTestCase initTestCase (null) ok 1 - initTestCase() -# init testGlobal local 1 +# init testGlobal local=false # global: false # local: false -# cleanup testGlobal local 1 -ok 2 - testGlobal(1:local 1) -# init testGlobal local 2 +# cleanup testGlobal local=false +ok 2 - testGlobal(global=false:local=false) +# init testGlobal local=true # global: false # local: true -# cleanup testGlobal local 2 -ok 3 - testGlobal(1:local 2) -# init testGlobal local 1 +# cleanup testGlobal local=true +ok 3 - testGlobal(global=false:local=true) +# init testGlobal local=false # global: true # local: false -# cleanup testGlobal local 1 -ok 4 - testGlobal(2:local 1) -# init testGlobal local 2 +# cleanup testGlobal local=false +ok 4 - testGlobal(global=true:local=false) +# init testGlobal local=true # global: true # local: true -# cleanup testGlobal local 2 -ok 5 - testGlobal(2:local 2) -ok 6 - skip(1) # SKIP skipping -# init skipLocal local 1 -ok 7 - skipLocal(1:local 1) # SKIP skipping -# cleanup skipLocal local 1 -# init skipLocal local 2 -ok 8 - skipLocal(1:local 2) # SKIP skipping -# cleanup skipLocal local 2 -# init skipSingle local 1 +# cleanup testGlobal local=true +ok 5 - testGlobal(global=true:local=true) +ok 6 - skip(global=false) # SKIP skipping +# init skipLocal local=false +ok 7 - skipLocal(global=false:local=false) # SKIP skipping +# cleanup skipLocal local=false +# init skipLocal local=true +ok 8 - skipLocal(global=false:local=true) # SKIP skipping +# cleanup skipLocal local=true +# init skipSingle local=false # global: false local: false -# cleanup skipSingle local 1 -ok 9 - skipSingle(1:local 1) -# init skipSingle local 2 +# cleanup skipSingle local=false +ok 9 - skipSingle(global=false:local=false) +# init skipSingle local=true # global: false local: true -# cleanup skipSingle local 2 -ok 10 - skipSingle(1:local 2) -# init skipSingle local 1 -ok 11 - skipSingle(2:local 1) # SKIP skipping -# cleanup skipSingle local 1 -# init skipSingle local 2 +# cleanup skipSingle local=true +ok 10 - skipSingle(global=false:local=true) +# init skipSingle local=false +ok 11 - skipSingle(global=true:local=false) # SKIP Skipping +# cleanup skipSingle local=false +# init skipSingle local=true # global: true local: true -# cleanup skipSingle local 2 -ok 12 - skipSingle(2:local 2) +# cleanup skipSingle local=true +ok 12 - skipSingle(global=true:local=true) # cleanupTestCase cleanupTestCase (null) ok 13 - cleanupTestCase() 1..13 diff --git a/tests/auto/testlib/selftests/expected_globaldata.teamcity b/tests/auto/testlib/selftests/expected_globaldata.teamcity index 5d623a3285..2f9f97d912 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.teamcity +++ b/tests/auto/testlib/selftests/expected_globaldata.teamcity @@ -2,30 +2,30 @@ ##teamcity[testStarted name='initTestCase()' flowId='tst_globaldata'] ##teamcity[testStdOut name='initTestCase()' out='QDEBUG: initTestCase initTestCase (null)' flowId='tst_globaldata'] ##teamcity[testFinished name='initTestCase()' flowId='tst_globaldata'] -##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata'] -##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata'] -##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata'] -##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata'] -##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata'] -##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata'] -##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata'] -##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata'] -##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata'] -##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata'] -##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata'] -##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata'] +##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata'] +##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata'] +##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata'] +##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata'] +##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata'] +##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata'] +##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata'] +##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata'] +##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata'] +##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata'] +##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata'] +##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata'] ##teamcity[testIgnored name='skip()' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] -##teamcity[testIgnored name='skipLocal(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] -##teamcity[testIgnored name='skipLocal(local 2)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] -##teamcity[testStarted name='skipSingle(local 1)' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local 1)' out='QDEBUG: init skipLocal local 1|nQDEBUG: cleanup skipLocal local 1|nQDEBUG: init skipLocal local 2|nQDEBUG: cleanup skipLocal local 2|nQDEBUG: init skipSingle local 1|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local 1' flowId='tst_globaldata'] -##teamcity[testFinished name='skipSingle(local 1)' flowId='tst_globaldata'] -##teamcity[testStarted name='skipSingle(local 2)' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 2|nQDEBUG: global: false local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata'] -##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata'] -##teamcity[testIgnored name='skipSingle(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 1|nQDEBUG: cleanup skipSingle local 1|nQDEBUG: init skipSingle local 2|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata'] -##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] +##teamcity[testStarted name='skipSingle(local=false)' flowId='tst_globaldata'] +##teamcity[testStdOut name='skipSingle(local=false)' out='QDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local=false' flowId='tst_globaldata'] +##teamcity[testFinished name='skipSingle(local=false)' flowId='tst_globaldata'] +##teamcity[testStarted name='skipSingle(local=true)' flowId='tst_globaldata'] +##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=true|nQDEBUG: global: false local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata'] +##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipSingle(local=false)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] +##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=false|nQDEBUG: cleanup skipSingle local=false|nQDEBUG: init skipSingle local=true|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata'] +##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata'] ##teamcity[testStarted name='cleanupTestCase()' flowId='tst_globaldata'] ##teamcity[testStdOut name='cleanupTestCase()' out='QDEBUG: cleanupTestCase cleanupTestCase (null)' flowId='tst_globaldata'] ##teamcity[testFinished name='cleanupTestCase()' flowId='tst_globaldata'] diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt index b12f4a2a69..b18568009a 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.txt +++ b/tests/auto/testlib/selftests/expected_globaldata.txt @@ -2,52 +2,52 @@ Config: Using QtTest library QDEBUG : tst_globaldata::initTestCase() initTestCase initTestCase (null) PASS : tst_globaldata::initTestCase() -QDEBUG : tst_globaldata::testGlobal(1:local 1) init testGlobal local 1 -QDEBUG : tst_globaldata::testGlobal(1:local 1) global: false -QDEBUG : tst_globaldata::testGlobal(1:local 1) local: false -QDEBUG : tst_globaldata::testGlobal(1:local 1) cleanup testGlobal local 1 -PASS : tst_globaldata::testGlobal(1:local 1) -QDEBUG : tst_globaldata::testGlobal(1:local 2) init testGlobal local 2 -QDEBUG : tst_globaldata::testGlobal(1:local 2) global: false -QDEBUG : tst_globaldata::testGlobal(1:local 2) local: true -QDEBUG : tst_globaldata::testGlobal(1:local 2) cleanup testGlobal local 2 -PASS : tst_globaldata::testGlobal(1:local 2) -QDEBUG : tst_globaldata::testGlobal(2:local 1) init testGlobal local 1 -QDEBUG : tst_globaldata::testGlobal(2:local 1) global: true -QDEBUG : tst_globaldata::testGlobal(2:local 1) local: false -QDEBUG : tst_globaldata::testGlobal(2:local 1) cleanup testGlobal local 1 -PASS : tst_globaldata::testGlobal(2:local 1) -QDEBUG : tst_globaldata::testGlobal(2:local 2) init testGlobal local 2 -QDEBUG : tst_globaldata::testGlobal(2:local 2) global: true -QDEBUG : tst_globaldata::testGlobal(2:local 2) local: true -QDEBUG : tst_globaldata::testGlobal(2:local 2) cleanup testGlobal local 2 -PASS : tst_globaldata::testGlobal(2:local 2) -SKIP : tst_globaldata::skip(1) skipping +QDEBUG : tst_globaldata::testGlobal(global=false:local=false) init testGlobal local=false +QDEBUG : tst_globaldata::testGlobal(global=false:local=false) global: false +QDEBUG : tst_globaldata::testGlobal(global=false:local=false) local: false +QDEBUG : tst_globaldata::testGlobal(global=false:local=false) cleanup testGlobal local=false +PASS : tst_globaldata::testGlobal(global=false:local=false) +QDEBUG : tst_globaldata::testGlobal(global=false:local=true) init testGlobal local=true +QDEBUG : tst_globaldata::testGlobal(global=false:local=true) global: false +QDEBUG : tst_globaldata::testGlobal(global=false:local=true) local: true +QDEBUG : tst_globaldata::testGlobal(global=false:local=true) cleanup testGlobal local=true +PASS : tst_globaldata::testGlobal(global=false:local=true) +QDEBUG : tst_globaldata::testGlobal(global=true:local=false) init testGlobal local=false +QDEBUG : tst_globaldata::testGlobal(global=true:local=false) global: true +QDEBUG : tst_globaldata::testGlobal(global=true:local=false) local: false +QDEBUG : tst_globaldata::testGlobal(global=true:local=false) cleanup testGlobal local=false +PASS : tst_globaldata::testGlobal(global=true:local=false) +QDEBUG : tst_globaldata::testGlobal(global=true:local=true) init testGlobal local=true +QDEBUG : tst_globaldata::testGlobal(global=true:local=true) global: true +QDEBUG : tst_globaldata::testGlobal(global=true:local=true) local: true +QDEBUG : tst_globaldata::testGlobal(global=true:local=true) cleanup testGlobal local=true +PASS : tst_globaldata::testGlobal(global=true:local=true) +SKIP : tst_globaldata::skip(global=false) skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] -QDEBUG : tst_globaldata::skipLocal(1:local 1) init skipLocal local 1 -SKIP : tst_globaldata::skipLocal(1:local 1) skipping +QDEBUG : tst_globaldata::skipLocal(global=false:local=false) init skipLocal local=false +SKIP : tst_globaldata::skipLocal(global=false:local=false) skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] -QDEBUG : tst_globaldata::skipLocal(1:local 1) cleanup skipLocal local 1 -QDEBUG : tst_globaldata::skipLocal(1:local 2) init skipLocal local 2 -SKIP : tst_globaldata::skipLocal(1:local 2) skipping +QDEBUG : tst_globaldata::skipLocal(global=false:local=false) cleanup skipLocal local=false +QDEBUG : tst_globaldata::skipLocal(global=false:local=true) init skipLocal local=true +SKIP : tst_globaldata::skipLocal(global=false:local=true) skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] -QDEBUG : tst_globaldata::skipLocal(1:local 2) cleanup skipLocal local 2 -QDEBUG : tst_globaldata::skipSingle(1:local 1) init skipSingle local 1 -QDEBUG : tst_globaldata::skipSingle(1:local 1) global: false local: false -QDEBUG : tst_globaldata::skipSingle(1:local 1) cleanup skipSingle local 1 -PASS : tst_globaldata::skipSingle(1:local 1) -QDEBUG : tst_globaldata::skipSingle(1:local 2) init skipSingle local 2 -QDEBUG : tst_globaldata::skipSingle(1:local 2) global: false local: true -QDEBUG : tst_globaldata::skipSingle(1:local 2) cleanup skipSingle local 2 -PASS : tst_globaldata::skipSingle(1:local 2) -QDEBUG : tst_globaldata::skipSingle(2:local 1) init skipSingle local 1 -SKIP : tst_globaldata::skipSingle(2:local 1) skipping +QDEBUG : tst_globaldata::skipLocal(global=false:local=true) cleanup skipLocal local=true +QDEBUG : tst_globaldata::skipSingle(global=false:local=false) init skipSingle local=false +QDEBUG : tst_globaldata::skipSingle(global=false:local=false) global: false local: false +QDEBUG : tst_globaldata::skipSingle(global=false:local=false) cleanup skipSingle local=false +PASS : tst_globaldata::skipSingle(global=false:local=false) +QDEBUG : tst_globaldata::skipSingle(global=false:local=true) init skipSingle local=true +QDEBUG : tst_globaldata::skipSingle(global=false:local=true) global: false local: true +QDEBUG : tst_globaldata::skipSingle(global=false:local=true) cleanup skipSingle local=true +PASS : tst_globaldata::skipSingle(global=false:local=true) +QDEBUG : tst_globaldata::skipSingle(global=true:local=false) init skipSingle local=false +SKIP : tst_globaldata::skipSingle(global=true:local=false) Skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] -QDEBUG : tst_globaldata::skipSingle(2:local 1) cleanup skipSingle local 1 -QDEBUG : tst_globaldata::skipSingle(2:local 2) init skipSingle local 2 -QDEBUG : tst_globaldata::skipSingle(2:local 2) global: true local: true -QDEBUG : tst_globaldata::skipSingle(2:local 2) cleanup skipSingle local 2 -PASS : tst_globaldata::skipSingle(2:local 2) +QDEBUG : tst_globaldata::skipSingle(global=true:local=false) cleanup skipSingle local=false +QDEBUG : tst_globaldata::skipSingle(global=true:local=true) init skipSingle local=true +QDEBUG : tst_globaldata::skipSingle(global=true:local=true) global: true local: true +QDEBUG : tst_globaldata::skipSingle(global=true:local=true) cleanup skipSingle local=true +PASS : tst_globaldata::skipSingle(global=true:local=true) QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null) PASS : tst_globaldata::cleanupTestCase() Totals: 9 passed, 0 failed, 4 skipped, 0 blacklisted, 0ms diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml index 0f705ef352..b2f92016e5 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xml +++ b/tests/auto/testlib/selftests/expected_globaldata.xml @@ -14,174 +14,174 @@ - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - + diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml index bdd7e3f00a..b135240d26 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml +++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml @@ -9,88 +9,88 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - - - - + + + + + - + diff --git a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp index 6c0ae1f43c..f425648ecc 100644 --- a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp +++ b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp @@ -66,9 +66,10 @@ void tst_globaldata::initTestCase() void tst_globaldata::initTestCase_data() { - QTest::addColumn("booli"); - QTest::newRow("1") << false; - QTest::newRow("2") << true; + // QFETCH_GLOBAL shall iterate these, for every test: + QTest::addColumn("global"); + QTest::newRow("global=false") << false; + QTest::newRow("global=true") << true; } void tst_globaldata::cleanupTestCase() @@ -94,41 +95,41 @@ void tst_globaldata::cleanup() void tst_globaldata::testGlobal_data() { - QTest::addColumn("booll"); - QTest::newRow("local 1") << false; - QTest::newRow("local 2") << true; + QTest::addColumn("local"); + QTest::newRow("local=false") << false; + QTest::newRow("local=true") << true; } void tst_globaldata::testGlobal() { - QFETCH_GLOBAL(bool, booli); - qDebug() << "global:" << booli; - QFETCH(bool, booll); - qDebug() << "local:" << booll; + QFETCH_GLOBAL(bool, global); + qDebug() << "global:" << global; + QFETCH(bool, local); + qDebug() << "local:" << local; } void tst_globaldata::skip_data() { - QTest::addColumn("booll"); - QTest::newRow("local 1") << false; - QTest::newRow("local 2") << true; - + testGlobal_data(); QSKIP("skipping"); } void tst_globaldata::skip() { - qDebug() << "this line should never be reached"; + // A skip in _data() causes the whole test to be skipped, for all global rows. + QVERIFY(!"This line should never be reached."); } void tst_globaldata::skipSingle() { - QFETCH_GLOBAL(bool, booli); - QFETCH(bool, booll); - - if (booli && !booll) - QSKIP("skipping"); - qDebug() << "global:" << booli << "local:" << booll; + QFETCH_GLOBAL(bool, global); + QFETCH(bool, local); + + // A skip in the last run of one global row suppresses the test in the next + // global row (where a skip in an earlier run of the first row does not). + if (global && !local) + QSKIP("Skipping"); + qDebug() << "global:" << global << "local:" << local; } void tst_globaldata::skipLocal() -- cgit v1.2.3 From e2fdd7a9cbc6293c07b7c316b9ea3e9f4d6faf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 28 Mar 2019 14:00:28 +0100 Subject: Remove commented test in testlib (alive) The test was added as commented in 2012, before it was not even mentioned in the pro file. I guess it was never run. Change-Id: Ib787c7811ab4f7f32a99869167cde2e12dbe3156 --- tests/auto/testlib/selftests/alive/.gitignore | 1 - tests/auto/testlib/selftests/alive/alive.pro | 10 -- tests/auto/testlib/selftests/alive/qtestalive.cpp | 147 ---------------------- tests/auto/testlib/selftests/alive/tst_alive.cpp | 84 ------------- tests/auto/testlib/selftests/selftests.pri | 1 - tests/auto/testlib/selftests/tst_selftests.cpp | 1 - 6 files changed, 244 deletions(-) delete mode 100644 tests/auto/testlib/selftests/alive/.gitignore delete mode 100644 tests/auto/testlib/selftests/alive/alive.pro delete mode 100644 tests/auto/testlib/selftests/alive/qtestalive.cpp delete mode 100644 tests/auto/testlib/selftests/alive/tst_alive.cpp (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/alive/.gitignore b/tests/auto/testlib/selftests/alive/.gitignore deleted file mode 100644 index 561285c5d0..0000000000 --- a/tests/auto/testlib/selftests/alive/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_alive diff --git a/tests/auto/testlib/selftests/alive/alive.pro b/tests/auto/testlib/selftests/alive/alive.pro deleted file mode 100644 index bda0db2282..0000000000 --- a/tests/auto/testlib/selftests/alive/alive.pro +++ /dev/null @@ -1,10 +0,0 @@ -SOURCES += tst_alive.cpp -QT = core testlib - -mac:CONFIG -= app_bundle -CONFIG -= debug_and_release_target - - -TARGET = alive - -include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/alive/qtestalive.cpp b/tests/auto/testlib/selftests/alive/qtestalive.cpp deleted file mode 100644 index 0200f2a563..0000000000 --- a/tests/auto/testlib/selftests/alive/qtestalive.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include -#include -#include - -class QTestAliveEvent: public QEvent -{ -public: - - enum { AliveEventType = QEvent::User + 422 }; - - explicit inline QTestAliveEvent(int aSequenceId) - : QEvent(QEvent::Type(AliveEventType)), seqId(aSequenceId) - {} - inline int sequenceId() const { return seqId; } - -private: - int seqId; -}; - -class QTestAlivePinger: public QObject -{ -public: - QTestAlivePinger(QObject *receiver, QObject *parent = 0); - bool event(QEvent *e); - -protected: - void timerEvent(QTimerEvent *event); - -private: - QObject *rec; - int timerId; - int currentSequenceId; - int lastSequenceId; -}; - -QTestAlivePinger::QTestAlivePinger(QObject *receiver, QObject *parent) - : QObject(parent), rec(receiver), currentSequenceId(0), lastSequenceId(0) -{ - if (!rec) - qFatal("Null receiver object passed to QTestAlivePinger::QTestAlivePinger()"); - timerId = startTimer(850); -} - -bool QTestAlivePinger::event(QEvent *event) -{ - // pong received - if (int(event->type()) == QTestAliveEvent::AliveEventType) { - QTestAliveEvent *e = static_cast(event); - //qDebug("PONG %d received", e->sequenceId()); - // if the events are not delivered in order, we don't care. - if (e->sequenceId() > lastSequenceId) - lastSequenceId = e->sequenceId(); - return true; - } - return QObject::event(event); -} - -void QTestAlivePinger::timerEvent(QTimerEvent *event) -{ - if (event->timerId() != timerId) - return; - - if (lastSequenceId < currentSequenceId - 2) { - qWarning("TEST LAGS %d PINGS behind!", currentSequenceId - lastSequenceId); - } - ++currentSequenceId; - //qDebug("PING %d", currentSequenceId); - QCoreApplication::postEvent(rec, new QTestAliveEvent(currentSequenceId)); -} - -class QTestAlive: public QThread -{ -public: - QTestAlive(QObject *parent = 0); - ~QTestAlive(); - void run(); - - bool event(QEvent *e); - -private: - QTestAlivePinger *pinger; -}; - -QTestAlive::QTestAlive(QObject *parent) - : QThread(parent), pinger(0) -{ -} - -QTestAlive::~QTestAlive() -{ - quit(); - while (isRunning()); -} - -bool QTestAlive::event(QEvent *e) -{ - if (int(e->type()) == QTestAliveEvent::AliveEventType && pinger) { - // ping received, send back the pong - //qDebug("PONG %d", static_cast(e)->sequenceId()); - QCoreApplication::postEvent(pinger, - new QTestAliveEvent(static_cast(e)->sequenceId())); - return true; - } - return QThread::event(e); -} - -void QTestAlive::run() -{ - if (!QCoreApplication::instance()) - qFatal("QTestAlive::run(): Cannot start QTestAlive without a QCoreApplication instance."); - - QTestAlivePinger p(this); - pinger = &p; - exec(); - pinger = 0; -} - - diff --git a/tests/auto/testlib/selftests/alive/tst_alive.cpp b/tests/auto/testlib/selftests/alive/tst_alive.cpp deleted file mode 100644 index eeb77b18c0..0000000000 --- a/tests/auto/testlib/selftests/alive/tst_alive.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include -#include - -#include "qtestalive.cpp" - -class tst_Alive: public QObject -{ - Q_OBJECT - -private slots: - void alive(); - void addMouseDClick() const; -}; - -void tst_Alive::alive() -{ - QTestAlive a; - a.start(); - - sleep(5); - QCoreApplication::processEvents(); - qDebug("CUT"); - sleep(5); -} - -void tst_Alive::addMouseDClick() const -{ - class DClickListener : public QWidget - { - public: - DClickListener() : isTested(false) - { - } - - bool isTested; - protected: - virtual void mouseDoubleClickEvent(QMouseEvent * event) - { - isTested = true; - QCOMPARE(event->type(), QEvent::MouseButtonDblClick); - } - }; - - DClickListener listener; - - QTestEventList list; - list.addMouseDClick(Qt::LeftButton); - - list.simulate(&listener); - /* Check that we have been called at all. */ - QVERIFY(listener.isTested); -} - -QTEST_MAIN(tst_Alive) -#include "tst_alive.moc" diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index b4568dd3e1..57b41bb5fc 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -1,5 +1,4 @@ SUBPROGRAMS = \ - #alive \ assert \ badxml \ benchlibcallgrind \ diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 3ef15b9261..3a242d0493 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -439,7 +439,6 @@ void tst_Selftests::runSubTest_data() QTest::addColumn("crashes"); QStringList tests = QStringList() -// << "alive" // timer dependent #if !defined(Q_OS_WIN) // On windows, assert does nothing in release mode and blocks execution // with a popup window in debug mode. -- cgit v1.2.3 From b82b3f40673f2d3c8ec73c075b645890480b74b7 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 18 Jul 2017 11:57:02 +0200 Subject: Fix the skip-check in TestMethods::invokeTest() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestMethods::invokeTest() has an outer loop on global data (albeit with a comment that said otherwise). On its first cycle, we run the test function's *_data() method, if it has one; there is an inner loop on the rows this created. If the *_data() QSKIP()s, we need to skip the whole test; otherwise, a QSKIP() in one sub-test should not lead to skipping the remaining sub-tests. Moved the check for *_data() QSKIP()ping to right after *_data() returns, inside the "first global cycle" block that runs it. Previously, this check was done before entering the loop on local data rows, but outside that "first global cycle" block: consequently, later global cycles would fall foul of this check (even though the *_data() hasn't been run in this cycle, much less QSKIP()ped in it) if the last sub-test of the previous global cycle had QSKIP()ped. When running a single test for one specific data row, if the test's *_data() QSKIP()ped, this misplaced check would also have lead to a misleading "Unknown testdata" warning. Changed testlib/selftests' tst_globaldata::skipSingle() to trigger the bug (by having its last local row of first global row skip, which caused the second global row to be omitted) to verify this is also fixed; and amended one of its comments to reflect what's now to be expected. Updated the test's expected output files. Task-number: QTBUG-61774 Change-Id: I99596b595c6d1184038f23383844c6ff51a0cd91 Reviewed-by: Jędrzej Nowacki --- .../testlib/selftests/expected_globaldata.lightxml | 31 ++++++++++++++++++---- .../auto/testlib/selftests/expected_globaldata.tap | 23 +++++++++------- .../testlib/selftests/expected_globaldata.teamcity | 11 ++++---- .../auto/testlib/selftests/expected_globaldata.txt | 14 +++++++--- .../auto/testlib/selftests/expected_globaldata.xml | 31 ++++++++++++++++++---- .../testlib/selftests/expected_globaldata.xunitxml | 18 ++++++++++--- .../selftests/globaldata/tst_globaldata.cpp | 7 ++--- 7 files changed, 102 insertions(+), 33 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml index e536031899..1212e4b364 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.lightxml +++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml @@ -120,6 +120,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -143,17 +167,14 @@ - + - + - - - diff --git a/tests/auto/testlib/selftests/expected_globaldata.tap b/tests/auto/testlib/selftests/expected_globaldata.tap index 318299992f..4d61b7437b 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.tap +++ b/tests/auto/testlib/selftests/expected_globaldata.tap @@ -29,24 +29,29 @@ ok 7 - skipLocal(global=false:local=false) # SKIP skipping # init skipLocal local=true ok 8 - skipLocal(global=false:local=true) # SKIP skipping # cleanup skipLocal local=true +# init skipLocal local=false +ok 9 - skipLocal(global=true:local=false) # SKIP skipping +# cleanup skipLocal local=false +# init skipLocal local=true +ok 10 - skipLocal(global=true:local=true) # SKIP skipping +# cleanup skipLocal local=true # init skipSingle local=false # global: false local: false # cleanup skipSingle local=false -ok 9 - skipSingle(global=false:local=false) +ok 11 - skipSingle(global=false:local=false) # init skipSingle local=true -# global: false local: true +ok 12 - skipSingle(global=false:local=true) # SKIP Skipping # cleanup skipSingle local=true -ok 10 - skipSingle(global=false:local=true) # init skipSingle local=false -ok 11 - skipSingle(global=true:local=false) # SKIP Skipping +ok 13 - skipSingle(global=true:local=false) # SKIP Skipping # cleanup skipSingle local=false # init skipSingle local=true # global: true local: true # cleanup skipSingle local=true -ok 12 - skipSingle(global=true:local=true) +ok 14 - skipSingle(global=true:local=true) # cleanupTestCase cleanupTestCase (null) -ok 13 - cleanupTestCase() -1..13 -# tests 13 -# pass 9 +ok 15 - cleanupTestCase() +1..15 +# tests 15 +# pass 8 # fail 0 diff --git a/tests/auto/testlib/selftests/expected_globaldata.teamcity b/tests/auto/testlib/selftests/expected_globaldata.teamcity index 2f9f97d912..f76f6090ba 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.teamcity +++ b/tests/auto/testlib/selftests/expected_globaldata.teamcity @@ -17,14 +17,15 @@ ##teamcity[testIgnored name='skip()' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] ##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] ##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] ##teamcity[testStarted name='skipSingle(local=false)' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local=false)' out='QDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local=false' flowId='tst_globaldata'] +##teamcity[testStdOut name='skipSingle(local=false)' out='QDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local=false' flowId='tst_globaldata'] ##teamcity[testFinished name='skipSingle(local=false)' flowId='tst_globaldata'] -##teamcity[testStarted name='skipSingle(local=true)' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=true|nQDEBUG: global: false local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata'] -##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata'] +##teamcity[testIgnored name='skipSingle(local=true)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] ##teamcity[testIgnored name='skipSingle(local=false)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata'] -##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=false|nQDEBUG: cleanup skipSingle local=false|nQDEBUG: init skipSingle local=true|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata'] +##teamcity[testStarted name='skipSingle(local=true)' flowId='tst_globaldata'] +##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=true|nQDEBUG: cleanup skipSingle local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: cleanup skipSingle local=false|nQDEBUG: init skipSingle local=true|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata'] ##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata'] ##teamcity[testStarted name='cleanupTestCase()' flowId='tst_globaldata'] ##teamcity[testStdOut name='cleanupTestCase()' out='QDEBUG: cleanupTestCase cleanupTestCase (null)' flowId='tst_globaldata'] diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt index b18568009a..016b5e8299 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.txt +++ b/tests/auto/testlib/selftests/expected_globaldata.txt @@ -32,14 +32,22 @@ QDEBUG : tst_globaldata::skipLocal(global=false:local=true) init skipLocal local SKIP : tst_globaldata::skipLocal(global=false:local=true) skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] QDEBUG : tst_globaldata::skipLocal(global=false:local=true) cleanup skipLocal local=true +QDEBUG : tst_globaldata::skipLocal(global=true:local=false) init skipLocal local=false +SKIP : tst_globaldata::skipLocal(global=true:local=false) skipping + Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] +QDEBUG : tst_globaldata::skipLocal(global=true:local=false) cleanup skipLocal local=false +QDEBUG : tst_globaldata::skipLocal(global=true:local=true) init skipLocal local=true +SKIP : tst_globaldata::skipLocal(global=true:local=true) skipping + Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] +QDEBUG : tst_globaldata::skipLocal(global=true:local=true) cleanup skipLocal local=true QDEBUG : tst_globaldata::skipSingle(global=false:local=false) init skipSingle local=false QDEBUG : tst_globaldata::skipSingle(global=false:local=false) global: false local: false QDEBUG : tst_globaldata::skipSingle(global=false:local=false) cleanup skipSingle local=false PASS : tst_globaldata::skipSingle(global=false:local=false) QDEBUG : tst_globaldata::skipSingle(global=false:local=true) init skipSingle local=true -QDEBUG : tst_globaldata::skipSingle(global=false:local=true) global: false local: true +SKIP : tst_globaldata::skipSingle(global=false:local=true) Skipping + Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] QDEBUG : tst_globaldata::skipSingle(global=false:local=true) cleanup skipSingle local=true -PASS : tst_globaldata::skipSingle(global=false:local=true) QDEBUG : tst_globaldata::skipSingle(global=true:local=false) init skipSingle local=false SKIP : tst_globaldata::skipSingle(global=true:local=false) Skipping Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)] @@ -50,5 +58,5 @@ QDEBUG : tst_globaldata::skipSingle(global=true:local=true) cleanup skipSingle l PASS : tst_globaldata::skipSingle(global=true:local=true) QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null) PASS : tst_globaldata::cleanupTestCase() -Totals: 9 passed, 0 failed, 4 skipped, 0 blacklisted, 0ms +Totals: 8 passed, 0 failed, 7 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_globaldata ********* diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml index b2f92016e5..9aa48c8f16 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xml +++ b/tests/auto/testlib/selftests/expected_globaldata.xml @@ -122,6 +122,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -145,17 +169,14 @@ - + - + - - - diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml index b135240d26..de184c2fdd 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml +++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml @@ -1,5 +1,5 @@ - + @@ -36,13 +36,19 @@ + + + + + + - + @@ -79,11 +85,17 @@ + + + + + + - + diff --git a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp index f425648ecc..3c5c2c8f37 100644 --- a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp +++ b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp @@ -125,11 +125,12 @@ void tst_globaldata::skipSingle() QFETCH_GLOBAL(bool, global); QFETCH(bool, local); - // A skip in the last run of one global row suppresses the test in the next - // global row (where a skip in an earlier run of the first row does not). - if (global && !local) + // A skip in the last run of one global row used to suppress the test in the + // next global row (where a skip in an earlier run of the first row did not). + if (global ^ local) QSKIP("Skipping"); qDebug() << "global:" << global << "local:" << local; + QCOMPARE(global, local); } void tst_globaldata::skipLocal() -- cgit v1.2.3 From 95f787bfdc890c259e8b347bdad9123d534efe0f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 9 Apr 2019 13:33:15 +0200 Subject: Replace Q_DECL_NOTHROW with noexcept the remaining places The first replacement had missed objective-C++ code some places ourside the src dir. In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still need to turn it off when compiled in C mode, but can get rid of the old NOTHROW moniker. Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759 Reviewed-by: Thiago Macieira --- tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index 8e2c7694a5..467c53088e 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -256,7 +256,7 @@ void tst_Cmptest::compare_boolfuncs() namespace { template -T *null() Q_DECL_NOTHROW { return nullptr; } +T *null() noexcept { return nullptr; } } void tst_Cmptest::compare_to_nullptr() -- cgit v1.2.3