diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/unittest/gtest-creator-printing.cpp | 20 | ||||
-rw-r--r-- | tests/unit/unittest/gtest-creator-printing.h | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/unit/unittest/gtest-creator-printing.cpp b/tests/unit/unittest/gtest-creator-printing.cpp index 4d463682c30..16e5133c561 100644 --- a/tests/unit/unittest/gtest-creator-printing.cpp +++ b/tests/unit/unittest/gtest-creator-printing.cpp @@ -49,6 +49,11 @@ #include <coreplugin/find/searchresultitem.h> +void PrintTo(const Utf8String &text, ::std::ostream *os) +{ + *os << text; +} + namespace Core { namespace Search { @@ -113,6 +118,11 @@ void PrintTo(const Utils::SmallString &text, ::std::ostream *os) *os << text; } +void PrintTo(const Utils::PathString &text, ::std::ostream *os) +{ + *os << text; +} + } // namespace Utils namespace ClangBackEnd { @@ -731,6 +741,16 @@ std::ostream &operator<<(std::ostream &out, const FilePath &filePath) return out << "(" << filePath.path() << ", " << filePath.slashIndex() << ")"; } +void PrintTo(const FilePath &filePath, ::std::ostream *os) +{ + *os << filePath; +} + +void PrintTo(const FilePathView &filePathView, ::std::ostream *os) +{ + *os << filePathView; +} + namespace V2 { std::ostream &operator<<(std::ostream &os, const FileContainer &container) diff --git a/tests/unit/unittest/gtest-creator-printing.h b/tests/unit/unittest/gtest-creator-printing.h index 7fc9e15bf40..072719ff6d1 100644 --- a/tests/unit/unittest/gtest-creator-printing.h +++ b/tests/unit/unittest/gtest-creator-printing.h @@ -33,6 +33,11 @@ #include <iosfwd> +#include <gtest/gtest-printers.h> + +class Utf8String; +void PrintTo(const Utf8String &text, ::std::ostream *os); + namespace Core { namespace Search { @@ -57,6 +62,7 @@ std::ostream &operator<<(std::ostream &out, const Macro ¯o); namespace Utils { void PrintTo(const Utils::SmallString &text, ::std::ostream *os); +void PrintTo(const Utils::PathString &text, ::std::ostream *os); } // namespace ProjectExplorer namespace ClangBackEnd { @@ -177,6 +183,9 @@ std::ostream &operator<<(std::ostream &out, const TokenInfos &tokenInfos); std::ostream &operator<<(std::ostream &out, const FilePathView &filePathView); std::ostream &operator<<(std::ostream &out, const NativeFilePathView &nativeFilePathView); +void PrintTo(const FilePath &filePath, ::std::ostream *os); +void PrintTo(const FilePathView &filePathView, ::std::ostream *os); + namespace V2 { class FileContainer; class ProjectPartContainer; |