Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add suppressions for TSan.
[simgrid.git] / tools / jenkins / Sanitizers.sh
index 2c0cfa3..985042f 100755 (executable)
@@ -7,16 +7,6 @@ die() {
     exit 1
 }
 
-do_cleanup() {
-  for d in "$WORKSPACE/build"
-  do
-    if [ -d "$d" ]
-    then
-      rm -rf "$d" || die "Could not remote $d"
-    fi
-  done
-}
-
 if [ -z "$1" ]
   then
     echo "No Sanitizer type selected - run Address"
@@ -28,10 +18,11 @@ fi
 
 if [ "${SANITIZER}" = "address" ]
 then
+    export ASAN_OPTIONS="suppressions=$WORKSPACE/tools/address_sanitizer.supp"
     SANITIZER_OPTIONS="-Denable_address_sanitizer=ON -Denable_undefined_sanitizer=OFF -Denable_thread_sanitizer=OFF"
 elif [ "${SANITIZER}" = "thread" ]
 then
-    export TSAN_OPTIONS="memory_limit_mb=1500"
+    export TSAN_OPTIONS="memory_limit_mb=1500 suppressions=$WORKSPACE/tools/thread_sanitizer.supp"
     SANITIZER_OPTIONS="-Denable_address_sanitizer=OFF -Denable_undefined_sanitizer=OFF -Denable_thread_sanitizer=ON"
 elif [ "${SANITIZER}" = "undefined" ]
 then
@@ -45,27 +36,37 @@ fi
 
 ### Check the node installation
 
-for pkg in xsltproc
-do
-   if command -v $pkg
-   then 
-      echo "$pkg is installed. Good."
-   else 
-      die "please install $pkg before proceeding" 
-   fi
-done
+pkg_check() {
+  for pkg
+  do
+    if command -v $pkg
+    then
+       echo "$pkg is installed. Good."
+    else
+       die "please install $pkg before proceeding"
+    fi
+  done
+}
+
+pkg_check xsltproc
 
 ### Cleanup previous runs
 
 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
-do_cleanup
+do_cleanup() {
+  for d
+  do
+    if [ -d "$d" ]
+    then
+      rm -rf "$d" || die "Could not remove $d"
+    fi
+    mkdir "$d" || die "Could not create $d"
+  done
+}
 
-for d in "$WORKSPACE/build"
-do
-  mkdir "$d" || die "Could not create $d"
-done
+do_cleanup "$WORKSPACE/build"
 
 NUMPROC="$(nproc)" || NUMPROC=1
 
@@ -78,9 +79,9 @@ cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
       -Denable_jedule=ON -Denable_mallocators=OFF \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF\
-      -Denable_fortran=OFF ${SANITIZER_OPTIONS} $WORKSPACE
+      -Denable_fortran=OFF -Denable_python=OFF ${SANITIZER_OPTIONS} $WORKSPACE
 
-make -j$NUMPROC
+make -j$NUMPROC tests
 ctest --no-compress-output -D ExperimentalTest || true
 
 if [ -f Testing/TAG ] ; then