From d8b8a9a0c41d2a86795a365d49d833c3ecd2b3e4 Mon Sep 17 00:00:00 2001 From: Carl Delsey <carl.r.delsey@intel.com> Date: Thu, 14 Nov 2019 12:02:36 -0800 Subject: [PATCH] Script to run the thread and address sanitizers. (#1313) --- tools/run_sanitizers | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 tools/run_sanitizers diff --git a/tools/run_sanitizers b/tools/run_sanitizers new file mode 100755 index 00000000..7ded4aa3 --- /dev/null +++ b/tools/run_sanitizers @@ -0,0 +1,41 @@ +#!/bin/bash + +# colcon sanitizer plugin instructions at +# https://github.com/colcon/colcon-sanitizer-reports/blob/master/README.rst + +# To use this script, make sure you have the colcon plugins installed according +# to the instructions above. Then build ros2_ws and navstack_dependencies_ws. +# Source the navstack_dependencies_ws and then cd to the navigation2_ws. +# +# Run this script by invoking navigation2/tools/run_sanitizers +# Afterwards, there should be two files in the root of the workspace: +# - sanitizer_report-asan.csv +# - sanitizer_report-tsan.csv + +clean_workspace() { + rm -rf build install log +} + +build_with_sanitizer() { + colcon build --build-base=build-$1 --install-base=install-$1 \ + --cmake-args -DOSRF_TESTING_TOOLS_CPP_DISABLE_MEMORY_TOOLS=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + --mixin $1 \ + --symlink-install +} + +test_with_sanitizer() { +colcon test --build-base=build-$1 --install-base=install-$1 --retest-until-pass 3 \ + --event-handlers sanitizer_report+ +} + + +clean_workspace + +build_with_sanitizer asan-gcc +build_with_sanitizer tsan + +test_with_sanitizer asan-gcc +mv sanitizer_report.csv sanitizer_report-asan.csv +test_with_sanitizer tsan +mv sanitizer_report.csv sanitizer_report-tsan.csv -- GitLab