From f032781796a74a1713bc134248350f00f5cc80ba Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 1 Jun 2014 01:48:14 +0300 Subject: [PATCH] Add Jamfile.v2; make ref_test use lightweight_test.hpp. --- test/Jamfile.v2 | 21 ++++++++++ ...elete_test.cpp => checked_delete_fail.cpp} | 0 test/ref_test.cpp | 40 +++++-------------- 3 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 test/Jamfile.v2 rename test/{checked_delete_test.cpp => checked_delete_fail.cpp} (100%) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 new file mode 100644 index 0000000..ed6e7e4 --- /dev/null +++ b/test/Jamfile.v2 @@ -0,0 +1,21 @@ +# Boost.Core Library test Jamfile +# +# Copyright (c) 2014 Peter Dimov +# +# 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 + +# bring in rules for testing +import testing ; + +test-suite "core" + : + [ run addressof_test.cpp ] + [ run addressof_test2.cpp ] + [ run addressof_np_test.cpp ] + [ run addressof_fn_test.cpp ] + [ compile-fail checked_delete_fail.cpp ] + [ compile ref_ct_test.cpp ] + [ run ref_test.cpp ] + ; diff --git a/test/checked_delete_test.cpp b/test/checked_delete_fail.cpp similarity index 100% rename from test/checked_delete_test.cpp rename to test/checked_delete_fail.cpp diff --git a/test/ref_test.cpp b/test/ref_test.cpp index 71481fa..a8f5bd7 100644 --- a/test/ref_test.cpp +++ b/test/ref_test.cpp @@ -6,28 +6,8 @@ // run-time test for "boost/ref.hpp" header content // see 'ref_ct_test.cpp' for compile-time part -#if defined(_MSC_VER) && !defined(__ICL) -# pragma warning(disable: 4786) // identifier truncated in debug info -# pragma warning(disable: 4710) // function not inlined -# pragma warning(disable: 4711) // function selected for automatic inline expansion -# pragma warning(disable: 4514) // unreferenced inline removed -#endif - #include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -# pragma warning(push, 3) -#endif - -#include - -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -# pragma warning(pop) -#endif - - -#define BOOST_INCLUDE_MAIN -#include +#include namespace { using namespace boost; @@ -60,11 +40,11 @@ struct ref_wrapper static void test(T x) { - BOOST_CHECK(passthru(ref(x)) == &x); - BOOST_CHECK(&ref(x).get() == &x); + BOOST_TEST(passthru(ref(x)) == &x); + BOOST_TEST(&ref(x).get() == &x); - BOOST_CHECK(cref_passthru(cref(x)) == &x); - BOOST_CHECK(&cref(x).get() == &x); + BOOST_TEST(cref_passthru(cref(x)) == &x); + BOOST_TEST(&cref(x).get() == &x); } }; @@ -102,20 +82,20 @@ void unwrap_test() { do_unwrap(ref(ci)); copy_counter cc; - BOOST_CHECK(cc.count() == 0); + BOOST_TEST(cc.count() == 0); do_unwrap(cc); do_unwrap(ref(cc)); do_unwrap(cref(cc)); - BOOST_CHECK(cc.count() == 1); - BOOST_CHECK(unwrap_ref(ref(cc)).count() == 1); + BOOST_TEST(cc.count() == 1); + BOOST_TEST(unwrap_ref(ref(cc)).count() == 1); } -int test_main(int, char * []) +int main() { ref_wrapper::test(1); ref_wrapper::test(1); unwrap_test(); - return 0; + return boost::report_errors(); }