diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..81ccd27 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright 2018, 2019, 2021, 2022 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 + LINK_LIBRARIES Boost::array Boost::container_hash Boost::core) + +endif() diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 997967a..bab406a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -16,3 +16,5 @@ run array7.cpp ; compile-fail array_getfail1.cpp ; compile-fail array_getfail2.cpp ; run array_hash.cpp ; + +run quick.cpp ; diff --git a/test/cmake_install_test/CMakeLists.txt b/test/cmake_install_test/CMakeLists.txt new file mode 100644 index 0000000..0b56a90 --- /dev/null +++ b/test/cmake_install_test/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright 2018, 2019, 2021 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 + +cmake_minimum_required(VERSION 3.5...3.20) + +project(cmake_install_test LANGUAGES CXX) + +find_package(boost_array REQUIRED) + +add_executable(quick ../quick.cpp) +target_link_libraries(quick Boost::array) + +enable_testing() +add_test(quick quick) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt new file mode 100644 index 0000000..ea0eae9 --- /dev/null +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright 2018, 2019, 2021 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 + +cmake_minimum_required(VERSION 3.5...3.20) + +project(cmake_subdir_test LANGUAGES CXX) + +add_subdirectory(../.. boostorg/array) + +add_subdirectory(../../../assert boostorg/assert) +add_subdirectory(../../../config boostorg/config) +add_subdirectory(../../../core boostorg/core) +add_subdirectory(../../../static_assert boostorg/static_assert) +add_subdirectory(../../../throw_exception boostorg/throw_exception) + +add_executable(quick ../quick.cpp) +target_link_libraries(quick Boost::array) + +enable_testing() +add_test(quick quick) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/quick.cpp b/test/quick.cpp new file mode 100644 index 0000000..c59a2c6 --- /dev/null +++ b/test/quick.cpp @@ -0,0 +1,11 @@ +// Copyright 2023 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt) + +#include + +int main() +{ + boost::array a = {{ 0, 1 }}; + return a[0]; +} diff --git a/test/test_cmake/CMakeLists.txt b/test/test_cmake/CMakeLists.txt deleted file mode 100644 index d1bce85..0000000 --- a/test/test_cmake/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Mike Dev -# 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 -# -# NOTE: This does NOT run the unit tests for Boost.Array. -# It only tests, if the CMakeLists.txt file in it's root works as expected - -cmake_minimum_required( VERSION 3.5 ) - -project( BoostBindCMakeSelfTest ) - -add_subdirectory( ../../../assert ${CMAKE_CURRENT_BINARY_DIR}/libs/assert ) -add_subdirectory( ../../../config ${CMAKE_CURRENT_BINARY_DIR}/libs/config ) -add_subdirectory( ../../../core ${CMAKE_CURRENT_BINARY_DIR}/libs/core ) -add_subdirectory( ../../../static_assert ${CMAKE_CURRENT_BINARY_DIR}/libs/static_assert ) -add_subdirectory( ../../../throw_exception ${CMAKE_CURRENT_BINARY_DIR}/libs/thorw_exception ) - -add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_array ) - -add_executable( boost_array_cmake_self_test main.cpp ) -target_link_libraries( boost_array_cmake_self_test Boost::array ) - diff --git a/test/test_cmake/main.cpp b/test/test_cmake/main.cpp deleted file mode 100644 index c2e0c90..0000000 --- a/test/test_cmake/main.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int main() { - boost::array a{}; -} \ No newline at end of file