Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
467b8e108ba9b8f730a08468121d094be0305ec8
[simgrid.git] / tools / jenkins / Sanitizers.sh
1 #!/bin/sh
2
3 set -e
4
5 die() {
6     echo "$@"
7     exit 1
8 }
9
10 do_cleanup() {
11   for d in "$WORKSPACE/build"
12   do
13     if [ -d "$d" ]
14     then
15       rm -rf "$d" || die "Could not remote $d"
16     fi
17   done
18 }
19
20 ### Check the node installation
21
22 for pkg in xsltproc
23 do
24    if command -v $pkg
25    then 
26       echo "$pkg is installed. Good."
27    else 
28       die "please install $pkg before proceeding" 
29    fi
30 done
31
32 ###¬†Cleanup previous runs
33
34 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
35 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
36
37 do_cleanup
38
39 for d in "$WORKSPACE/build"
40 do
41   mkdir "$d" || die "Could not create $d"
42 done
43
44 NUMPROC="$(nproc)" || NUMPROC=1
45
46 cd $WORKSPACE/build
47
48 ctest -D ExperimentalStart || true
49
50 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
51       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
52       -Denable_jedule=ON -Denable_mallocators=OFF \
53       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
54       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF -Denable_address_sanitizer=ON --enable_fortran=OFF $WORKSPACE
55
56 make -j$NUMPROC
57 ctest -D ExperimentalTest || true
58
59 if [ -f Testing/TAG ] ; then
60    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_address.xml
61    mv CTestResults_address.xml $WORKSPACE
62 fi
63
64 make clean
65
66 export TSAN_OPTIONS="memory_limit_mb=1500"
67
68 ctest -D ExperimentalStart || true
69
70 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
71       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
72       -Denable_jedule=ON -Denable_mallocators=ON \
73       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
74       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF -Denable_address_sanitizer=OFF -Denable_thread_sanitizer=ON --enable_fortran=OFF  $WORKSPACE
75
76 make -j$NUMPROC
77 ctest -D ExperimentalTest || true
78
79 if [ -f Testing/TAG ] ; then
80    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_thread.xml
81    mv CTestResults_thread.xml $WORKSPACE
82 fi
83
84 make clean
85
86 ctest -D ExperimentalStart || true
87
88 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
89       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
90       -Denable_jedule=ON -Denable_mallocators=ON \
91       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
92       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF -Denable_address_sanitizer=OFF -Denable_thread_sanitizer=OFF -Denable_undefined_sanitizer=ON --enable_fortran=OFF  $WORKSPACE
93
94 make -j$NUMPROC
95 ctest -D ExperimentalTest || true
96
97 if [ -f Testing/TAG ] ; then
98    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_undefined.xml
99    mv CTestResults_undefined.xml $WORKSPACE
100 fi
101
102