mirror of
https://github.com/boostorg/beast.git
synced 2025-08-04 07:14:32 +02:00
Improve compilation of tests for continuous integration:
fix #1293 * Build ASIO's non-template entities into a static library to reduce the compiler's memory usage during test compilation. * Retry as single-threaded build after the first build failure.
This commit is contained in:
committed by
Vinnie Falco
parent
c18f3f0ef1
commit
9816d61f38
@@ -197,7 +197,7 @@ script:
|
|||||||
- |-
|
- |-
|
||||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
||||||
- cd ../boost-root
|
- cd ../boost-root
|
||||||
- travis_retry libs/beast/tools/build-and-test.sh
|
- libs/beast/tools/retry.sh libs/beast/tools/build-and-test.sh
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- cat nohup.out || echo "nohup.out already deleted"
|
- cat nohup.out || echo "nohup.out already deleted"
|
||||||
|
16
Jamfile
16
Jamfile
@@ -12,6 +12,7 @@ import feature ;
|
|||||||
import boost ;
|
import boost ;
|
||||||
import modules ;
|
import modules ;
|
||||||
import testing ;
|
import testing ;
|
||||||
|
import ../../config/checks/config : requires ;
|
||||||
|
|
||||||
boost.use-project ;
|
boost.use-project ;
|
||||||
|
|
||||||
@@ -69,6 +70,20 @@ variant ubasan
|
|||||||
|
|
||||||
path-constant TEST_MAIN : include/boost/beast/_experimental/unit_test/main.cpp ;
|
path-constant TEST_MAIN : include/boost/beast/_experimental/unit_test/main.cpp ;
|
||||||
|
|
||||||
|
lib static_asio
|
||||||
|
: test/asio.cpp
|
||||||
|
: requirements
|
||||||
|
[ requires
|
||||||
|
cxx11_constexpr
|
||||||
|
cxx11_decltype
|
||||||
|
cxx11_hdr_tuple
|
||||||
|
cxx11_template_aliases
|
||||||
|
cxx11_variadic_templates
|
||||||
|
]
|
||||||
|
<define>BOOST_ASIO_SEPARATE_COMPILATION
|
||||||
|
<link>static
|
||||||
|
;
|
||||||
|
|
||||||
project /boost/beast
|
project /boost/beast
|
||||||
: requirements
|
: requirements
|
||||||
<implicit-dependency>/boost//headers
|
<implicit-dependency>/boost//headers
|
||||||
@@ -77,6 +92,7 @@ project /boost/beast
|
|||||||
<library>/boost/system//boost_system
|
<library>/boost/system//boost_system
|
||||||
<library>/boost/coroutine//boost_coroutine
|
<library>/boost/coroutine//boost_coroutine
|
||||||
<library>/boost/filesystem//boost_filesystem
|
<library>/boost/filesystem//boost_filesystem
|
||||||
|
<library>static_asio
|
||||||
<threading>multi
|
<threading>multi
|
||||||
<runtime-link>shared
|
<runtime-link>shared
|
||||||
<debug-symbols>on
|
<debug-symbols>on
|
||||||
|
@@ -22,6 +22,7 @@ project /boost/beast/test
|
|||||||
]
|
]
|
||||||
<include>./extern
|
<include>./extern
|
||||||
<define>BOOST_BEAST_ALLOW_DEPRECATED
|
<define>BOOST_BEAST_ALLOW_DEPRECATED
|
||||||
|
<define>BOOST_ASIO_SEPARATE_COMPILATION
|
||||||
;
|
;
|
||||||
|
|
||||||
path-constant ZLIB_SOURCES :
|
path-constant ZLIB_SOURCES :
|
||||||
|
1
test/asio.cpp
Normal file
1
test/asio.cpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include <boost/asio/impl/src.hpp>
|
@@ -17,7 +17,9 @@ if [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "develop" ]]; then
|
|||||||
MAIN_BRANCH="1"
|
MAIN_BRANCH="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${TRAVIS}" == "true" ]]; then
|
if [[ "${BEAST_RETRY}" == "true" ]]; then
|
||||||
|
JOBS=1
|
||||||
|
elif [[ "${TRAVIS}" == "true" ]]; then
|
||||||
JOBS="2"
|
JOBS="2"
|
||||||
elif [[ $(uname -s) == "Linux" ]]; then
|
elif [[ $(uname -s) == "Linux" ]]; then
|
||||||
# Physical cores
|
# Physical cores
|
||||||
|
7
tools/retry.sh
Executable file
7
tools/retry.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for i in {1..3}
|
||||||
|
do
|
||||||
|
$1 "${@:2:99}" && break;
|
||||||
|
export BEAST_RETRY="true"
|
||||||
|
done
|
Reference in New Issue
Block a user