|
Boost Users : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-02-15 12:21:18
"Markus Werle" <numerical.simulation_at_[hidden]> wrote in message
news:loom.20060214T151142-872_at_post.gmane.org...
> Gennadiy Rozental <gennadiy.rozental <at> thomson.com> writes:
>
>>
>> > Hi!
>> >
>> > When using the boost::test unit-test framework calls like
>> >
>> > boost::unit_test::test_suite* test =
>> > BOOST_TEST_SUITE( "Testing Something" );
>> >
>> > test->add(BOOST_TEST_CASE(&test_function_with_expected_error), 1);
>> >
>> > lead to an error in return code when used together
>> > with VC7 as a post-build step
>>
>> It shouldn't. Could you provide an example to replicate an error?
>
> I extended a unit_test example file and built a vc7 project.
> No more gimmicks. Should be reproducable with any of the example files,
> since
> the expected error came from stuff like
>
> void free_test_function()
> {
> BOOST_CHECK( 2 == 1 );
> }
I couldn't replicate any problems. An error code is zero if you specified
expected exception.
>> > Of course I could use runtime argument "--result_code=no", but then
>> > how can I make a difference between expected and unexpected errors?
>>
>> Check "Usage recomendation" section in docs. Use above flag always for
>> post-build event
>
> This makes no sense to me (yet). Sorry if I ask again:
> Why should I use this flag?
> I really want my build to _have_ a failure, when the testsuite has
> an _unexpected_ failure, so I really need --result-code not to be 'no'.
It will. VC gui does not rely solely on a return code to report a build
failure. It parse a build output for error statements that weill be present.
If you did not specify an result_code=no you will get an extra error that
you are not interrested in.
> OTOH I want my build to succeed in the vicinity of an expected failure,
> regardless of the value of --result-code.
> This was the aim of my OP.
See above. An error is going to be reported regardless.
Gennadiy
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