简体   繁体   中英

How do I hardcode a skipped test using Boost.Test?

While coding using python's unittest module, I have found it useful to mark tests to be skipped on execution (see unittest.SkipTest exception in python )

Is there anything similar in Boost.Test?

I am implementing my tests using boost version 1.49.0 and I want to add something like:

BOOST_AUTO_TEST_CASE(test_wibly)
{
    throw boost::???::skip_test("http://my::defect.tracking.software/#4321");
}

Basically this should not consider the test as passed or failed, but "skipped" and it should appear so in the output.

If there is nothing like it, where can I find some resources on how to implement it myself (on top of Boost.Test)?

The documentation has a section on skipping tests, but it refers to skipping a test suite if a previous test fails.

As far as I know there is no way to do this with Boost Test.

I have run across the NCBI C++ Toolkit , which has an enhanced version of Boost Test that adds these sort of capabilities. I haven't had an occasion to try it yet, so I can't vouch for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM