18 changes: 18 additions & 0 deletions test/fail.cpp
@@ -0,0 +1,18 @@
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"
@BOOST_CONFIG_TR1_INCLUDE@

@BOOST_CONFIG_IFDEF@ @BOOST_CONFIG_MACRO@
#include "@BOOST_CONFIG_FILE@.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
return @BOOST_CONFIG_NS@::test();
}
15 changes: 12 additions & 3 deletions test/limits_test.cpp
Expand Up @@ -9,10 +9,19 @@
*/

#include <boost/limits.hpp>
#include <boost/detail/lightweight_main.hpp>
#include <boost/core/lightweight_test.hpp>
#include <iostream>

namespace boost { namespace config_test {

inline void fail(bool b)
{
if (!b) std::abort();
}

}}

#define BOOST_TEST(x) boost::config_test::fail(x)

/*
* General portability note:
* MSVC mis-compiles explicit function template instantiations.
Expand Down Expand Up @@ -172,7 +181,7 @@ void test_float_limits(const T &, const char * msg)
}


int cpp_main(int, char*[])
int main(int, char*[])
{
test_integral_limits(bool(), "bool");
test_integral_limits(char(), "char");
Expand Down
9 changes: 7 additions & 2 deletions test/math_info.cpp
Expand Up @@ -14,14 +14,17 @@
//

#include <boost/limits.hpp>
#include <boost/detail/workaround.hpp>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <float.h>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <boost/type_traits/alignment_of.hpp>
#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
#include <type_traits>
#endif

#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::strcmp; using ::pow; using ::fabs; using ::sqrt; using ::sin; using ::atan2; }
Expand Down Expand Up @@ -155,8 +158,10 @@ void print_limits(T, const char* name)
}
std::cout <<
" sizeof(" << name << ") = " << sizeof(T) << std::endl;
#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
std::cout <<
" alignment_of<" << name << "> = " << boost::alignment_of<T>::value << std::endl << std::endl;
" alignment_of<" << name << "> = " << std::alignment_of<T>::value << std::endl;
#endif
}
/*
template <class T>
Expand Down
18 changes: 18 additions & 0 deletions test/pass.cpp
@@ -0,0 +1,18 @@
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"
@BOOST_CONFIG_TR1_INCLUDE@

@BOOST_CONFIG_IFDEF@ @BOOST_CONFIG_MACRO@
#include "@BOOST_CONFIG_FILE@.ipp"
#else
namespace @BOOST_CONFIG_NS@ = empty_boost;
#endif

int main( int, char *[] )
{
return @BOOST_CONFIG_NS@::test();
}