2015-03-25 15:37:45 -07:00
|
|
|
set -eu
|
|
|
|
|
2014-08-07 05:07:26 -07:00
|
|
|
valgrind_check() {
|
2014-09-30 13:33:45 -07:00
|
|
|
check_logs "$1" "valgrind-*"
|
2014-08-07 05:07:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
asan_check() {
|
2014-09-30 13:33:45 -07:00
|
|
|
check_logs "$1" "*san.*"
|
|
|
|
}
|
|
|
|
|
|
|
|
check_logs() {
|
2015-03-25 15:37:45 -07:00
|
|
|
local err=""
|
2014-11-03 06:52:04 -07:00
|
|
|
check_core_dumps
|
2014-09-30 13:33:45 -07:00
|
|
|
# Iterate through each log to remove an useless warning
|
|
|
|
for log in $(find "$1" -type f -name "$2"); do
|
|
|
|
sed -i "$log" \
|
|
|
|
-e '/Warning: noted but unhandled ioctl/d' \
|
|
|
|
-e '/could cause spurious value errors to appear/d' \
|
|
|
|
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
|
|
|
|
done
|
|
|
|
# Now do it again, but only consider files with size > 0
|
|
|
|
for log in $(find "$1" -type f -name "$2" -size +0); do
|
|
|
|
cat "$log"
|
|
|
|
err=1
|
|
|
|
done
|
|
|
|
if [ -n "$err" ]; then
|
|
|
|
echo "Runtime errors detected"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-08-07 05:07:26 -07:00
|
|
|
}
|
|
|
|
|
2014-11-03 06:52:04 -07:00
|
|
|
check_core_dumps() {
|
|
|
|
sleep 2
|
2014-12-07 11:20:26 -07:00
|
|
|
|
|
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
2014-11-30 03:27:08 -07:00
|
|
|
cores="$(find /cores/ -type f -print)"
|
|
|
|
dbg="lldb -Q -o bt -f build/bin/nvim -c"
|
2014-12-07 11:20:26 -07:00
|
|
|
else
|
|
|
|
# TODO(fwalch): Will trigger if a file named core.* exists outside of .deps.
|
2014-11-30 03:27:08 -07:00
|
|
|
cores="$(find ./ -type f -not -path '*.deps*' -name 'core.*' -print)"
|
|
|
|
dbg="gdb -n -batch -ex bt build/bin/nvim"
|
2014-12-07 11:20:26 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$cores" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
for c in $cores; do
|
2014-11-30 03:27:08 -07:00
|
|
|
$dbg $c
|
2014-11-03 06:52:04 -07:00
|
|
|
done
|
2014-12-07 11:20:26 -07:00
|
|
|
exit 1
|
2014-11-03 06:52:04 -07:00
|
|
|
}
|
|
|
|
|
2014-11-28 15:23:12 -07:00
|
|
|
setup_deps() {
|
2015-03-25 15:37:45 -07:00
|
|
|
sudo pip install --upgrade pip
|
2015-01-29 07:01:25 -07:00
|
|
|
sudo pip install neovim
|
2015-03-25 15:37:45 -07:00
|
|
|
|
|
|
|
# For pip3
|
|
|
|
# https://github.com/travis-ci/travis-ci/issues/1528
|
|
|
|
# sudo apt-get install -q python3.3-dev
|
|
|
|
# curl -Ss http://python-distribute.org/distribute_setup.py | sudo python3
|
|
|
|
# curl -Ss https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python3
|
|
|
|
# sudo pip3.3 install neovim
|
|
|
|
|
2014-11-28 15:23:12 -07:00
|
|
|
if [ "$BUILD_NVIM_DEPS" != "true" ]; then
|
|
|
|
eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) deps-${1}"
|
|
|
|
elif [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
|
|
|
sudo apt-get install libtool
|
|
|
|
fi
|
2014-08-07 05:07:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
tmpdir="$(pwd)/tmp"
|
|
|
|
rm -rf "$tmpdir"
|
|
|
|
mkdir -p "$tmpdir"
|
|
|
|
suppressions="$(pwd)/.valgrind.supp"
|