Compare commits

...

22 Commits

Author SHA1 Message Date
ba72d3340f Merge pull request #16 from igaztanaga/patch-1
Small fix for Wsign-conversion
2021-10-13 16:03:23 +01:00
803b983da7 Small fix for Wsign-conversion 2021-10-13 15:10:36 +02:00
392199f6b1 Fix CMake tests in .travis.yml 2021-06-10 16:34:02 +03:00
482e81cddd Update CMakeLists.txt 2021-06-10 02:06:15 +03:00
66db74297a Merge pull request #13 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-21 18:01:26 +00:00
e9ab97859d [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-21 11:09:31 -05:00
073c482606 Merge pull request #11 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Use BOOST_BORLANDC for bcc32 compiler
2020-05-06 17:34:09 +01:00
8ab850a342 Use BOOST_BORLANDC for bcc32 compiler 2020-03-21 22:24:50 -04:00
9102d74933 Merge branch 'develop' into feature/add-cmake-tests 2020-01-06 20:11:01 +02:00
317f01fc58 Merge branch 'develop' into feature/add-cmake-tests 2019-12-29 20:06:15 +02:00
b57860c33f Use -DBOOST_INCLUDE_LIBRARIES=static_assert 2019-12-29 19:34:08 +02:00
ca94dbbc1a Use Boost_VERBOSE instead of Boost_DEBUG 2019-12-29 18:52:09 +02:00
0a775cf1c5 Untabify 2019-12-29 18:47:06 +02:00
944702b862 Add comment 2019-12-27 06:04:16 +02:00
1aaabeb02b Fix indentation 2019-12-27 04:28:29 +02:00
9064caf95f Merge branch 'pr/add-cmake-install' into feature/add-cmake-tests 2019-12-27 04:24:37 +02:00
ad48daf3b2 Change LIBRARIES to LINK_LIBRARIES 2019-12-27 04:20:36 +02:00
c6b558f1f2 Fix branch handling; add -j3 to b2 test 2019-12-27 03:32:34 +02:00
00724b8429 Fix .travis.yml typos; enable feature/* testing 2019-12-27 03:29:28 +02:00
00a741184c Add cmake_install_test, cmake_subdir_test 2019-12-26 19:05:07 +02:00
f000d27cb2 Add CMake testing job to Travis 2019-12-26 19:00:25 +02:00
a8597c46d5 Add CMake testing support 2019-12-26 18:58:11 +02:00
12 changed files with 127 additions and 42 deletions

View File

@ -271,6 +271,37 @@ matrix:
packages:
- libc++-dev
- os: linux
env: CMAKE=1
script:
- mkdir __build__ && cd __build__
- cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=static_assert ..
- cmake --build . --target tests
- ctest --output-on-failure
- os: linux
env: CMAKE_SUBDIR=1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- git clone -b $BOOST_BRANCH https://github.com/boostorg/config.git ../config
script:
- cd test/cmake_subdir_test && mkdir __build__ && cd __build__
- cmake ..
- cmake --build .
- cmake --build . --target check
- os: linux
env: CMAKE_INSTALL=1
script:
- pip install --user cmake
- mkdir __build__ && cd __build__
- cmake -DBOOST_INCLUDE_LIBRARIES=static_assert -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake --build . --target install
- cd ../libs/static_assert/test/cmake_install_test && mkdir __build__ && cd __build__
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake --build .
- cmake --build . --target check
- os: osx
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z

View File

@ -14,16 +14,15 @@ add_library(Boost::static_assert ALIAS boost_static_assert)
target_include_directories(boost_static_assert INTERFACE include)
target_link_libraries(boost_static_assert
INTERFACE
Boost::config
INTERFACE
Boost::config
)
# boost_install requires PROJECT_VERSION
# Without the superproject, we don't have any, so skip installation
# BUILD_TESTING is the standard CTest variable that enables testing
if(BOOST_SUPERPROJECT_VERSION)
if(BUILD_TESTING)
include(BoostInstall)
boost_install(TARGETS boost_static_assert HEADER_DIRECTORY include/)
add_subdirectory(test)
add_subdirectory(example)
endif()

11
example/CMakeLists.txt Normal file
View File

@ -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 LINK_LIBRARIES Boost::static_assert Boost::type_traits)
endif()

View File

@ -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 ;

View File

@ -16,6 +16,7 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <cstddef> //for std::size_t
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
//
@ -36,7 +37,7 @@
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
//
// workaround for buggy integral-constant expression support:
#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS
@ -81,7 +82,7 @@ template <bool x> struct STATIC_ASSERTION_FAILURE;
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
// HP aCC cannot deal with missing names for template value parameters
template<int x> struct static_assert_test{};
template<std::size_t x> struct static_assert_test{};
}

View File

@ -12,5 +12,6 @@
],
"maintainers": [
"John Maddock <john -at- johnmaddock.co.uk>"
]
],
"cxxstd": "03"
}

11
test/CMakeLists.txt Normal file
View File

@ -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 LINK_LIBRARIES Boost::static_assert)
endif()

View File

@ -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 ;

View File

@ -0,0 +1,17 @@
# 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
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_install_test LANGUAGES CXX)
find_package(boost_static_assert REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main Boost::static_assert)
enable_testing()
add_test(NAME main COMMAND main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@ -0,0 +1,7 @@
#include <boost/static_assert.hpp>
int main()
{
int const x = 5;
BOOST_STATIC_ASSERT( x > 4 );
}

View File

@ -0,0 +1,18 @@
# 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
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../../../static_assert boostorg/static_assert)
add_subdirectory(../../../config boostorg/config)
add_executable(main main.cpp)
target_link_libraries(main Boost::static_assert)
enable_testing()
add_test(NAME main COMMAND main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@ -0,0 +1,7 @@
#include <boost/static_assert.hpp>
int main()
{
int const x = 5;
BOOST_STATIC_ASSERT( x > 4 );
}