mirror of
https://github.com/boostorg/static_assert.git
synced 2025-06-28 13:31:00 +02:00
Compare commits
27 Commits
boost-1.75
...
develop
Author | SHA1 | Date | |
---|---|---|---|
9a6a86efc8 | |||
82e8219497 | |||
b78ae8e44c | |||
4df5eb93a3 | |||
acbd163624 | |||
28277d9854 | |||
91ddf94f3c | |||
223997c70c | |||
e74f1d4f6e | |||
bccba72bff | |||
140907f843 | |||
aa4e60bd88 | |||
54412f7937 | |||
c65f0cd147 | |||
18ab3e9250 | |||
13690ce9b5 | |||
8df439fa03 | |||
9519349ab9 | |||
45eec41c29 | |||
a1abfec1ef | |||
ba72d3340f | |||
803b983da7 | |||
392199f6b1 | |||
482e81cddd | |||
6ec69e506c | |||
66db74297a | |||
e9ab97859d |
152
.github/workflows/ci.yml
vendored
Normal file
152
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
name: GitHub Actions CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- githubactions*
|
||||||
|
- feature/**
|
||||||
|
- fix/**
|
||||||
|
- pr/**
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cpp-matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Generate Test Matrix
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- name: Generate Test Matrix
|
||||||
|
uses: alandefreitas/cpp-actions/cpp-matrix@master
|
||||||
|
id: cpp-matrix
|
||||||
|
with:
|
||||||
|
extra-values: |
|
||||||
|
boost-lib: static_assert
|
||||||
|
scan-dirs: test
|
||||||
|
compilers: |
|
||||||
|
gcc >= 4.8
|
||||||
|
clang >= 3.5
|
||||||
|
msvc >= 14.0
|
||||||
|
apple-clang *
|
||||||
|
mingw *
|
||||||
|
clang-cl *
|
||||||
|
subrange-policy: |
|
||||||
|
msvc: one-per-minor
|
||||||
|
standards: ">=11"
|
||||||
|
latest-factors: |
|
||||||
|
gcc Asan TSan UBSan
|
||||||
|
clang BoundsSan IntSan
|
||||||
|
factors: |
|
||||||
|
gcc Shared
|
||||||
|
msvc Shared x86
|
||||||
|
mingw Shared
|
||||||
|
trace-commands: true
|
||||||
|
build:
|
||||||
|
needs: cpp-matrix
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJSON(needs.cpp-matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
# use matrix entries
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# GitHub Actions no longer support older containers.
|
||||||
|
# The workaround is to install our own Node.js for the actions.
|
||||||
|
- name: Patch Node
|
||||||
|
# The containers that need Node.js 20 will have volumes set up so that
|
||||||
|
# the Node.js 20 installation can go there.
|
||||||
|
if: ${{ matrix.container.volumes }}
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y curl xz-utils
|
||||||
|
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
|
||||||
|
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
|
||||||
|
ldd /__e/node20/bin/node
|
||||||
|
|
||||||
|
- name: Setup C++ Compiler
|
||||||
|
uses: alandefreitas/cpp-actions/setup-cpp@master
|
||||||
|
id: setup-cpp
|
||||||
|
with:
|
||||||
|
compiler: ${{ matrix.compiler }}
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
if: matrix.install != ''
|
||||||
|
uses: alandefreitas/cpp-actions/package-install@master
|
||||||
|
id: package-install
|
||||||
|
with:
|
||||||
|
apt-get: ${{ matrix.install }}
|
||||||
|
|
||||||
|
- name: Clone Library
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Clone Boost
|
||||||
|
uses: alandefreitas/cpp-actions/boost-clone@master
|
||||||
|
id: boost-clone
|
||||||
|
with:
|
||||||
|
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
|
||||||
|
boost-dir: ../boost-root
|
||||||
|
scan-modules-dir: .
|
||||||
|
scan-modules-ignore: ${{ matrix.boost-lib }}
|
||||||
|
modules-scan-paths: ${{ matrix.scan-dirs }}
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Copy Library
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
|
||||||
|
cd ../boost-root
|
||||||
|
rm -rf "libs/${{ matrix.boost-lib }}"
|
||||||
|
mkdir "libs/${{ matrix.boost-lib }}"
|
||||||
|
cp -r "$workspace_root"/* "libs/${{ matrix.boost-lib }}"
|
||||||
|
|
||||||
|
- name: B2 Workflow
|
||||||
|
uses: alandefreitas/cpp-actions/b2-workflow@master
|
||||||
|
with:
|
||||||
|
source-dir: ${{ steps.boost-clone.outputs.boost-dir }}
|
||||||
|
modules: ${{ matrix.boost-lib }}
|
||||||
|
toolset: ${{ matrix.b2-toolset }}
|
||||||
|
build-variant: ${{ matrix.build-type }}
|
||||||
|
cxx: ${{ steps.setup-cpp.outputs.cxx || '' }}
|
||||||
|
cxxstd: ${{ matrix.cxxstd }}
|
||||||
|
address-model: ${{ matrix.address-model }}
|
||||||
|
asan: ${{ matrix.asan }}
|
||||||
|
ubsan: ${{ matrix.ubsan }}
|
||||||
|
tsan: ${{ matrix.tsan }}
|
||||||
|
shared: ${{ matrix.shared }}
|
||||||
|
abbreviate-paths: false
|
||||||
|
hash: true
|
||||||
|
debug-configuration: true
|
||||||
|
trace-commands: true
|
||||||
|
|
||||||
|
- name: CMake Workflow
|
||||||
|
uses: alandefreitas/cpp-actions/cmake-workflow@master
|
||||||
|
with:
|
||||||
|
source-dir: ${{ steps.boost-clone.outputs.boost-dir }}/libs/${{ matrix.boost-lib }}
|
||||||
|
build-dir: _build_dir_
|
||||||
|
run-tests: ignore
|
||||||
|
install: true
|
||||||
|
cmake-version: ">=3.31"
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
generator-toolset: ${{ matrix.generator-toolset }}
|
||||||
|
toolchain: ${{ steps.package-install.outputs.vcpkg-toolchain }}
|
||||||
|
build-type: ${{ matrix.build-type }}
|
||||||
|
install-prefix: .local
|
||||||
|
cxxstd: ${{ matrix.cxxstd }}
|
||||||
|
cc: ${{ steps.setup-cpp.outputs.cc }}
|
||||||
|
ccflags: ${{ matrix.ccflags }}
|
||||||
|
cxx: ${{ steps.setup-cpp.outputs.cxx }}
|
||||||
|
cxxflags: ${{ matrix.cxxflags }}
|
||||||
|
shared: ${{ matrix.shared }}
|
||||||
|
extra-args:
|
||||||
|
"${{ ( !matrix.no-deps && format('-D BOOST_SRC_DIR=\"{0}\"', steps.boost-clone.outputs.boost-dir)\
|
||||||
|
\ ) || '' }} \n${{ ( matrix.no-deps && '-D CPP_ACTIONS_NO_DEPS=ON' ) || '' }}\n"
|
||||||
|
export-compile-commands: ${{ matrix.time-trace }}
|
||||||
|
trace-commands: true
|
@ -275,8 +275,9 @@ matrix:
|
|||||||
env: CMAKE=1
|
env: CMAKE=1
|
||||||
script:
|
script:
|
||||||
- mkdir __build__ && cd __build__
|
- mkdir __build__ && cd __build__
|
||||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=static_assert ..
|
- cmake -DBUILD_TESTING=ON -DBOOST_INCLUDE_LIBRARIES=static_assert ..
|
||||||
- ctest --output-on-failure -R boost_static_assert
|
- cmake --build . --target tests
|
||||||
|
- ctest --output-on-failure
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: CMAKE_SUBDIR=1
|
env: CMAKE_SUBDIR=1
|
||||||
@ -292,8 +293,9 @@ matrix:
|
|||||||
- os: linux
|
- os: linux
|
||||||
env: CMAKE_INSTALL=1
|
env: CMAKE_INSTALL=1
|
||||||
script:
|
script:
|
||||||
|
- pip install --user cmake
|
||||||
- mkdir __build__ && cd __build__
|
- mkdir __build__ && cd __build__
|
||||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES="static_assert;config" -DCMAKE_INSTALL_PREFIX=~/.local ..
|
- cmake -DBOOST_INCLUDE_LIBRARIES=static_assert -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
- cmake --build . --target install
|
- cmake --build . --target install
|
||||||
- cd ../libs/static_assert/test/cmake_install_test && mkdir __build__ && cd __build__
|
- cd ../libs/static_assert/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||||
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
|
@ -18,16 +18,6 @@ target_link_libraries(boost_static_assert
|
|||||||
Boost::config
|
Boost::config
|
||||||
)
|
)
|
||||||
|
|
||||||
# boost_install requires PROJECT_VERSION
|
|
||||||
# Without the superproject, we don't have any, so skip installation
|
|
||||||
|
|
||||||
if(BOOST_SUPERPROJECT_VERSION)
|
|
||||||
|
|
||||||
include(BoostInstall)
|
|
||||||
boost_install(TARGETS boost_static_assert HEADER_DIRECTORY include/)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BUILD_TESTING is the standard CTest variable that enables testing
|
# BUILD_TESTING is the standard CTest variable that enables testing
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
# copyright John Maddock 2003
|
|
||||||
# Use, modification and distribution are subject to 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 the rules for testing
|
|
||||||
import testing ;
|
|
||||||
|
|
||||||
build-project test ;
|
|
23
build.jam
Normal file
23
build.jam
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Copyright René Ferdinand Rivera Morell 2023-2024
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
require-b2 5.2 ;
|
||||||
|
|
||||||
|
constant boost_dependencies :
|
||||||
|
/boost/config//boost_config ;
|
||||||
|
|
||||||
|
project /boost/static_assert
|
||||||
|
: common-requirements
|
||||||
|
<include>include
|
||||||
|
;
|
||||||
|
|
||||||
|
explicit
|
||||||
|
[ alias boost_static_assert : : : : <library>$(boost_dependencies) ]
|
||||||
|
[ alias all : boost_static_assert example test ]
|
||||||
|
;
|
||||||
|
|
||||||
|
call-if : boost-library static_assert
|
||||||
|
;
|
||||||
|
|
@ -1,11 +1,15 @@
|
|||||||
# copyright John Maddock 2003
|
# copyright John Maddock 2003
|
||||||
# Use, modification and distribution are subject to the
|
# Use, modification and distribution are subject to the
|
||||||
# Boost Software License, Version 1.0. (See accompanying file
|
# Boost Software License, Version 1.0. (See accompanying file
|
||||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
# bring in the rules for testing
|
# bring in the rules for testing
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
|
project : requirements
|
||||||
|
<library>/boost/type_traits//boost_type_traits
|
||||||
|
;
|
||||||
|
|
||||||
#run static_assert_example_1.cpp ;
|
#run static_assert_example_1.cpp ;
|
||||||
run static_assert_example_2.cpp ;
|
run static_assert_example_2.cpp ;
|
||||||
run static_assert_example_3.cpp ;
|
run static_assert_example_3.cpp ;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
#include <cstddef> //for std::size_t
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
//
|
//
|
||||||
@ -81,7 +82,7 @@ template <bool x> struct STATIC_ASSERTION_FAILURE;
|
|||||||
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
|
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
|
||||||
|
|
||||||
// HP aCC cannot deal with missing names for template value parameters
|
// 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{};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,5 +12,6 @@
|
|||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"John Maddock <john -at- johnmaddock.co.uk>"
|
"John Maddock <john -at- johnmaddock.co.uk>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
# copyright John Maddock 2003
|
# copyright John Maddock 2003
|
||||||
# Use, modification and distribution are subject to the
|
# Use, modification and distribution are subject to the
|
||||||
# Boost Software License, Version 1.0. (See accompanying file
|
# Boost Software License, Version 1.0. (See accompanying file
|
||||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
# bring in the rules for testing
|
# bring in the rules for testing
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
|
project : requirements
|
||||||
|
<library>/boost/type_traits//boost_type_traits
|
||||||
|
;
|
||||||
|
|
||||||
run static_assert_test.cpp ;
|
run static_assert_test.cpp ;
|
||||||
compile-fail static_assert_test_fail_1.cpp ;
|
compile-fail static_assert_test_fail_1.cpp ;
|
||||||
compile-fail static_assert_test_fail_2.cpp ;
|
compile-fail static_assert_test_fail_2.cpp ;
|
||||||
|
Reference in New Issue
Block a user