Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
ci: add asan and tsan builds to travis ci.
Browse files Browse the repository at this point in the history
asan = address sanitizer
tsan = thread sanitizer
  • Loading branch information
alanxz committed Jun 7, 2015
1 parent 426a3a7 commit 4bb6b85
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
16 changes: 13 additions & 3 deletions .travis.yml
Expand Up @@ -24,9 +24,19 @@ env:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "gDwqo3jHj+HHGzFKnxL/nwZhbVeh2pItw0TbeaHcLtWubUZaf85ViEQRaXPyfnbG7l0OEQq+PjyhKAfvViVq2NP0lGeeu4VM5uMZJhsCLN594BJr39Y4XzOapg0O8mEMhQ0DU2u1Zo4LMgEcRz67aosVQOj6QV30tOzp9fnxn9U="
matrix:
- CONFIG=cmake
- CONFIG=autotools

matrix:
include:
- compiler: gcc
env: CONFIG=autotools
- compiler: gcc
env: CONFIG=cmake
- compiler: clang
env: CONFIG=cmake
- compiler: clang
env: CONFIG=asan
- compiler: clang
env: CONFIG=tsan

# Make sure CMake is installed
install:
Expand Down
22 changes: 19 additions & 3 deletions travis.sh
Expand Up @@ -7,15 +7,31 @@ build_autotools() {
}

build_cmake() {
mkdir $PWD/_build
cd $PWD/_build
CFLAGS="-fsanitize=undefined"
mkdir $PWD/_build && cd $PWD/_build
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../_install
cmake --build . --target install
ctest -V .
}

build_asan() {
mkdir $PWD/_build && cd $PWD/_build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/../_install \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -O1"
cmake --build . --target install
ctest -V .
}

build_tsan() {
mkdir $PWD/_build && cd $PWD/_build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/../_install \
-DCMAKE_C_FLAGS="-fsanitize=thread,undefined -O1"
cmake --build . --target install
ctest -V .
}

if [ "$#" -ne 1 ]; then
echo "Usage: $0 {autotools|cmake}"
echo "Usage: $0 {autotools|cmake|asan|tsan}"
exit 1
fi

Expand Down

0 comments on commit 4bb6b85

Please sign in to comment.