2014-02-26 18:23:51 -07:00
|
|
|
#!/bin/sh -e
|
2014-02-26 11:48:26 -07:00
|
|
|
|
2014-03-13 08:11:03 -07:00
|
|
|
check_and_report() {
|
|
|
|
(
|
|
|
|
cd $tmpdir
|
2014-03-14 04:29:47 -07:00
|
|
|
set -- [*]san.[*] *san.*
|
|
|
|
case $1$2 in
|
|
|
|
'[*]san.[*]*san.*')
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
shift
|
|
|
|
cat "$@"
|
|
|
|
echo "Runtime errors detected"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2014-03-13 08:11:03 -07:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2014-03-03 08:09:06 -07:00
|
|
|
# Travis reports back that it has 32-cores via /proc/cpuinfo, but it's not
|
|
|
|
# what we really have available. According to their documentation, it only has
|
|
|
|
# 1.5 virtual cores.
|
|
|
|
# See:
|
|
|
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
|
|
|
# for more information.
|
|
|
|
alias make="make -j2"
|
|
|
|
|
2014-03-13 08:11:03 -07:00
|
|
|
if [ "$CC" = "clang" ]; then
|
|
|
|
# force using the version installed by 'travis-setup.sh'
|
|
|
|
export CC=/usr/bin/clang
|
|
|
|
|
|
|
|
install_dir="$(pwd)/dist"
|
|
|
|
# temporary directory for writing sanitizer logs
|
|
|
|
tmpdir="$(pwd)/tmp"
|
|
|
|
rm -rf "$tmpdir"
|
|
|
|
mkdir -p "$tmpdir"
|
|
|
|
|
|
|
|
# need the symbolizer path for stack traces with source information
|
|
|
|
symbolizer=/usr/bin/llvm-symbolizer-3.4
|
|
|
|
|
|
|
|
export SKIP_UNITTEST=1
|
|
|
|
export SANITIZE=1
|
|
|
|
export ASAN_SYMBOLIZER_PATH=$symbolizer
|
|
|
|
export ASAN_OPTIONS="detect_leaks=1:log_path=$tmpdir/asan"
|
|
|
|
export TSAN_OPTIONS="external_symbolizer_path=$symbolizer:log_path=$tmpdir/tsan"
|
|
|
|
export UBSAN_OPTIONS="log_path=$tmpdir/ubsan" # not sure if this works
|
|
|
|
|
|
|
|
make cmake CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$install_dir"
|
|
|
|
make
|
|
|
|
if ! make test; then
|
2014-03-14 04:29:47 -07:00
|
|
|
reset
|
2014-03-13 08:11:03 -07:00
|
|
|
check_and_report
|
|
|
|
fi
|
|
|
|
check_and_report
|
|
|
|
make install
|
|
|
|
else
|
|
|
|
export SKIP_EXEC=1
|
2014-03-03 08:09:06 -07:00
|
|
|
make CMAKE_EXTRA_FLAGS="-DBUSTED_OUTPUT_TYPE=TAP"
|
2014-03-13 08:11:03 -07:00
|
|
|
make cmake
|
|
|
|
make unittest
|
2014-02-26 17:33:39 -07:00
|
|
|
fi
|