]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/beast/tools/build-and-test.sh
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 [[ "${TRAVIS}" == "true" ]]; then
22 elif [[ $
(uname
-s) == "Linux" ]]; then
24 JOBS
=$
(lscpu
-p |
grep -v '^#' |
sort -u -t, -k 2,4 |
wc -l)
25 elif [[ $
(uname
) == "Darwin" ]]; then
27 JOBS
=$
(sysctl
-n hw.physicalcpu
)
35 if [[ $TRAVIS_OS_NAME == "osx" ]]; then
36 # -o runs after loading the binary
37 # -k runs after any crash
38 # We use a ghetto appromixation of --return-child-result, exiting with
43 -k 'thread backtrace all' \
44 -k 'script import os; os._exit(1)' \
50 --return-child-result \
51 -ex="set print thread-events off" \
53 -ex="thread apply all bt full" \
58 function valgrind_run
()
62 --max-stackframe=16000000 \
63 --suppressions=$BOOST_ROOT/libs
/beast
/tools
/valgrind.supp \
68 function run_tests_with_debugger
()
70 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
76 function run_tests_with_valgrind
()
78 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
86 find "$1" -name "$2" -print0 |
while read -d $
'\0' f
92 #-------------------------------------------------------------------------------
94 BIN_DIR
="$BOOST_ROOT/bin.v2/libs/beast/test"
95 LIB_DIR
="$BOOST_ROOT/libs/beast"
96 INC_DIR
="$BOOST_ROOT/boost/beast"
98 function build_bjam
()
100 if [[ $VARIANT == "coverage" ]] || \
101 [[ $VARIANT == "valgrind" ]] || \
102 [[ $VARIANT == "ubasan" ]]; then
104 cxxflags
=-std=c
++11 \
105 libs
/beast
/test
/beast
/core
//fat-tests \
106 libs
/beast
/test
/beast
/http
//fat-tests \
107 libs
/beast
/test
/beast
/websocket
//fat-tests \
108 libs
/beast
/test
/beast
/zlib
//fat-tests \
114 cxxflags
=-std=c
++11 \
115 libs
/beast
/test
//fat-tests \
125 if [[ $VARIANT == "coverage" ]]; then
126 # for lcov to work effectively, the paths and includes
127 # passed to the compiler should not contain "." or "..".
128 # (this runs in $BOOST_ROOT)
130 find "$BOOST_ROOT" -name "*.gcda" |
xargs rm -f
131 rm -f "$BOOST_ROOT/*.info"
132 lcov
--no-external -c -i -d "$BOOST_ROOT" -o baseline.info
> /dev
/null
133 run_tests
"$BIN_DIR" fat-tests
134 # https://bugs.launchpad.net/ubuntu/+source/lcov/+bug/1163758
135 lcov
--no-external -c -d "$BOOST_ROOT" -o testrun.info
> /dev
/null
2>&1
136 lcov
-a baseline.info
-a testrun.info
-o lcov-all.info
> /dev
/null
137 lcov
-e "lcov-all.info" "$INC_DIR/*" -o lcov.info
> /dev
/null
138 ~
/.local
/bin
/codecov
-X gcov
-f lcov.info
139 find "$BOOST_ROOT" -name "*.gcda" |
xargs rm -f
141 elif [[ $VARIANT == "valgrind" ]]; then
142 run_tests_with_valgrind
"$BIN_DIR" fat-tests
145 run_tests_with_debugger
"$BIN_DIR" fat-tests