decorator_21.run-fail.cpp 809 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright Andrzej Krzemienski 2015.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //[example_code
  7. #define BOOST_TEST_MODULE decorator_21
  8. #include <boost/test/included/unit_test.hpp>
  9. namespace utf = boost::unit_test;
  10. namespace tt = boost::test_tools;
  11. tt::assertion_result fail(utf::test_unit_id)
  12. {
  13. tt::assertion_result ans(false);
  14. ans.message() << "precondition failed";
  15. return ans;
  16. }
  17. BOOST_AUTO_TEST_CASE(test_1)
  18. {
  19. BOOST_TEST(false);
  20. }
  21. BOOST_AUTO_TEST_CASE(test_2,
  22. * utf::depends_on("test_1"))
  23. {
  24. BOOST_TEST(true);
  25. }
  26. BOOST_AUTO_TEST_CASE(test_3,
  27. * utf::precondition(fail))
  28. {
  29. BOOST_TEST(true);
  30. }
  31. //]