diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 68df2614..e61f69f7 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -116,6 +116,7 @@ test-suite "unit_test_framework_test" [ test-btl-lib run : single_header_test ] [ test-btl-lib run-fail : minimal_test ] [ test-btl-lib run : foreach_test ] + [ test-btl-lib run : test_windows_headers : boost_unit_test_framework ] [ test-btl-lib run : output_test_stream_test : boost_unit_test_framework ] [ test-btl-lib run : result_report_test : boost_unit_test_framework : test_files/result_report_test.pattern ] [ test-btl-lib run : parameterized_test_test : boost_unit_test_framework ] diff --git a/test/test_windows_headers.cpp b/test/test_windows_headers.cpp new file mode 100644 index 00000000..64524d19 --- /dev/null +++ b/test/test_windows_headers.cpp @@ -0,0 +1,36 @@ +// (C) Copyright Raffi Enficiaud 2015 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/test for the library home page. +// +// Tests some compilation troubleshooting issues with the windows headers (eg min/max macros) +// *************************************************************************** + +#define BOOST_TEST_MODULE test_windows_headers + +#ifdef _WIN32 +#include +#endif + +#include +#include // Extra test tool for FP comparison. + +using namespace boost; +namespace ut = boost::unit_test; +using namespace boost::test_tools; + + +BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES( test, 2 ) + +BOOST_AUTO_TEST_CASE( test ) +{ + // produces an error + BOOST_TEST(1 == 0); + + // this is added in order to compile floating point relative code as well + // which might have trouble compiling if system headers are included (as for + // boost.thread, eg. for std::min). + BOOST_CHECK_CLOSE(1.1, 1.2, 1e-5); +}