[Boost-bugs] [Boost C++ Libraries] #12540: Provide customisation point for printing types in tests

Subject: [Boost-bugs] [Boost C++ Libraries] #12540: Provide customisation point for printing types in tests
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-10-21 17:38:57


#12540: Provide customisation point for printing types in tests
-------------------------------------------------+-------------------------
 Reporter: Tony Lewis <TonyELewis@…> | Owner: rogeeff
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.61.0 | Severity:
 Keywords: | Optimization
  test,customization,customisation,output,print,stream,insertion|
  operator,print_log_value,BOOST_TEST_DONT_PRINT_LOG_VALUE|
-------------------------------------------------+-------------------------
 AFAIU (from doc "Logging user defined types"), the current design gives
 users two options for handling output for their types in tests:
  * Provide `operator<<`
  * Prevent printing with `BOOST_TEST_DONT_PRINT_LOG_VALUE()`

 ...and all types must be printed.

 I suggest that this is to rigid. For some types, users may not want to
 provide a global `operator<<`, or they may have already provided an
 `operator<<` or they may not own the type.

 For these reasons, I think it would be better if Boost Test provided an
 explicit customization point that defaulted to calling `operator<<` but
 that could be overridden by the user to explictly control the Test
 printing without affecting `operator<<`.

 In fact, I think `boost::test_tools::tt_detail::print_log_value` is
 already close to serving this purpose and perhaps it needs little more
 than being made part of the public interface and documented.

 Thanks for all your work.


 PS "D4381: Suggested Design for Customization Points" may be relevant
 here.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12540>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC