-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from libtom/improve/travis_build
Improve/travis build
- Loading branch information
Showing
14 changed files
with
233 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# output version | ||
bash printinfo.sh | ||
bash .ci/printinfo.sh | ||
|
||
make clean > /dev/null | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
# | ||
# This builds different stuff depending on the compiler: | ||
# gcc - valgrind, coverage | ||
# clang - asan, ubsan, scan-build | ||
# both - the two testbuild's NOTEST and NOFILE | ||
|
||
set -e | ||
|
||
if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then | ||
echo "only run $0 for the regular makefile, early exit success" | ||
exit 0 | ||
fi | ||
|
||
if [ -f /proc/cpuinfo ] | ||
then | ||
MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 )) | ||
else | ||
MAKE_JOBS=8 | ||
fi | ||
|
||
function run_gcc() { | ||
bash .ci/check_source.sh "CHECK_SOURCES" "$2" "$3" "$4" "$5" | ||
|
||
make clean &>/dev/null | ||
|
||
echo | ||
echo "Build for ASAN..." | ||
|
||
make -j$MAKE_JOBS CFLAGS="-fsanitize=address -fno-omit-frame-pointer -static-libasan $2 $CFLAGS $4" EXTRALIBS="-lasan $5" test LTC_DEBUG=1 1>gcc_1.txt 2>gcc_2.txt | ||
|
||
echo | ||
echo "Run ASAN tests with LTM..." | ||
|
||
ASAN_OPTIONS=verbosity=1 ./test t ltm 1>test_std.txt 2> test_err.txt || exit 1 | ||
|
||
if echo $2 | grep -q GMP ; then | ||
echo | ||
echo "Run ASAN tests with GMP..." | ||
|
||
ASAN_OPTIONS=verbosity=1 ./test t gmp 1>test_std.txt 2> test_err.txt || exit 1 | ||
fi | ||
|
||
make clean &>/dev/null | ||
|
||
echo | ||
echo "Create code coverage" | ||
|
||
bash .ci/coverage.sh "COVERAGE" "$2" "$3" "$4" "$5" | ||
} | ||
|
||
function run_clang() { | ||
# output version | ||
bash .ci/printinfo.sh | ||
|
||
scan_build=$(which scan-build) | ||
[ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true | ||
[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build" | ||
$scan_build --status-bugs make -j$MAKE_JOBS all CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" | ||
|
||
make clean &>/dev/null | ||
|
||
echo | ||
echo "Build for UBSAN..." | ||
|
||
make -j$MAKE_JOBS LDFLAGS="-fsanitize=undefined" CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" all LTC_DEBUG=1 1>gcc_1.txt 2>gcc_2.txt | ||
|
||
echo "Run UBSAN tests with LTM..." | ||
UBSAN_OPTIONS=verbosity=1 ./test t ltm 1>test_std.txt 2> test_err.txt || exit 1 | ||
|
||
if echo $2 | grep -q GMP ; then | ||
echo | ||
echo "Run UBSAN tests with GMP..." | ||
|
||
UBSAN_OPTIONS=verbosity=1 ./test t gmp 1>test_std.txt 2> test_err.txt || exit 1 | ||
fi | ||
} | ||
|
||
make clean &>/dev/null | ||
|
||
EXTRALIBS="$5" | ||
|
||
echo $2 | grep -q GMP && EXTRALIBS="$EXTRALIBS -lgmp" | ||
|
||
if [ -z "$(echo $CC | grep "clang")" ]; then | ||
run_gcc "$1" "$2" "$3" "$4" "$EXTRALIBS" | ||
else | ||
run_clang "$1" "$2" "$3" "$4" "$EXTRALIBS" | ||
fi | ||
|
||
make clean &>/dev/null | ||
|
||
bash .ci/testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$3" "$4" "$5" | ||
|
||
make clean &>/dev/null | ||
|
||
bash .ci/testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$3" "$4" "$5" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# output version | ||
bash .ci/printinfo.sh | ||
|
||
if [ -f /proc/cpuinfo ] | ||
then | ||
MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 )) | ||
else | ||
MAKE_JOBS=8 | ||
fi | ||
|
||
echo "$1 (Build Only, $2, $3)..." | ||
make clean 1>/dev/null 2>/dev/null | ||
echo -n "building..." | ||
touch testok.txt | ||
CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && rm -f testok.txt && exit 1) | ||
if find testok.txt -type f 1>/dev/null 2>/dev/null ; then | ||
echo "successful" | ||
exit 0 | ||
fi | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then | ||
echo "only run $0 for the regular makefile, early exit success" | ||
exit 0 | ||
fi | ||
|
||
if [ -f /proc/cpuinfo ] | ||
then | ||
MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 )) | ||
else | ||
MAKE_JOBS=8 | ||
fi | ||
|
||
# output version | ||
bash .ci/printinfo.sh | ||
|
||
make clean &>/dev/null | ||
|
||
echo "Build for valgrind..." | ||
|
||
make -j$MAKE_JOBS CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" test LTC_DEBUG=1 1>gcc_1.txt 2>gcc_2.txt | ||
|
||
echo "Run tests with valgrind..." | ||
|
||
for i in `seq 1 10` ; do sleep 300 && echo "Valgrind tests in Progress..."; done & | ||
alive_pid=$! | ||
|
||
valgrind --error-exitcode=666 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ./test >test_std.txt 2> >(tee -a test_err.txt >&2) || { kill $alive_pid; echo "Valgrind failed"; exit 1; } | ||
|
||
kill $alive_pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.