3 # add 'x' for command tracing
6 #-------------------------------------------------------------------------------
11 # For builds not triggered by a pull request TRAVIS_BRANCH is the name of the
12 # branch currently being built; whereas for builds triggered by a pull request
13 # it is the name of the branch targeted by the pull request (in many cases this
16 if [[ $TRAVIS_BRANCH == "master" ||
$TRAVIS_BRANCH == "develop" ]]; then
20 if [[ "${BEAST_RETRY}" == "true" ]]; then
22 elif [[ "${TRAVIS}" == "true" ]]; then
24 elif [[ $
(uname
-s) == "Linux" ]]; then
26 JOBS
=$
(lscpu
-p |
grep -v '^#' |
sort -u -t, -k 2,4 |
wc -l)
27 elif [[ $
(uname
) == "Darwin" ]]; then
29 JOBS
=$
(sysctl
-n hw.physicalcpu
)
37 if [[ $TRAVIS_OS_NAME == "osx" ]]; then
38 # -o runs after loading the binary
39 # -k runs after any crash
40 # We use a ghetto appromixation of --return-child-result, exiting with
45 -k 'thread backtrace all' \
46 -k 'script import os; os._exit(1)' \
52 --return-child-result \
53 -ex="set print thread-events off" \
55 -ex="thread apply all bt full" \
60 function valgrind_run
()
64 --max-stackframe=16000000 \
65 --suppressions=$BOOST_ROOT/libs
/beast
/tools
/valgrind.supp \
70 function run_tests_with_debugger
()
72 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
78 function run_tests_with_valgrind
()
80 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
88 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
94 #-------------------------------------------------------------------------------
96 BIN_DIR
="$BOOST_ROOT/bin.v2/libs/beast/test"
97 LIB_DIR
="$BOOST_ROOT/libs/beast"
98 INC_DIR
="$BOOST_ROOT/boost/beast"
100 function build_bjam
()
102 if [[ $VARIANT == "beast_coverage" ]] || \
103 [[ $VARIANT == "beast_valgrind" ]] || \
104 [[ $VARIANT == "beast_ubasan" ]]; then
106 define
=BOOST_COROUTINES_NO_DEPRECATION_WARNING
=1 \
108 libs
/beast
/test
/beast
/core
//fat-tests \
109 libs
/beast
/test
/beast
/http
//fat-tests \
110 libs
/beast
/test
/beast
/websocket
//fat-tests \
111 libs
/beast
/test
/beast
/zlib
//fat-tests \
116 elif [[ $VARIANT == "debug" ]]; then
118 define
=BOOST_COROUTINES_NO_DEPRECATION_WARNING
=1 \
120 libs
/beast
/test
//fat-tests \
127 define
=BOOST_COROUTINES_NO_DEPRECATION_WARNING
=1 \
129 libs
/beast
/test
//fat-tests \
138 if [[ $VARIANT == "beast_coverage" ]]; then
140 # for lcov to work effectively, the paths and includes
141 # passed to the compiler should not contain "." or "..".
142 # (this runs in $BOOST_ROOT)
144 find "$BOOST_ROOT" -name "*.gcda" |
xargs rm -f
145 rm -f "$BOOST_ROOT/*.info"
146 lcov
--gcov-tool $GCOV --no-external -c -i -d "$BOOST_ROOT" -o baseline.info
> /dev
/null
147 run_tests
"$BIN_DIR" fat-tests
148 # https://bugs.launchpad.net/ubuntu/+source/lcov/+bug/1163758
149 lcov
--gcov-tool $GCOV --no-external -c -d "$BOOST_ROOT" -o testrun-all.info
> /dev
/null
2>&1
150 lcov
--gcov-tool $GCOV -a baseline.info
-a testrun-all.info
-o lcov-diff.info
> /dev
/null
151 lcov
--gcov-tool $GCOV -e "lcov-diff.info" "$INC_DIR/*" -o lcov.info
> /dev
/null
152 lcov
--gcov-tool $GCOV --remove "lcov.info" "$INC_DIR/_experimental/*" -o lcov.info
> /dev
/null
153 echo "Change working directory for codecov:"
157 ~
/.local
/bin
/codecov
-X gcov
-f ..
/..
/lcov.info
159 find "$BOOST_ROOT" -name "*.gcda" |
xargs rm -f
161 elif [[ $VARIANT == "beast_valgrind" ]]; then
162 run_tests_with_valgrind
"$BIN_DIR" fat-tests
165 #run_tests_with_debugger "$BIN_DIR" fat-tests
166 run_tests
"$BIN_DIR" fat-tests