Sorry to jump in, but...
Sometimes a successful but silent test feels anticlimactic, or I can't believe a test unexpectedly passed.
Mostly that's when I'm not doing TDD.
I normally just add a print statement somewhere, briefly, but I should probably use coverage... ;)
On 20 Jul 2010 22:12, "Vlad Losev" <vl...@google.com> wrote:
> I see. It should be noted that the purpose of a test is to make sure the
> code performing to the specifications set by the design, and if it does
> deviate from those specifications, tell the user where and how precisely
> that happens. Google Test is geared towards that in a couple of ways. First,
> the messages generated by test assertions are all designed to inform the
> user how the test assumptions are being broken.Secon, for performance
> reasons, the library only reports as much information as necessary.
>
> What would be the purpose of telling the user explicitly that the code
> performs as designed - even when the absence of the output conveys the same
> message? Can't that purpose be achieved by means other than re-engineering
> Google Test?
>
> On Tue, Jul 20, 2010 at 11:45 AM, Steve Jaffe <steve...@yahoo.com> wrote:
>
>>
>> Yes, basically the same information you would get if the test failed.
>> ------------------------------
>> *From:* Vlad Losev <vl...@google.com>
>> *To:* Google C++ Testing Framework <googletes...@googlegroups.com>
>> *Sent:* Tue, July 20, 2010 12:03:51 PM
>> *Subject:* Re: [opensource-gtest] Re: [googletest] messages for success as
>> well as failure?
>>
>> Do you mean printing details of execution each successful test assertion,
>> such EXPECT_EQ()?
>>
>> On Mon, Jul 19, 2010 at 6:44 PM, Steve Jaffe <steve...@yahoo.com>wrote:
>>
>>>
>>> Perhaps I wasn't clear. I'm asking for messages on success with the same
>>> amount of detail as those for failure. That means an individual message for
>>> each test rather than simply a summary. I wouldn't want this all the time by
>>> any means, but I think it would be a useful option to exercise occasionally.
>>> ------------------------------
>>> *From:* Keith Ray <keit...@gmail.com>
>>> *To:* stevej <steve...@yahoo.com>
>>> *Cc:* Google C++ Testing Framework <googletes...@googlegroups.com>
>>> *Sent:* Mon, July 19, 2010 7:51:54 PM
>>> *Subject:* Re: [googletest] messages for success as well as failure?
>>>
>>> What I like about google test is the it *does *print success messages
Sorry to jump in, but...
Sometimes a successful but silent test feels anticlimactic, or I can't believe a test unexpectedly passed.
Mostly that's when I'm not doing TDD.
I normally just add a print statement somewhere, briefly, but I should probably use coverage... ;)
The reason I don't see SUCCEED() messages is the following in
gtest.cc:
// Called after an assertion failure.
void PrettyUnitTestResultPrinter::OnTestPartResult(
const TestPartResult& result) {
// If the test part succeeded, we don't need to do anything.
if (result.type() == TestPartResult::kSuccess)
return;