Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2007-02-01 15:51:52


Hi Gennadiy!

On 2/2/07, Gennadiy Rozental <gennadiy.rozental_at_[hidden]> wrote:
>
> "Dean Michael Berris" <mikhailberis_at_[hidden]> wrote in message
> news:45C2358E.3090807_at_gmail.com...
> >
> > That being said, that discussion is a good 4 months ago, and would like
> > to ask the following questions to those who might be interested in
> > something like this:
> >
> > * What degree of integration with Boost.Test be "suitable"? Though I
> > see Boost.Test has a wealth of preprocessor macro's going about, it
> > shouldn't be hard to integrate at that level.
>
> I do not have time at the moment to look though your code. But just as a n
> information:
>
> Starting Boost1.34 Boost.Test includes "Interaction based testing" support.
> The support is presented as a framework for different extensions. The two
> "extensions" implemented already within the Boost.Test is "Logged
> expectation testing" and "Exception safety testing". If you are interested
> they are in cvs HEAD and RC.
>

Interesting, do you have any documentation regarding how to implement
extensions? Or at least can you lead me on to which parts of
Boost.Test I should start looking into? I already have Boost CVS HEAD
at the moment...

> How does it correspond to what you are trying to do? Do you see any
> intersections and or possible additions to what Boost.Test currently
> presents.
>

I guess it would be better to show an example of what the BDD
interface is about:

std::string str = "Hello, World!";
value(str).should.equal("Hello, World!");

I had been thinking that the implementation of
`value(str).should.equal(...)' should use something like
BOOST_CHECK_EQUAL(str, ...).

The idea really of the BDD interface is to provide an alternative
which is closer to English for specifying behavior. I'm looking to
have this interface available with or without Boost.Test, in which
case the library can be used even in debug builds, as such:

void some_function (int some_value) {
  // validate some_value
  // and should only be relevant in debug builds
  boost::spec::value(some_value).should.be_greater_than(1);

  // do whatever some_function should do
};

Currently the usage scenario with Boost.Test would be the following example:

BOOST_AUTO_TEST_CASE ( some_test ) {
  int an_int = 0;
  BOOST_REQUIRE_NO_THROW( value(an_int).should.not_equal(0) );
};

Which I admit, is not pretty at all.

Would appreciate further input.

Thanks!

-- 
Dean Michael C. Berris
http://cplusplus-soup.blogspot.com/
mikhailberis AT gmail DOT com
+63 928 7291459

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