diff --git a/CMakeLists.txt b/CMakeLists.txt index 51bda0d..013cbaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt cmake_minimum_required(VERSION 3.5...3.16) -project(BoostStaticAssert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) +project(boost_static_assert VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) add_library(boost_static_assert INTERFACE) add_library(Boost::static_assert ALIAS boost_static_assert) @@ -23,3 +23,10 @@ if(HAVE_BOOST_INSTALL) boost_install(TARGETS boost_static_assert HEADER_DIRECTORY include/) endif() + +if(BUILD_TESTING) + + add_subdirectory(test) + add_subdirectory(example) + +endif() diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000..aeecd47 --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright 2018, 2019 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 + +include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) + +if(HAVE_BOOST_TEST) + +boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::static_assert Boost::type_traits) + +endif() diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index 0f3c356..97c490b 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -6,15 +6,6 @@ # bring in the rules for testing import testing ; -test-suite static_assert : -# [ run static_assert_example_1.cpp ] - [ run static_assert_example_2.cpp ] - [ run static_assert_example_3.cpp ] -; - - - - - - - +#run static_assert_example_1.cpp ; +run static_assert_example_2.cpp ; +run static_assert_example_3.cpp ; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..37eebc2 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright 2018, 2019 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 + +include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) + +if(HAVE_BOOST_TEST) + +boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::static_assert) + +endif() diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index acb28e7..e4dbe77 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -6,25 +6,16 @@ # bring in the rules for testing import testing ; -test-suite static_assert : - [ run static_assert_test.cpp ] - [ compile-fail static_assert_test_fail_1.cpp ] - [ compile-fail static_assert_test_fail_2.cpp ] - [ compile-fail static_assert_test_fail_3.cpp ] - [ compile-fail static_assert_test_fail_4.cpp ] - [ compile-fail static_assert_test_fail_5.cpp ] - [ compile-fail static_assert_test_fail_6.cpp ] - [ compile-fail static_assert_test_fail_7.cpp ] - [ compile-fail static_assert_test_fail_8.cpp ] - [ compile-fail static_assert_test_fail_9.cpp ] - [ compile-fail static_assert_test_fail_10.cpp ] -; +run static_assert_test.cpp ; +compile-fail static_assert_test_fail_1.cpp ; +compile-fail static_assert_test_fail_2.cpp ; +compile-fail static_assert_test_fail_3.cpp ; +compile-fail static_assert_test_fail_4.cpp ; +compile-fail static_assert_test_fail_5.cpp ; +compile-fail static_assert_test_fail_6.cpp ; +compile-fail static_assert_test_fail_7.cpp ; +compile-fail static_assert_test_fail_8.cpp ; +compile-fail static_assert_test_fail_9.cpp ; +compile-fail static_assert_test_fail_10.cpp ; build-project ../example ; - - - - - - -