Boost logo

Boost Users :

Subject: Re: [Boost-users] [unit_test_framework] checkpoints for BOOST_CHECK*?
From: rozelak_at_[hidden]
Date: 2009-08-28 15:09:51


>
> rozelak_at_[hidden] wrote:
> >> rozelak_at_[hidden] wrote:
> >>
> >>> Is there a way how to achieve what I am looking
> >>> for?
> >>> >>>
> >> Use BOOST_TEST_MESSAGE and set log level to message
> >> >>
> >
> > Yes, I have read about this option and it works -
> > thank you. I consider
> > > it as not perfect, but working solution.
> >
> > However, I want to ask, if the idea of checkpoints
> > could be generalised
> > > and used during check failure printing as well (as
> > has been suggested
> > > in the example in my first post).
> > I don't know boost source in depth, but it seems
> > that BOOST_TEST_CHECKPOINT
> > > just calls boost::unit_test::unit_test_log.set_checkpoint(...),
> > > > > > > > which
> > > stores the checkpoint info in unit_test_log (which
> > is supposed to be
> > > singleton).
> > Would, therefore, be possible to print the checkpoint
> > stored also when
> > > test failure is printed? May I be helpfull somehow
> > to do this?
> > >
> > Or is it against the idea of the checkpoints?
> >
>
> I think the issue is that BOOST_CHECK and friends set
> a checkpoint.
>

I see, you are right. It is set by BOOST_TEST_PASSPOINT() macro.

Well, do you think, that it would be beneficial to define new macro,
e.g. BOOST_TEST_FAILRECORD (please suggest a better name, if you have
one)? The macro would be implemented in the way very similar to BOOST_TEST_CHECKPOINT,
but the data "recorded" by the macro would be printed only when a testcase
fails or an unexpected exception occurs. It also has the advantage,
that when not used, it does not affect the current behaviour of boost.

Is there a change to accept it in the boost test framework, if I try
to implement it?

Thank you for suggestions/comments,
Dan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net