metatest::meta_check

Synopsis

template <class Pred>
void meta_check(const location& location_, const std::string& name_);

template <class Pred>
void meta_check(const location& location_);

This template function simplifies passing template metaprogrmaming assertions to Boost.Test. It creates a test_result from the Pred predicate using location_ and name_ when available. The success/failure flag and the reason string of the result is then passed to a Boost.Test CHECK assertion.

#include <metatest/boost_test.hpp>

Example

BOOST_AUTO_TEST_CASE(example)
{
  meta_check<
    boost::mpl::equal_to<boost::mpl::int_<13>, function_to_test<int>::type>
  >(METATEST_HERE);
}

[up]