summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/tst_selftests.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-04 23:01:17 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-04-04 23:01:17 +0000
commited485243b594a730cebee4d76847e0f556d369f4 (patch)
tree545dd98a3138782df786f742cac02bc63113eaf6 /tests/auto/testlib/selftests/tst_selftests.cpp
parent8d7c97d428cdf89c3419a4e13b62a9849feefce9 (diff)
parenteb606d85b3f1548445cfd1fee43f882da88fb6e7 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 3a242d0493..1326b96177 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -487,6 +487,7 @@ void tst_Selftests::runSubTest_data()
<< "printdatatags"
<< "printdatatagswithglobaltags"
<< "qexecstringlist"
+ << "signaldumper"
<< "silent"
<< "singleskip"
<< "skip"
@@ -552,6 +553,9 @@ void tst_Selftests::runSubTest_data()
else if (subtest == "printdatatagswithglobaltags") {
arguments << "-datatags";
}
+ else if (subtest == "signaldumper") {
+ arguments << "-vs";
+ }
else if (subtest == "silent") {
arguments << "-silent";
}
@@ -952,6 +956,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;
}