Boost logo

Boost Users :

Subject: [Boost-users] naming a test
From: Eric Prud'hommeaux (eric_at_[hidden])
Date: 2014-05-25 04:08:37


boost/libs/test/example/external_main_example_1.cpp provides an
example of a dynamical test suite tree. The invocation of
  add( BOOST_TEST_CASE(boost::bind(&free_test_function, 1, 1)));
results in unpleasant names like
  "boost::bind( &free_test_function, 1, 2 )"

. I used the preprocessor output to override the 2nd arg to
make_test_case with a name of my choosing:
    ts->add(boost::unit_test::make_test_case
            (boost::unit_test::callback0<>
             (boost::bind( &free_test_function, 1, 2)),
             boost::unit_test::const_string( minor, 1)));

This works (pretty names and invocable with the logical run_test) but
I have no particular confidence that this will survive version changes
as well as would BOOST_TEST_CASE. Is there a better way to do this?

(stand-alone example attached)

-- 
-ericP
office: +1.617.599.3509
mobile: +33.6.80.80.35.59
(eric_at_[hidden])
Feel free to forward this message to any list for any purpose other than
email address distribution.
There are subtle nuances encoded in font variation and clever layout
which can only be seen by printing this message on high-clay paper.



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