Boost Users :
Subject: Re: [Boost-users] Test: Skip test from fixture
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2017-05-15 09:38:00
Le 09.05.17 à 11:26, Florian Lindner via Boost-users a écrit :
> given I have a test with a fixture. How can I skip that test from within the fixture?
Not sure to understand what you mean: from the fixture itself, you want
to be able to skip the test, means that you have some logic inside your
fixture that determines if you need to run the test or not?
You may use the preconditions decorator:
but currently this check is happening before the setup of the fixture is
called (with decorators, see
and this is not possible for the previous fixture API (eg.
For the API with inherited fixture classes, you can just set a boolean
flag inside the fixture class, and check for this flag inside the test
case body to early terminate. For the decorator API, you have to do it
in a different way as the decorator and the test body do not share state.
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