mirror of
https://github.com/boostorg/exception.git
synced 2025-07-01 06:51:02 +02:00
Compare commits
15 Commits
boost-1.74
...
boost-1.76
Author | SHA1 | Date | |
---|---|---|---|
20c833978f | |||
e69635b1a7 | |||
7c29501d59 | |||
5abcc9fb50 | |||
18ace4a260 | |||
d133df008f | |||
fdf1fee658 | |||
c445901088 | |||
083cfbafa3 | |||
8be818bc44 | |||
6a32b36566 | |||
9bd0584aa9 | |||
0016f52fba | |||
7e8f0cd9bb | |||
330008445c |
59
.drone.star
Normal file
59
.drone.star
Normal file
@ -0,0 +1,59 @@
|
||||
# Use, modification, and distribution are
|
||||
# subject to the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE.txt)
|
||||
#
|
||||
# Copyright Rene Rivera 2020.
|
||||
|
||||
# For Drone CI we use the Starlark scripting language to reduce duplication.
|
||||
# As the yaml syntax for Drone CI is rather limited.
|
||||
#
|
||||
#
|
||||
globalenv={}
|
||||
linuxglobalimage="cppalliance/droneubuntu1404:1"
|
||||
windowsglobalimage="cppalliance/dronevs2019"
|
||||
|
||||
def main(ctx):
|
||||
return [
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 0", "clang++", packages="", buildtype="boost", xcode_version="11.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 1", "clang++", packages="", buildtype="boost", xcode_version="11.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 2", "clang++", packages="", buildtype="boost", xcode_version="11", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 3", "clang++", packages="", buildtype="boost", xcode_version="10.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 4", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 5", "clang++", packages="", buildtype="boost", xcode_version="10.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'ac3478d69a'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 6", "clang++", packages="", buildtype="boost", xcode_version="10", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'c1dfd96eea'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 7", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '902ba3cda1'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 8", "clang++", packages="", buildtype="boost", xcode_version="9.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'fe5dbbcea5'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 9", "clang++", packages="", buildtype="boost", xcode_version="9.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '0ade7c2cf9'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 10", "clang++", packages="", buildtype="boost", xcode_version="9.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b1d5781111'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 11", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 12", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
|
||||
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 13", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
|
||||
osx_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD Job 14", "clang++", packages="", buildtype="boost", environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': 'fa35e19212'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=98,03,11 Job 15", "g++-4.7", packages="g++-4.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': 'f1abd67035'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=98,03,11 Job 16", "g++-4.8", packages="g++-4.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '1574bddb75'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=98,03,11 Job 17", "g++-4.9", packages="g++-4.9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '0716d9708d'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=98,03,11,14 Job 18", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '9e6a55b6b4'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=98,03,11,14 Job 19", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=98,03,11,14 Job 20", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-8 CXXSTD=98,03,11,14 Job 21", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14 Job 22", "g++-9", packages="g++-9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': '12c6fc06c9'}, globalenv=globalenv),
|
||||
linux_cxx("UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=98, Job 23", "g++-9", packages="g++-9", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '98,03,11,14,17,2a', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'LINKFLAGS': '-fuse-ld=gold', 'DRONE_JOB_UUID': 'd435a6cdd7'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 24", "/usr/bin/clang++", packages="clang-3.3", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '4d134bc072'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 25", "/usr/bin/clang++", packages="clang-3.4", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': 'f6e1126ced'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 26", "clang++", packages="g++-4.9 g++-5 g++-6 clang-3.6 clang-3.7 clang-3.8 ruby-full ninja-build", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '887309d048'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=98, Job 27", "clang++", packages="clang-3.5 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'bc33ea4e26'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=98, Job 28", "clang++", packages="clang-3.6 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '0a57cb53ba'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=98, Job 29", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '7719a1c782'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=98, Job 30", "clang++-3.8", packages="clang-3.8 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '22d200f867'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=98, Job 31", "clang++-3.9", packages="clang-3.9 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '632667547e'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=98, Job 32", "clang++-4.0", packages="clang-4.0", llvm_os="trusty", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'cb4e5208b4'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=98, Job 33", "clang++-5.0", packages="clang-5.0", llvm_os="trusty", llvm_ver="5.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b6692ea5df'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=98, Job 34", "clang++-6.0", packages="clang-6.0", llvm_os="trusty", llvm_ver="6.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': 'f1f836cb4e'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-7 CXXSTD=98,03 Job 35", "clang++-7", packages="clang-7", llvm_os="trusty", llvm_ver="7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': '972a67c481'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03 Job 36", "clang++-8", packages="clang-8", llvm_os="trusty", llvm_ver="8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': 'fc074d5013'}, globalenv=globalenv),
|
||||
linux_cxx("TOOLSET=clang COMPILER=clang++-9 CXXSTD=98,03 Job 37", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1604:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': 'cb7a1d775e'}, globalenv=globalenv),
|
||||
linux_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXS Job 38", "clang++-8", packages="clang-8", llvm_os="trusty", llvm_ver="8", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '98,03,11,14,17,2a', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': '5b384ce32d'}, globalenv=globalenv),
|
||||
]
|
||||
|
||||
# from https://github.com/boostorg/boost-ci
|
||||
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
|
3
.drone/after-success.sh
Executable file
3
.drone/after-success.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
3
.drone/before-install.sh
Executable file
3
.drone/before-install.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
3
.drone/before-script.sh
Executable file
3
.drone/before-script.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
47
.drone/boost.sh
Executable file
47
.drone/boost.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
export TRAVIS_BUILD_DIR=$(pwd)
|
||||
export DRONE_BUILD_DIR=$(pwd)
|
||||
export TRAVIS_BRANCH=$DRONE_BRANCH
|
||||
export VCS_COMMIT_ID=$DRONE_COMMIT
|
||||
export GIT_COMMIT=$DRONE_COMMIT
|
||||
export REPO_NAME=$DRONE_REPO
|
||||
export PATH=~/.local/bin:/usr/local/bin:$PATH
|
||||
|
||||
echo '==================================> BEFORE_INSTALL'
|
||||
|
||||
. .drone/before-install.sh
|
||||
|
||||
echo '==================================> INSTALL'
|
||||
|
||||
gem install asciidoctor || echo "ERROR. Failed to install asciidoctor"
|
||||
gem install coderay || echo "ERROR. Failed to install coderay"
|
||||
cd ..
|
||||
git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
git submodule update --init tools/build
|
||||
git submodule update --init tools/inspect
|
||||
git submodule update --init libs/config
|
||||
git submodule update --init tools/boostdep
|
||||
rm -rf libs/exception
|
||||
mkdir libs/exception
|
||||
cp -r $TRAVIS_BUILD_DIR/* libs/exception
|
||||
python tools/boostdep/depinst/depinst.py exception
|
||||
./bootstrap.sh
|
||||
./b2 headers
|
||||
cd libs/exception
|
||||
|
||||
echo '==================================> BEFORE_SCRIPT'
|
||||
|
||||
. $DRONE_BUILD_DIR/.drone/before-script.sh
|
||||
|
||||
echo '==================================> SCRIPT'
|
||||
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
|
||||
echo '==================================> AFTER_SUCCESS'
|
||||
|
||||
. $DRONE_BUILD_DIR/.drone/after-success.sh
|
185
.github/workflows/ci.yml
vendored
Normal file
185
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- feature/**
|
||||
|
||||
env:
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
|
||||
jobs:
|
||||
posix:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- toolset: gcc-4.7
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-16.04
|
||||
install: g++-4.7
|
||||
- toolset: gcc-4.8
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-16.04
|
||||
install: g++-4.8
|
||||
- toolset: gcc-4.9
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-16.04
|
||||
install: g++-4.9
|
||||
- toolset: gcc-5
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-16.04
|
||||
- toolset: gcc-6
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-16.04
|
||||
install: g++-6
|
||||
- toolset: gcc-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
- toolset: gcc-8
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
- toolset: gcc-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
- toolset: gcc-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
- toolset: clang
|
||||
compiler: clang++-3.5
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-3.5
|
||||
- toolset: clang
|
||||
compiler: clang++-3.6
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-3.6
|
||||
- toolset: clang
|
||||
compiler: clang++-3.7
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-3.7
|
||||
- toolset: clang
|
||||
compiler: clang++-3.8
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-3.8
|
||||
- toolset: clang
|
||||
compiler: clang++-3.9
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-3.9
|
||||
- toolset: clang
|
||||
compiler: clang++-4.0
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-16.04
|
||||
install: clang-4.0
|
||||
- toolset: clang
|
||||
compiler: clang++-5.0
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-16.04
|
||||
install: clang-5.0
|
||||
- toolset: clang
|
||||
compiler: clang++-6.0
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
- toolset: clang
|
||||
compiler: clang++-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
install: clang-7
|
||||
- toolset: clang
|
||||
compiler: clang++-8
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-10.15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||
cd ..
|
||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
cp -r $GITHUB_WORKSPACE/* libs/exception
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" exception
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
- name: Create user-config.jam
|
||||
if: matrix.compiler
|
||||
run: |
|
||||
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd ../boost-root
|
||||
./b2 -j3 libs/exception/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release exception-handling=on,off rtti=on,off link=static,shared visibility=hidden,global
|
||||
|
||||
windows:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- toolset: msvc-14.1
|
||||
cxxstd: "14,17,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2016
|
||||
- toolset: msvc-14.2
|
||||
cxxstd: "14,17,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2019
|
||||
- toolset: gcc
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
addrmd: 64
|
||||
os: windows-2019
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
run: |
|
||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||
set BOOST_BRANCH=develop
|
||||
if "%GITHUB_BASE_REF%" == "master" set BOOST_BRANCH=master
|
||||
cd ..
|
||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\exception\
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" exception
|
||||
cmd /c bootstrap
|
||||
b2 -d0 headers
|
||||
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root
|
||||
b2 -j3 libs/exception/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release exception-handling=on,off rtti=on,off
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/.vscode/ipch/*
|
||||
/.vscode/settings.json
|
||||
.DS_Store
|
||||
|
@ -391,8 +391,8 @@ install:
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
- ../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
- ../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
- ../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
23
LICENSE_1_0.txt
Normal file
23
LICENSE_1_0.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
19
README.md
Normal file
19
README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Boost Exception
|
||||
|
||||
> Dynamic Exception Augmentation Library
|
||||
|
||||
## Documentation
|
||||
|
||||
https://boostorg.github.io/exception
|
||||
|
||||
## Support
|
||||
|
||||
* [cpplang on Slack](https://Cpplang.slack.com) (use the `#boost` channel)
|
||||
* [Boost Users Mailing List](https://lists.boost.org/mailman/listinfo.cgi/boost-users)
|
||||
* [Boost Developers Mailing List](https://lists.boost.org/mailman/listinfo.cgi/boost)
|
||||
|
||||
## Distribution
|
||||
|
||||
Boost Exception is included in official [Boost](https://www.boost.org/) releases.
|
||||
|
||||
Copyright (C) 2006-2021 Emil Dotchevski. Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).
|
@ -12,13 +12,14 @@
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
<a href="http://www.boost.org"><img style="border:0" src="boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- 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) -->
|
||||
<p><b style="color:red"><u>NOTE</u>:</b> When targeting C++11 or newer and Boost 1.75 or newer is available, it is recommended to use <a href="https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html">Boost LEAF</a> instead of Boost Exception. LEAF serves a similar purpose but it has a more elegant interface, it is more efficient, and works with or without exception handling -- yet understands Boost Exception error information for compatibility with legacy source code. This <a href="https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html#boost_exception">overview</a> explains the differences between the two APIs (Boost Exception is <u>not</u> deprecated and will continue to be supported, including C++03 compatibility).</p>
|
||||
<div class="RenoIncludeDIV"><h2>Introduction</h2>
|
||||
<p>The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.</p>
|
||||
<p>It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.</p>
|
||||
|
BIN
doc/boost.png
Normal file
BIN
doc/boost.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
@ -8,18 +8,18 @@
|
||||
#define BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
#error This header requires exception handling to be enabled.
|
||||
#endif
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/detail/clone_current_exception.hpp>
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
# include <boost/exception/detail/clone_current_exception.hpp>
|
||||
#endif
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#include <boost/core/demangle.hpp>
|
||||
#endif
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <stdexcept>
|
||||
#include <new>
|
||||
#include <ios>
|
||||
@ -41,15 +41,14 @@ namespace
|
||||
boost
|
||||
{
|
||||
class exception_ptr;
|
||||
BOOST_NORETURN void rethrow_exception( exception_ptr const & );
|
||||
exception_ptr current_exception();
|
||||
namespace exception_detail { void rethrow_exception_( exception_ptr const & ); }
|
||||
|
||||
class
|
||||
exception_ptr
|
||||
{
|
||||
typedef boost::shared_ptr<exception_detail::clone_base const> impl;
|
||||
impl ptr_;
|
||||
friend void rethrow_exception( exception_ptr const & );
|
||||
friend void exception_detail::rethrow_exception_( exception_ptr const & );
|
||||
typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const;
|
||||
public:
|
||||
exception_ptr()
|
||||
@ -76,20 +75,22 @@ boost
|
||||
}
|
||||
};
|
||||
|
||||
template <class E>
|
||||
inline
|
||||
exception_ptr
|
||||
copy_exception( E const & e )
|
||||
{
|
||||
E cp = e;
|
||||
exception_detail::copy_boost_exception(&cp, &e);
|
||||
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
exception_ptr
|
||||
copy_exception( T const & e )
|
||||
make_exception_ptr( T const & e )
|
||||
{
|
||||
try
|
||||
{
|
||||
throw enable_current_exception(e);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
return current_exception();
|
||||
}
|
||||
return boost::copy_exception(e);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_RTTI
|
||||
@ -103,6 +104,7 @@ boost
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
@ -496,34 +498,46 @@ boost
|
||||
BOOST_ASSERT(ret);
|
||||
return ret;
|
||||
}
|
||||
#endif // ifndef BOOST_NO_EXCEPTIONS
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
inline
|
||||
void
|
||||
rethrow_exception_( exception_ptr const & p )
|
||||
{
|
||||
BOOST_ASSERT(p);
|
||||
#if defined( BOOST_NO_CXX11_HDR_EXCEPTION ) || defined( BOOST_NO_EXCEPTIONS )
|
||||
p.ptr_->rethrow();
|
||||
#else
|
||||
try
|
||||
{
|
||||
p.ptr_->rethrow();
|
||||
}
|
||||
catch(
|
||||
std_exception_ptr_wrapper const & wrp)
|
||||
{
|
||||
// if an std::exception_ptr was wrapped above then rethrow it
|
||||
std::rethrow_exception(wrp.p);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_NORETURN
|
||||
inline
|
||||
void
|
||||
rethrow_exception( exception_ptr const & p )
|
||||
{
|
||||
BOOST_ASSERT(p);
|
||||
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
try
|
||||
{
|
||||
p.ptr_->rethrow();
|
||||
}
|
||||
catch(
|
||||
exception_detail::std_exception_ptr_wrapper const & wrp)
|
||||
{
|
||||
// if an std::exception_ptr was wrapped above then rethrow it
|
||||
std::rethrow_exception(wrp.p);
|
||||
}
|
||||
#else
|
||||
p.ptr_->rethrow();
|
||||
#endif
|
||||
exception_detail::rethrow_exception_(p);
|
||||
BOOST_ASSERT(0);
|
||||
#if defined(UNDER_CE)
|
||||
// some CE platforms don't define ::abort()
|
||||
exit(-1);
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
#if defined(UNDER_CE)
|
||||
// some CE platforms don't define ::abort()
|
||||
exit(-1);
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline
|
||||
@ -531,6 +545,9 @@ boost
|
||||
diagnostic_information( exception_ptr const & p, bool verbose=true )
|
||||
{
|
||||
if( p )
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
return "<unavailable> due to BOOST_NO_EXCEPTIONS";
|
||||
#else
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
@ -540,6 +557,7 @@ boost
|
||||
{
|
||||
return current_exception_diagnostic_information(verbose);
|
||||
}
|
||||
#endif
|
||||
return "<empty>";
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <boost/core/demangle.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
||||
#if __GNUC__*100+__GNUC_MINOR__>301
|
||||
@ -69,7 +70,7 @@ boost
|
||||
bool
|
||||
operator<( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return 0!=(a.type_->before(*b.type_));
|
||||
return a.type_!=b.type_ && strcmp(a.type_->name(), b.type_->name()) < 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -86,9 +86,6 @@ boost
|
||||
if( info_.end()!=i )
|
||||
{
|
||||
shared_ptr<error_info_base> const & p = i->second;
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
return shared_ptr<error_info_base>();
|
||||
|
@ -11,5 +11,6 @@
|
||||
],
|
||||
"maintainers": [
|
||||
"Emil Dotchevski <emil -at- revergestudios.com>"
|
||||
]
|
||||
],
|
||||
"cxxstd": "03"
|
||||
}
|
||||
|
@ -3,11 +3,15 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
int
|
||||
|
@ -3,7 +3,12 @@
|
||||
//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)
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling disabled.
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -4,6 +4,13 @@
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#define BOOST_EXCEPTION_DISABLE
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
|
@ -3,8 +3,14 @@
|
||||
//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)
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#define BOOST_EXCEPTION_DISABLE
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling disabled.
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -7,12 +7,6 @@
|
||||
|
||||
import testing ;
|
||||
|
||||
project
|
||||
: requirements
|
||||
<link>static
|
||||
<exception-handling>on
|
||||
;
|
||||
|
||||
#to_string
|
||||
|
||||
run is_output_streamable_test.cpp ;
|
||||
@ -23,29 +17,33 @@ compile-fail to_string_fail.cpp ;
|
||||
|
||||
#exception
|
||||
|
||||
run 1-throw_exception_test.cpp ;
|
||||
run 2-throw_exception_no_exceptions_test.cpp ;
|
||||
run 3-throw_exception_no_integration_test.cpp ;
|
||||
run 4-throw_exception_no_both_test.cpp ;
|
||||
run cloning_test.cpp ;
|
||||
run copy_exception_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
|
||||
run unknown_exception_test.cpp ;
|
||||
run exception_test.cpp ;
|
||||
run enable_error_info_test.cpp helper1.cpp ;
|
||||
run throw_exception_test.cpp helper2.cpp ;
|
||||
run errno_test.cpp ;
|
||||
run error_info_basic_test.cpp ;
|
||||
run error_info_lv_test.cpp ;
|
||||
run error_info_lv_const_test.cpp ;
|
||||
run error_info_rv_test.cpp ;
|
||||
run error_info_rv_const_test.cpp ;
|
||||
run diagnostic_information_test.cpp ;
|
||||
run 1-throw_exception_test.cpp : : : <exception-handling>on ;
|
||||
run 2-throw_exception_no_exceptions_test.cpp : : : <exception-handling>off ;
|
||||
run 3-throw_exception_no_integration_test.cpp : : : <exception-handling>on ;
|
||||
run 4-throw_exception_no_both_test.cpp : : : <exception-handling>off ;
|
||||
run cloning_test.cpp : : : <exception-handling>on ;
|
||||
run copy_exception_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi <exception-handling>on ;
|
||||
run copy_exception_no_exceptions_test.cpp : : : <exception-handling>off <rtti>on ;
|
||||
run unknown_exception_test.cpp : : : <exception-handling>on ;
|
||||
run exception_test.cpp : : : <exception-handling>on ;
|
||||
run enable_error_info_test.cpp helper1.cpp : : : <exception-handling>on ;
|
||||
run throw_exception_test.cpp helper2.cpp : : : <exception-handling>on ;
|
||||
run errno_test.cpp : : : <exception-handling>on ;
|
||||
run error_info_basic_test.cpp : : : <exception-handling>on ;
|
||||
run error_info_lv_test.cpp : : : <exception-handling>on ;
|
||||
run error_info_lv_const_test.cpp : : : <exception-handling>on ;
|
||||
run error_info_rv_test.cpp : : : <exception-handling>on ;
|
||||
run error_info_rv_const_test.cpp : : : <exception-handling>on ;
|
||||
run diagnostic_information_test.cpp : : : <exception-handling>on ;
|
||||
run refcount_ptr_test.cpp ;
|
||||
run current_exception_cast_test.cpp ;
|
||||
run current_exception_cast_test.cpp : : : <exception-handling>on ;
|
||||
run no_exceptions_test.cpp : : : <exception-handling>off ;
|
||||
run errinfos_test.cpp ;
|
||||
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR ../../thread/src/tss_null.cpp /boost/exception /boost//thread : : : <threading>multi : non_intrusive_exception_ptr_test ;
|
||||
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
|
||||
run errinfos_test.cpp : : : <exception-handling>on ;
|
||||
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR ../../thread/src/tss_null.cpp /boost/exception /boost//thread : : : <threading>multi <exception-handling>on : non_intrusive_exception_ptr_test ;
|
||||
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi <exception-handling>on ;
|
||||
|
||||
lib visibility_test_lib : visibility_test_lib.cpp : <visibility>hidden <exception-handling>on ;
|
||||
run visibility_test.cpp visibility_test_lib/<link>shared : : : <visibility>hidden <exception-handling>on ;
|
||||
|
||||
compile-fail exception_fail.cpp ;
|
||||
compile-fail throw_exception_fail.cpp ;
|
||||
@ -71,5 +69,3 @@ compile errinfo_file_name_hpp_test.cpp ;
|
||||
compile errinfo_file_open_mode_hpp_test.cpp ;
|
||||
compile errinfo_nested_exception_hpp_test.cpp ;
|
||||
compile errinfo_type_info_name_hpp_test.cpp ;
|
||||
|
||||
compile bug_11874_test.cpp ;
|
||||
|
@ -1,10 +0,0 @@
|
||||
//Copyright (c) 2006-2017 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//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 <boost/thread.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/errinfo_nested_exception.hpp>
|
||||
@ -423,7 +429,9 @@ main()
|
||||
test_std_exception_what<std::range_error>();
|
||||
test_std_exception_what<std::overflow_error>();
|
||||
test_std_exception_what<std::underflow_error>();
|
||||
#if !defined(_GLIBCXX_USE_CXX11_ABI) || !_GLIBCXX_USE_CXX11_ABI
|
||||
test_std_exception_what<std::ios_base::failure>();
|
||||
#endif
|
||||
test_std_exception_what<std::runtime_error>();
|
||||
test_std_exception<std::bad_alloc>();
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
|
93
test/copy_exception_no_exceptions_test.cpp
Normal file
93
test/copy_exception_no_exceptions_test.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//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)
|
||||
|
||||
#define BOOST_NORETURN
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling disabled.
|
||||
#endif
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
typedef boost::error_info<struct tag_answer,int> answer;
|
||||
|
||||
int exc_count;
|
||||
|
||||
struct
|
||||
err:
|
||||
virtual boost::exception,
|
||||
virtual std::exception
|
||||
{
|
||||
err()
|
||||
{
|
||||
++exc_count;
|
||||
}
|
||||
|
||||
err( err const & )
|
||||
{
|
||||
++exc_count;
|
||||
}
|
||||
|
||||
virtual
|
||||
~err() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
--exc_count;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
err & operator=( err const & );
|
||||
};
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
bool throw_exception_called;
|
||||
}
|
||||
|
||||
// It is not valid to return to the caller but we do for testing purposes.
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
void
|
||||
throw_exception( std::exception const & e )
|
||||
{
|
||||
throw_exception_called = true;
|
||||
BOOST_TEST(dynamic_cast<err const *>(&e)!=0);
|
||||
int const * ans=boost::get_error_info<answer>(e);
|
||||
BOOST_TEST(ans && *ans==42);
|
||||
}
|
||||
|
||||
struct source_location;
|
||||
void
|
||||
throw_exception( std::exception const & e, boost::source_location const & )
|
||||
{
|
||||
throw_exception_called = true;
|
||||
BOOST_TEST(dynamic_cast<err const *>(&e)!=0);
|
||||
int const * ans=boost::get_error_info<answer>(e);
|
||||
BOOST_TEST(ans && *ans==42);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
simple_test()
|
||||
{
|
||||
boost::exception_ptr p = boost::copy_exception(err() << answer(42));
|
||||
throw_exception_called = false;
|
||||
boost::exception_detail::rethrow_exception_(p);
|
||||
BOOST_TEST(throw_exception_called);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
BOOST_TEST(++exc_count==1);
|
||||
simple_test();
|
||||
BOOST_TEST(!--exc_count);
|
||||
return boost::report_errors();
|
||||
}
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
@ -11,6 +17,8 @@
|
||||
|
||||
typedef boost::error_info<struct tag_answer,int> answer;
|
||||
|
||||
int const thread_count = 100;
|
||||
|
||||
boost::detail::atomic_count exc_count(0);
|
||||
|
||||
struct
|
||||
@ -39,20 +47,21 @@ err:
|
||||
err & operator=( err const & );
|
||||
};
|
||||
|
||||
|
||||
class
|
||||
future
|
||||
{
|
||||
public:
|
||||
|
||||
future ():
|
||||
ready_ (false)
|
||||
future():
|
||||
ready_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
set_exception( boost::exception_ptr const & e )
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lck (mux_);
|
||||
boost::unique_lock<boost::mutex> lck(mux_);
|
||||
exc_ = e;
|
||||
ready_ = true;
|
||||
cond_.notify_all();
|
||||
@ -61,10 +70,10 @@ future
|
||||
void
|
||||
get_exception() const
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lck (mux_);
|
||||
while (! ready_)
|
||||
cond_.wait (lck);
|
||||
rethrow_exception (exc_);
|
||||
boost::unique_lock<boost::mutex> lck(mux_);
|
||||
while( !ready_ )
|
||||
cond_.wait(lck);
|
||||
rethrow_exception(exc_);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -78,17 +87,17 @@ future
|
||||
void
|
||||
producer( future & f )
|
||||
{
|
||||
f.set_exception (boost::copy_exception (err () << answer(42)));
|
||||
f.set_exception(boost::copy_exception(err() << answer(42)));
|
||||
}
|
||||
|
||||
void
|
||||
consumer()
|
||||
{
|
||||
future f;
|
||||
boost::thread thr (boost::bind (&producer, boost::ref (f)));
|
||||
boost::thread thr(boost::bind(&producer, boost::ref(f)));
|
||||
try
|
||||
{
|
||||
f.get_exception ();
|
||||
f.get_exception();
|
||||
}
|
||||
catch(
|
||||
err & e )
|
||||
@ -102,7 +111,7 @@ consumer()
|
||||
void
|
||||
consume()
|
||||
{
|
||||
for( int i=0; i!=100; ++i )
|
||||
for( int i=0; i!=thread_count; ++i )
|
||||
consumer();
|
||||
}
|
||||
|
||||
@ -110,15 +119,15 @@ void
|
||||
thread_test()
|
||||
{
|
||||
boost::thread_group grp;
|
||||
for( int i=0; i!=50; ++i )
|
||||
for( int i=0; i!=thread_count; ++i )
|
||||
grp.create_thread(&consume);
|
||||
grp.join_all ();
|
||||
grp.join_all();
|
||||
}
|
||||
|
||||
void
|
||||
simple_test()
|
||||
{
|
||||
boost::exception_ptr p = boost::copy_exception(err());
|
||||
boost::exception_ptr p = boost::copy_exception(err() << answer(42));
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <exception>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include "helper1.hpp"
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/errinfo_api_function.hpp>
|
||||
#include <boost/exception/errinfo_at_line.hpp>
|
||||
#include <boost/exception/errinfo_errno.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/error_info.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info_tuple.hpp>
|
||||
#include <boost/exception_ptr.hpp>
|
||||
@ -146,7 +152,7 @@ throw_catch_add_file_name( char const * name )
|
||||
{
|
||||
add_info(x,test_5(std::string(name)));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include "helper2.hpp"
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
|
@ -3,8 +3,12 @@
|
||||
//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)
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling disabled.
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include "helper2.hpp"
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
@ -40,7 +46,7 @@ boost_throw_exception_test()
|
||||
int const * line=boost::get_error_info<boost::throw_line>(x);
|
||||
BOOST_TEST( file && *file );
|
||||
BOOST_TEST( function && *function );
|
||||
BOOST_TEST( line && *line==32 );
|
||||
BOOST_TEST( line && *line==38 );
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
@ -61,7 +67,7 @@ boost_throw_exception_test()
|
||||
int const * data=boost::get_error_info<test_data>(x);
|
||||
BOOST_TEST( file && *file );
|
||||
BOOST_TEST( function && *function );
|
||||
BOOST_TEST( line && *line==52 );
|
||||
BOOST_TEST( line && *line==58 );
|
||||
BOOST_TEST( data && *data==42 );
|
||||
}
|
||||
catch(
|
||||
|
@ -3,6 +3,12 @@
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
|
32
test/visibility_test.cpp
Normal file
32
test/visibility_test.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//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 <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_EXCEPTIONS )
|
||||
# error This program requires exception handling.
|
||||
#endif
|
||||
|
||||
#include "visibility_test_lib.hpp"
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
void BOOST_SYMBOL_IMPORT hidden_throw();
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
hidden_throw();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
my_exception & e )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<my_info>(e) && *boost::get_error_info<my_info>(e)==42);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
9
test/visibility_test_lib.cpp
Normal file
9
test/visibility_test_lib.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "visibility_test_lib.hpp"
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
void
|
||||
BOOST_SYMBOL_EXPORT
|
||||
hidden_throw()
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(my_exception() << my_info(42));
|
||||
}
|
15
test/visibility_test_lib.hpp
Normal file
15
test/visibility_test_lib.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef HIDDEN_HPP_INCLUDED
|
||||
#define HIDDEN_HPP_INCLUDED
|
||||
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//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 <boost/exception/info.hpp>
|
||||
|
||||
typedef boost::error_info<struct my_info_, int> my_info;
|
||||
|
||||
struct BOOST_SYMBOL_VISIBLE my_exception: virtual std::exception, virtual boost::exception { };
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user