Richard
I want to make custom assertion methods that report the failure location as the place where the custom assertion is invoked, not the location where the BOOST_REQUIRE_xxx macros are used in the implementation of the custom assertion.
Hi Richard, Frankly I do not follow what you want exactly. BOOST_REQUIRE reports a location of that statement. What do you want to report? It might be that you want something like this: void check_op1( char const* f, int l ) { BOOST_REQUIRE( expr, f, l ); } BOOST_AUTO_TEST_CASE( t1 ) { check_op1( __FILE_, __LINE__ ); } BOOST_AUTO_TEST_CASE( t2 ) { check_op1( __FILE_, __LINE__ ); } If this is the case, I'd rather you use new BOOST_TEST_CONTEXT facility and implement check_op1 like this: void check_op1( char const* f, int l ) { BOOST_TEST_CONTEXT( "Testing invoked from: " << f << "(" << l << ")" ) { BOOST_REQUIRE( expr1 ); BOOST_REQUIRE( expr2 ); } }