test: Add GTest printers for commonly used Qt types
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 4 Oct 2018 16:59:59 +0000 (18:59 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commit98ffecc6e97b208712c6f5c5da1b4ba10aa09333
tree61cdad0bb66a801a9335dca1f30a8fb9e4a04c21
parent34e58425ffb5475b210abb484970e674ddb98744
test: Add GTest printers for commonly used Qt types

Because GTest by default prints out unknown types as hexdump or other
badly readably formats, provide PrintTo functions for Qt types we use
in tests. That way, GTest will use those instead of falling back to
its own default.

Reuse Qt's own QDebug stream support to avoid having to reimplement
printing functionality for all the types. This makes it very easy
to see e.g. the contents of a QVariantMap or other complex types.
src/test/global/CMakeLists.txt
src/test/global/printers.cpp [new file with mode: 0644]
src/test/global/printers.h [new file with mode: 0644]
src/test/global/testglobal.h