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:
Damian Jarek
2018-11-20 17:11:22 -08:00
committed by Vinnie Falco
parent c18f3f0ef1
commit 9816d61f38
6 changed files with 29 additions and 2 deletions

View File

@@ -197,7 +197,7 @@ script:
- |-
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
- 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:
- cat nohup.out || echo "nohup.out already deleted"

16
Jamfile
View File

@@ -12,6 +12,7 @@ import feature ;
import boost ;
import modules ;
import testing ;
import ../../config/checks/config : requires ;
boost.use-project ;
@@ -69,6 +70,20 @@ variant ubasan
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
: requirements
<implicit-dependency>/boost//headers
@@ -77,6 +92,7 @@ project /boost/beast
<library>/boost/system//boost_system
<library>/boost/coroutine//boost_coroutine
<library>/boost/filesystem//boost_filesystem
<library>static_asio
<threading>multi
<runtime-link>shared
<debug-symbols>on

View File

@@ -22,6 +22,7 @@ project /boost/beast/test
]
<include>./extern
<define>BOOST_BEAST_ALLOW_DEPRECATED
<define>BOOST_ASIO_SEPARATE_COMPILATION
;
path-constant ZLIB_SOURCES :

1
test/asio.cpp Normal file
View File

@@ -0,0 +1 @@
#include <boost/asio/impl/src.hpp>

View File

@@ -17,7 +17,9 @@ if [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "develop" ]]; then
MAIN_BRANCH="1"
fi
if [[ "${TRAVIS}" == "true" ]]; then
if [[ "${BEAST_RETRY}" == "true" ]]; then
JOBS=1
elif [[ "${TRAVIS}" == "true" ]]; then
JOBS="2"
elif [[ $(uname -s) == "Linux" ]]; then
# Physical cores

7
tools/retry.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
for i in {1..3}
do
$1 "${@:2:99}" && break;
export BEAST_RETRY="true"
done