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/selftests') 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