llvm-project/llvm/utils/unittest/googletest
Sam McCall 2d8242d60d [gtest] Support raw_ostream printing functions more comprehensively.
Summary:
These are functions like operator<<(raw_ostream&, Foo).

Previously these were only supported for messages. In the assertion
  EXPECT_EQ(A, B) << C;
the local modifications would explicitly try to use raw_ostream printing for C.
However A and B would look for a std::ostream printing function, and often fall
back to gtest's default "168 byte object <00 01 FE 42 ...>".

This patch pulls out the raw_ostream support into a new header under `custom/`.

I changed the mechanism: instead of a convertible stream, we wrap the printed
value in a proxy object to allow it to be sent to a std::ostream.
I think the new way is clearer.

I also changed the policy: we prefer raw_ostream printers over std::ostream
ones. This is because the fallback printers are defined using std::ostream,
while all the raw_ostream printers should be "good".

Reviewers: ilya-biryukov, chandlerc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D43091

llvm-svn: 324876
2018-02-12 10:20:09 +00:00
..
include/gtest [gtest] Support raw_ostream printing functions more comprehensively. 2018-02-12 10:20:09 +00:00
src [NFC] fix trivial typos in comments and documents 2018-01-29 05:17:03 +00:00
LICENSE.TXT
README.LLVM Note addition of NetBSD support in googletest 2017-05-06 02:45:42 +00:00

README.LLVM

LLVM notes
----------

This directory contains Google Test 1.8.0, with all elements removed except for
the actual source code, to minimize the addition to the LLVM distribution.

Cleaned up as follows:

# Remove all the unnecessary files and directories
$ rm -f CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README README.md .gitignore
$ rm -rf build-aux cmake codegear m4 make msvc samples scripts test xcode docs
$ rm -f `find . -name \*\.pump`
$ rm -f src/gtest_main.cc

# Put the license in the consistent place for LLVM.
$ mv LICENSE LICENSE.TXT

Modified as follows:
* Added support for NetBSD, Minix and Haiku.
* Added raw_os_ostream support to include/gtest/internal/custom/gtest-printers.h.