catch2/projects
mat tso a47b8dee74 Add support toString for containers
Standard container types were printed as `"{?}"`
(default `toString` implementation for unsupported class).
This was contradictory with the documentation:
> "Most [...] std types are supported out of the box"
when in fact only `string`, `vector` and `tupple` were supported.

 - Renamed the `toStringVector.cpp` test file to `toStringContainers.cpp`

 - Types are consider containers if they contain `value_type` and
   `const_iterator` members and have `begin` and `end` support
   (members or ADL findable) returning a `const_iterator`.
   `const_iterator::operator*` must also return a `const value_type &`

 - Beware that a trying to printing a type fulfilling those requirements
   but returning invalid iterators will results in undefined behaviour. In
   such case specialize the Catch::Detail::IsContainer trait to contain
   `static const bool value = false` to revert to the default behaviour
   (printing `"{?}"`).

Test pretty printing of `std::list`, `std::deque`, `std::forward_list`,
`std::array` in Catch assertion macro. More complex structure like
`std::queue` or `std::multi_map` should also be tested.

Signed-off-by: mat tso <mat-tso@topmail.ie>
2016-10-14 04:11:40 +02:00
..
CMake Prepare toString support for std containers 2016-10-11 03:10:41 +02:00
runners/iTchRunner Stripped trailing whitespace from all source code lines 2015-11-04 18:04:15 +00:00
SelfTest Add support toString for containers 2016-10-14 04:11:40 +02:00
VS2008/TestCatch First cut of new test spec parser code 2014-05-16 06:50:00 +01:00
VS2010/TestCatch Added --use-colour option to give finer control over colourisation. 2016-02-29 08:03:48 +00:00
XCode Test self sufficiency of tostring.hpp header 2016-10-11 03:10:41 +02:00