Boost logo

Boost Users :

Subject: Re: [Boost-users] [Test] Problem with expected failures in test suite
From: Maria Kozinska (maria.kozinska_at_[hidden])
Date: 2010-06-04 04:43:29


Thanks for answer.

On 4 June 2010 00:27, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> Maria Kozinska wrote:
>>
>> I tried to write a test suite with one expected failure, however it is
>> not working.
>
> How is it not working?  The output looks right to me:
> Running 3 test cases...
> c:/documents and settings/steven/my documents/visual studio
> 2010/projects/scratc
> h/scratch/scratch.cpp(13): error in "opt2": check !xxx failed
>
> *** 1 failure detected (1 failure expected) in test suite "Master Test
> Suite"
>
> What do you expect to see?

With --report_level=short I can see that "Master Test Suite" failed
despite 1 failure expected. I would like it to pass, because this
exactly one failure is OK.

Running 3 test cases...
sample.cxx(14): error in "opt2": check !xxx failed

Test suite "Master Test Suite" failed with:
  1 assertion out of 2 passed
  1 assertion out of 2 failed
  1 failure expected
  2 test cases out of 3 passed
  1 test case out of 3 failed

>
>> Probably I'm doing something wrong.
>> The idea is that I have a function that can be implemented in few
>> ways, thus there are few possible correct results. Depending on the
>> implementation, I want to test it with different set of test cases. I
>> don't want to check at the beginning of each test case which option is
>> valid, I would prefer to skip unnecessary test cases. Is it possible?
>>
>
> In init_unit_test_suite, can you try only adding the test
> cases that you need?
I have to add all of them, because at compile time I don't know yet
which ones should be executed. It is ensured at runtime by
dependencies - as with test1_1, which is executed only if option1
succeeded (and skipped otherwise).

Maria


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