Add Travis support

This commit is contained in:
sublimator
2016-04-22 11:09:36 -04:00
committed by Vinnie Falco
parent 5602a24b22
commit 0061f03cef
5 changed files with 139 additions and 1 deletions

11
scripts/build-and-test.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/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 )
echo "using toolset: $CC"
echo "using variant: $VARIANT"
$BOOST_ROOT/bjam toolset=$CC variant=$VARIANT
`find . -name "core_tests"`
`find . -name "http_tests"`

24
scripts/install-boost.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Assumptions:
# 1) BOOST_ROOT and BOOST_URL are already defined,
# and contain valid values.
# 2) The last namepart of BOOST_ROOT matches the
# folder name internal to boost's .tar.gz
# When testing you can force a boost build by clearing travis caches:
# https://travis-ci.org/ripple/rippled/caches
set -e
if [ ! -d "$BOOST_ROOT/lib" ]
then
wget $BOOST_URL -O /tmp/boost.tar.gz
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"
cd $BOOST_ROOT && \
./bootstrap.sh --prefix=$BOOST_ROOT && \
./b2 -d1 $params && \
./b2 -d0 $params install
else
echo "Using cached boost at $BOOST_ROOT"
fi

34
scripts/install-dependencies.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash -u
# Exit if anything fails.
set -e
# Override gcc version to $GCC_VER.
# Put an appropriate symlink at the front of the path.
mkdir -v $HOME/bin
for g in gcc g++ gcov gcc-ar gcc-nm gcc-ranlib
do
test -x $( type -p ${g}-$GCC_VER )
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
done
for c in clang clang++
do
test -x $( type -p ${c}-$CLANG_VER )
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c}
done
export PATH=$PWD/bin:$PATH
# What versions are we ACTUALLY running?
if [ -x $HOME/bin/g++ ]; then
$HOME/bin/g++ -v
fi
if [ -x $HOME/bin/clang ]; then
$HOME/bin/clang -v
fi
# Avoid `spurious errors` caused by ~/.npm permission issues
# Does it already exist? Who owns? What permissions?
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
bash scripts/install-boost.sh