forked from boostorg/core
Merge branch 'develop' into feature/bit
This commit is contained in:
52
.github/workflows/ci.yml
vendored
52
.github/workflows/ci.yml
vendored
@@ -383,6 +383,7 @@ jobs:
|
|||||||
BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null)
|
BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null)
|
||||||
echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV
|
echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV
|
||||||
echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV
|
echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV
|
||||||
|
DEPINST_ARGS=()
|
||||||
GIT_VERSION="$(git --version | sed -e 's/git version //')"
|
GIT_VERSION="$(git --version | sed -e 's/git version //')"
|
||||||
GIT_HAS_JOBS=1
|
GIT_HAS_JOBS=1
|
||||||
if [ -f "/etc/debian_version" ]
|
if [ -f "/etc/debian_version" ]
|
||||||
@@ -409,25 +410,16 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
if [ "$GIT_HAS_JOBS" -ne 0 ]
|
if [ "$GIT_HAS_JOBS" -ne 0 ]
|
||||||
then
|
then
|
||||||
GIT_ARGS="--jobs $GIT_FETCH_JOBS"
|
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
|
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
|
||||||
cd boost-root
|
cd boost-root
|
||||||
mkdir -p libs/$LIBRARY
|
mkdir -p libs/$LIBRARY
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule init tools/boost_install
|
git submodule update --init tools/boostdep
|
||||||
git submodule init libs/headers
|
DEPINST_ARGS+=("$LIBRARY")
|
||||||
git submodule init tools/build
|
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
|
||||||
git submodule init tools/cmake
|
|
||||||
git submodule init libs/assert
|
|
||||||
git submodule init libs/config
|
|
||||||
git submodule init libs/static_assert
|
|
||||||
git submodule init libs/throw_exception
|
|
||||||
git submodule init libs/type_traits
|
|
||||||
git submodule init libs/utility
|
|
||||||
git submodule init libs/io
|
|
||||||
git submodule update $GIT_ARGS
|
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./b2 headers
|
./b2 headers
|
||||||
if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ]
|
if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ]
|
||||||
@@ -519,18 +511,8 @@ jobs:
|
|||||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
cd boost-root
|
cd boost-root
|
||||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||||
git submodule init tools/boost_install
|
git submodule update --init tools/boostdep
|
||||||
git submodule init libs/headers
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
|
||||||
git submodule init tools/build
|
|
||||||
git submodule init tools/cmake
|
|
||||||
git submodule init libs/assert
|
|
||||||
git submodule init libs/config
|
|
||||||
git submodule init libs/static_assert
|
|
||||||
git submodule init libs/throw_exception
|
|
||||||
git submodule init libs/type_traits
|
|
||||||
git submodule init libs/utility
|
|
||||||
git submodule init libs/io
|
|
||||||
git submodule update --jobs %GIT_FETCH_JOBS%
|
|
||||||
cmd /c bootstrap
|
cmd /c bootstrap
|
||||||
b2 -d0 headers
|
b2 -d0 headers
|
||||||
|
|
||||||
@@ -569,21 +551,21 @@ jobs:
|
|||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
REF=${REF#refs/heads/}
|
REF=${REF#refs/heads/}
|
||||||
echo REF: $REF
|
echo REF: $REF
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
cd ..
|
cd ..
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
cd boost-root
|
cd boost-root
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule update --init tools/boostdep
|
git submodule update --init tools/boostdep
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
|
||||||
|
|
||||||
- name: Use library with add_subdirectory
|
- name: Use library with add_subdirectory
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
|
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
|
||||||
mkdir __build__ && cd __build__
|
mkdir __build__ && cd __build__
|
||||||
cmake ..
|
cmake ..
|
||||||
cmake --build .
|
cmake --build . -- -j $BUILD_JOBS
|
||||||
ctest --output-on-failure --no-tests=error
|
ctest --output-on-failure --no-tests=error
|
||||||
|
|
||||||
posix-cmake-install:
|
posix-cmake-install:
|
||||||
@@ -615,14 +597,14 @@ jobs:
|
|||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
REF=${REF#refs/heads/}
|
REF=${REF#refs/heads/}
|
||||||
echo REF: $REF
|
echo REF: $REF
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
cd ..
|
cd ..
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
cd boost-root
|
cd boost-root
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule update --init tools/boostdep
|
git submodule update --init tools/boostdep
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
@@ -633,13 +615,13 @@ jobs:
|
|||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root/__build__
|
cd ../boost-root/__build__
|
||||||
cmake --build . --target install
|
cmake --build . --target install -- -j $BUILD_JOBS
|
||||||
|
|
||||||
- name: Use the installed library
|
- name: Use the installed library
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
|
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
cmake --build .
|
cmake --build . -- -j $BUILD_JOBS
|
||||||
ctest --output-on-failure --no-tests=error
|
ctest --output-on-failure --no-tests=error
|
||||||
|
|
||||||
posix-cmake-test:
|
posix-cmake-test:
|
||||||
@@ -671,14 +653,14 @@ jobs:
|
|||||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
REF=${REF#refs/heads/}
|
REF=${REF#refs/heads/}
|
||||||
echo REF: $REF
|
echo REF: $REF
|
||||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
|
||||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
cd ..
|
cd ..
|
||||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
cd boost-root
|
cd boost-root
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule update --init tools/boostdep
|
git submodule update --init tools/boostdep
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
@@ -689,7 +671,7 @@ jobs:
|
|||||||
- name: Build tests
|
- name: Build tests
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root/__build__
|
cd ../boost-root/__build__
|
||||||
cmake --build . --target tests
|
cmake --build . --target tests -- -j $BUILD_JOBS
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
15
appveyor.yml
15
appveyor.yml
@@ -60,24 +60,15 @@ environment:
|
|||||||
CXXSTD: 03,11,14,1z
|
CXXSTD: 03,11,14,1z
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- set GIT_FETCH_JOBS=8
|
||||||
- set BOOST_BRANCH=develop
|
- set BOOST_BRANCH=develop
|
||||||
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
|
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone -b %BOOST_BRANCH% https://github.com/boostorg/boost.git boost-root
|
- git clone -b %BOOST_BRANCH% https://github.com/boostorg/boost.git boost-root
|
||||||
- cd boost-root
|
- cd boost-root
|
||||||
- git submodule init libs/headers
|
- git submodule update --init tools/boostdep
|
||||||
- git submodule init libs/assert
|
|
||||||
- git submodule init libs/config
|
|
||||||
- git submodule init libs/predef
|
|
||||||
- git submodule init libs/static_assert
|
|
||||||
- git submodule init libs/throw_exception
|
|
||||||
- git submodule init libs/type_traits
|
|
||||||
- git submodule init libs/utility
|
|
||||||
- git submodule init libs/io
|
|
||||||
- git submodule init tools/build
|
|
||||||
- git submodule init tools/boost_install
|
|
||||||
- git submodule update --jobs 4
|
|
||||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core\
|
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core\
|
||||||
|
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" core
|
||||||
- cmd /c bootstrap
|
- cmd /c bootstrap
|
||||||
- b2 headers
|
- b2 headers
|
||||||
|
|
||||||
|
@@ -36,7 +36,8 @@ struct fclose_deleter
|
|||||||
*/
|
*/
|
||||||
void operator() (std::FILE* p) const BOOST_NOEXCEPT
|
void operator() (std::FILE* p) const BOOST_NOEXCEPT
|
||||||
{
|
{
|
||||||
std::fclose(p);
|
if (BOOST_LIKELY(!!p))
|
||||||
|
std::fclose(p);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -27,6 +27,10 @@ set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::utility)
|
|||||||
|
|
||||||
boost_test(TYPE run SOURCES sv_conversion_test2.cpp)
|
boost_test(TYPE run SOURCES sv_conversion_test2.cpp)
|
||||||
|
|
||||||
|
set(BOOST_TEST_LINK_LIBRARIES Boost::core Boost::config Boost::move Boost::smart_ptr)
|
||||||
|
|
||||||
|
boost_test(TYPE run SOURCES fclose_deleter_test.cpp)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(swap)
|
add_subdirectory(swap)
|
||||||
|
@@ -176,7 +176,7 @@ run demangle_test.cpp
|
|||||||
run demangled_name_test.cpp
|
run demangled_name_test.cpp
|
||||||
: : : <test-info>always_show_run_output ;
|
: : : <test-info>always_show_run_output ;
|
||||||
|
|
||||||
run demangled_name_test.cpp : : : <rtti>off <test-info>always_show_run_output : demangled_name_test_no_rtti ;
|
run demangled_name_test.cpp : : : <rtti>off <test-info>always_show_run_output : demangled_name_test_no_rtti ;
|
||||||
|
|
||||||
run scoped_enum.cpp ;
|
run scoped_enum.cpp ;
|
||||||
compile-fail scoped_enum_compile_fail_conv_from_int.cpp
|
compile-fail scoped_enum_compile_fail_conv_from_int.cpp
|
||||||
@@ -186,8 +186,7 @@ compile-fail scoped_enum_compile_fail_conv_to_int.cpp
|
|||||||
|
|
||||||
run underlying_type.cpp ;
|
run underlying_type.cpp ;
|
||||||
|
|
||||||
compile fclose_deleter_test.cpp
|
run fclose_deleter_test.cpp : : : <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE ;
|
||||||
: <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE ;
|
|
||||||
|
|
||||||
run pointer_traits_pointer_test.cpp ;
|
run pointer_traits_pointer_test.cpp ;
|
||||||
run pointer_traits_element_type_test.cpp ;
|
run pointer_traits_element_type_test.cpp ;
|
||||||
|
@@ -16,17 +16,29 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/move/unique_ptr.hpp>
|
||||||
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
boost::movelib::unique_ptr< std::FILE, boost::fclose_deleter > make_boost_unique_file(const char* filename)
|
||||||
|
{
|
||||||
|
return boost::movelib::unique_ptr< std::FILE, boost::fclose_deleter >(std::fopen(filename, "w"));
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr< std::FILE > make_boost_shared_file(const char* filename)
|
||||||
|
{
|
||||||
|
return boost::shared_ptr< std::FILE >(std::fopen(filename, "w"), boost::fclose_deleter());
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
std::unique_ptr< std::FILE, boost::fclose_deleter > make_unique_file(const char* filename)
|
std::unique_ptr< std::FILE, boost::fclose_deleter > make_std_unique_file(const char* filename)
|
||||||
{
|
{
|
||||||
return std::unique_ptr< std::FILE, boost::fclose_deleter >(std::fopen(filename, "w"));
|
return std::unique_ptr< std::FILE, boost::fclose_deleter >(std::fopen(filename, "w"));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr< std::FILE > make_shared_file(const char* filename)
|
std::shared_ptr< std::FILE > make_std_shared_file(const char* filename)
|
||||||
{
|
{
|
||||||
return std::shared_ptr< std::FILE >(std::fopen(filename, "w"), boost::fclose_deleter());
|
return std::shared_ptr< std::FILE >(std::fopen(filename, "w"), boost::fclose_deleter());
|
||||||
}
|
}
|
||||||
@@ -43,9 +55,18 @@ int main()
|
|||||||
file = NULL;
|
file = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
make_boost_unique_file(filename);
|
||||||
|
make_boost_shared_file(filename);
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
make_unique_file(filename);
|
make_std_unique_file(filename);
|
||||||
make_shared_file(filename);
|
make_std_shared_file(filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Test if the deleter can be called on a NULL pointer
|
||||||
|
boost::shared_ptr< std::FILE >(static_cast< std::FILE* >(NULL), boost::fclose_deleter());
|
||||||
|
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
std::shared_ptr< std::FILE >(static_cast< std::FILE* >(NULL), boost::fclose_deleter());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::remove(filename);
|
std::remove(filename);
|
||||||
|
Reference in New Issue
Block a user