You can automate the generation of type combinations for testing metafunctions by using mp_product to create a Cartesian product of type lists and tuple_for_each to iterate over them.
mp_product<F, L1, L2> acts like nested loops, applying F<T1, T2> for every combination of elements from L1 and L2. If F is mp_list, the result is a list of mp_list objects containing the pairs. You can then use tuple_for_each to execute a test function for each pair.
In C++11, since lambdas cannot capture or use auto&& parameters easily, use a function object with a templated operator().
#include <boost/mp11.hpp>
#include <type_traits>
#include <iostream>
#include <tuple>
using namespace boost::mp11;
// The metafunction to test
template<class T, class U> using result = typename std::common_type<T, U>::type;
// The test function object (C++11 compatible)
struct test_result
{
template<class T1, class T2> void operator()(mp_list<T1, T2> const&) const
{
using T3 = decltype(T1() + T2());
using T4 = result<T1, T2>;
std::cout << (std::is_same<T3, T4>::value ? "[PASS] " : "[FAIL] ") << std::endl;
}
};
int main()
{
using L = std::tuple<char, short, int, unsigned, long, unsigned long>;
// Generates all combinations of L x L and runs test_result on each
tuple_for_each(mp_product<mp_list, L, L>(), test_result());
}