mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Travis-CI additions:
* Address sanitizer target * Code coverage target * Results for codecov.io
This commit is contained in:
committed by
Vinnie Falco
parent
d6903efc0c
commit
3af4cf0a28
@@ -1,9 +1,83 @@
|
||||
#!/bin/bash -u
|
||||
# We use set -e and bash with -u to bail on first non zero exit code of any
|
||||
# processes launched or upon any unbound variable
|
||||
set -e
|
||||
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
shopt -s globstar
|
||||
set -ex
|
||||
|
||||
################################## ENVIRONMENT #################################
|
||||
|
||||
export PATH=$VALGRIND_ROOT/bin:$LCOV_ROOT/usr/bin:$PATH
|
||||
|
||||
echo "using toolset: $CC"
|
||||
echo "using variant: $VARIANT"
|
||||
echo "using address-model: $ADDRESS_MODEL"
|
||||
echo "using PATH: $PATH"
|
||||
|
||||
$BOOST_ROOT/bjam toolset=$CC variant=$VARIANT
|
||||
#################################### HELPERS ###################################
|
||||
|
||||
function run_tests_with_gdb {
|
||||
for x in bin/**/*-tests; do scripts/run-with-gdb.sh "$x"; done
|
||||
}
|
||||
|
||||
function build_beast {
|
||||
$BOOST_ROOT/bjam toolset=$CC \
|
||||
variant=$VARIANT \
|
||||
address-model=$ADDRESS_MODEL
|
||||
}
|
||||
|
||||
##################################### BUILD ####################################
|
||||
|
||||
build_beast
|
||||
|
||||
##################################### TESTS ####################################
|
||||
|
||||
if [[ $VARIANT == "coverage" ]]; then
|
||||
find . -name "*.gcda" | xargs rm -f
|
||||
rm *.info -f
|
||||
# Create baseline coverage data file
|
||||
lcov --no-external -c -i -d . -o baseline.info > /dev/null
|
||||
|
||||
# Perform test
|
||||
run_tests_with_gdb
|
||||
|
||||
# Run autobahn tests
|
||||
export SERVER=`find . -name "websocket-echo"`
|
||||
nohup scripts/run-with-gdb.sh $SERVER&
|
||||
|
||||
# We need to wait a while so wstest can connect!
|
||||
sleep 5
|
||||
# cd scripts && wstest -m fuzzingclient
|
||||
# cd ..
|
||||
# Show the output
|
||||
cat nohup.out
|
||||
rm nohup.out
|
||||
jobs
|
||||
# Kill it gracefully
|
||||
kill -INT %1
|
||||
sleep 1
|
||||
kill -INT %1 || echo "Dead already"
|
||||
|
||||
# Create test coverage data file
|
||||
lcov --no-external -c -d . -o testrun.info > /dev/null
|
||||
|
||||
# Combine baseline and test coverage data
|
||||
lcov -a baseline.info -a testrun.info -o lcov-all.info > /dev/null
|
||||
|
||||
# Extract only include/beast, and don\'t report on examples/test
|
||||
lcov -e "lcov-all.info" "*/include/beast/*" -o lcov.info > /dev/null
|
||||
|
||||
~/.local/bin/codecov -X gcov
|
||||
else
|
||||
# TODO: make a function
|
||||
run_tests_with_gdb
|
||||
|
||||
if [[ $VARIANT == "debug" ]]; then
|
||||
for x in bin/**/*-tests; do
|
||||
# if [[ $x != "bench-tests" ]]; then
|
||||
valgrind --error-exitcode=1 "$x"
|
||||
## declare -i RESULT=$RESULT + $?
|
||||
# fi
|
||||
done
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user