mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +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
|
||||
|
||||
14
scripts/fuzzingclient.json
Normal file
14
scripts/fuzzingclient.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"outdir": "./autoresults",
|
||||
"servers": [
|
||||
{
|
||||
"url": "ws://127.0.0.1:6000"
|
||||
},
|
||||
{
|
||||
"url": "ws://127.0.0.1:6001"
|
||||
}
|
||||
],
|
||||
"cases": ["*"],
|
||||
"exclude-cases": [],
|
||||
"exclude-agent-cases": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash -u
|
||||
# Assumptions:
|
||||
# 1) BOOST_ROOT and BOOST_URL are already defined,
|
||||
# and contain valid values.
|
||||
@@ -13,7 +13,10 @@ then
|
||||
cd `dirname $BOOST_ROOT`
|
||||
rm -fr ${BOOST_ROOT}
|
||||
tar xzf /tmp/boost.tar.gz
|
||||
params="define=_GLIBCXX_USE_CXX11_ABI=0 --with-program_options --with-system"
|
||||
|
||||
params="define=_GLIBCXX_USE_CXX11_ABI=0 \
|
||||
address-model=$ADDRESS_MODEL --with-program_options \
|
||||
--with-system --with-coroutine --with-filesystem"
|
||||
cd $BOOST_ROOT && \
|
||||
./bootstrap.sh --prefix=$BOOST_ROOT && \
|
||||
./b2 -d1 $params && \
|
||||
|
||||
@@ -14,7 +14,8 @@ do
|
||||
test -x $( type -p ${c}-$CLANG_VER )
|
||||
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c}
|
||||
done
|
||||
export PATH=$PWD/bin:$PATH
|
||||
# NOTE, changed from PWD -> HOME
|
||||
export PATH=$HOME/bin:$PATH
|
||||
|
||||
# What versions are we ACTUALLY running?
|
||||
if [ -x $HOME/bin/g++ ]; then
|
||||
@@ -29,6 +30,17 @@ ls -lah ~/.npm || mkdir ~/.npm
|
||||
# Make sure we own it
|
||||
chown -Rc $USER ~/.npm
|
||||
# We use this so we can filter the subtrees from our coverage report
|
||||
#pip install --user https://github.com/vinniefalco/codecov-python/zipball/source-match
|
||||
pip install --user https://github.com/codecov/codecov-python/archive/master.zip
|
||||
pip install --user autobahntestsuite
|
||||
|
||||
bash scripts/install-boost.sh
|
||||
bash scripts/install-valgrind.sh
|
||||
|
||||
# Install lcov
|
||||
# Download the archive
|
||||
wget http://downloads.sourceforge.net/ltp/lcov-1.12.tar.gz
|
||||
# Extract to ~/lcov-1.12
|
||||
tar xfvz lcov-1.12.tar.gz -C $HOME
|
||||
# Set install path
|
||||
mkdir -p $LCOV_ROOT
|
||||
cd $HOME/lcov-1.12 && make install PREFIX=$LCOV_ROOT
|
||||
|
||||
20
scripts/install-valgrind.sh
Normal file
20
scripts/install-valgrind.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash -u
|
||||
# Assumptions:
|
||||
# 1) VALGRIND_ROOT is already defined, and contains a valid values
|
||||
set -e
|
||||
if [ ! -d "$VALGRIND_ROOT/bin" ]
|
||||
then
|
||||
# These are specified in the addons/apt section of .travis.yml
|
||||
# sudo apt-get install subversion automake autotools-dev libc6-dbg
|
||||
export PATH=$PATH:$VALGRIND_ROOT/bin
|
||||
svn co svn://svn.valgrind.org/valgrind/trunk valgrind-co
|
||||
cd valgrind-co
|
||||
./autogen.sh
|
||||
./configure --prefix=$VALGRIND_ROOT
|
||||
make
|
||||
make install
|
||||
# test it
|
||||
valgrind ls -l
|
||||
else
|
||||
echo "Using cached valgrind at $VALGRIND_ROOT"
|
||||
fi
|
||||
8
scripts/run-with-gdb.sh
Executable file
8
scripts/run-with-gdb.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash -u
|
||||
set -e
|
||||
gdb --silent \
|
||||
--batch \
|
||||
--return-child-result \
|
||||
-ex=run \
|
||||
-ex="thread apply all bt full" \
|
||||
--args $@
|
||||
Reference in New Issue
Block a user