Add address sanitizer to SITL pipeline

- Environment variables for building with asan
- Docker argument for leak sanitizer
- Regex for tests to fail on sanitizer error

Signed-off-by: Lukas Woodtli <woodtli.lukas@gmail.com>
This commit is contained in:
Lukas Woodtli
2018-09-09 21:38:22 +02:00
committed by Lorenz Meier
parent eb4f847322
commit c1a58bda17
3 changed files with 49 additions and 6 deletions

View File

@@ -12,12 +12,27 @@ pipeline {
}
stages {
stage('Setup Environment') {
steps {
script {
env.CTEST_OUTPUT_ON_FAILURE=1
if (env.PX4_CMAKE_BUILD_TYPE == 'AddressSanitizer') {
env.PX4_ASAN=1
env.ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1"
}
}
}
}
stage('Build') {
agent {
docker {
image 'px4io/px4-dev-ros-kinetic:2018-09-11'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE --cap-add SYS_PTRACE'
}
}
@@ -128,7 +143,7 @@ pipeline {
],
]
def test_nodes = [:]
for (def i = 0; i < missions.size(); i++) {
test_nodes.put(missions[i].name, createTestNode(missions[i]))
@@ -146,7 +161,7 @@ pipeline {
agent {
docker {
image 'px4io/px4-dev-base:2018-09-11'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw --cap-add SYS_PTRACE'
}
}
steps {
@@ -169,7 +184,7 @@ pipeline {
agent {
docker {
image 'px4io/px4-dev-base:2018-09-11'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw --cap-add SYS_PTRACE'
}
}
steps {
@@ -204,7 +219,7 @@ def createTestNode(Map test_def) {
return {
node {
cleanWs()
docker.image("px4io/px4-dev-ros-kinetic:2018-09-11").inside('-e HOME=${WORKSPACE}') {
docker.image("px4io/px4-dev-ros-kinetic:2018-09-11").inside('-e HOME=${WORKSPACE} --cap-add SYS_PTRACE') {
stage(test_def.name) {
try {