Boost logo

Boost :

Subject: Re: [boost] [assert][lightweight_test] Quick review of proposed changes
From: Beman Dawes (bdawes_at_[hidden])
Date: 2011-01-24 08:43:38


On Sun, Jan 23, 2011 at 12:32 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
> Beman Dawes wrote:
>
>>...
>>
>> * Messages are now sent do BOOST_LIGHTWEIGHT_TEST_OSTREAM
>
> I'm sorry if I missed the explanation for it... what is the use case of this
> feature?

The motivating use case is the Microsoft Visual Studio IDE, which
treats cout and cerr as two separate streams. So you get all the cout
output followed by all the cerr output, when what you really want is
the equivalent of command line 2>&1

Just changing the lightweight_test.hpp output to std::cout isn't a
good solution because (1) std::cerr is really the right stream for
most uses, and (2) a change might break existing scripts that assume
std::cerr. Detecting VC++ isn't a good solution because (1) there
doesn't seem to be any way to distinguish between compiling under the
IDE versus the command line, and (2) there may be other IDE or test
frameworks that have the same problem. Thus the macro. I'll add this
comment:

// IDE's like Visual Studio perform better if output goes to std::cout or
// some other stream, so allow user to configure output stream:

>>  http://mysite.verizon.net/beman/assert.html
>>  http://mysite.verizon.net/beman/assert_test.cpp
>>  http://mysite.verizon.net/beman/lightweight_test.hpp
>
> You should add your name to the copyright.

Will do.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk