Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
e5501dabe6dd4a1fd5911ed84bb1d07ffcba0248
[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=OFF \
54       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF -Denable_address_sanitizer=ON -Denable_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 export UBSAN_OPTIONS="print_stacktrace=1"
68
69 ctest -D ExperimentalStart || true
70
71 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
72       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
73       -Denable_jedule=ON -Denable_mallocators=ON \
74       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
75       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF -Denable_address_sanitizer=OFF -Denable_thread_sanitizer=ON -Denable_fortran=OFF  $WORKSPACE
76
77 make -j$NUMPROC
78 ctest -D ExperimentalTest || true
79
80 if [ -f Testing/TAG ] ; then
81    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_thread.xml
82    mv CTestResults_thread.xml $WORKSPACE
83 fi
84
85 make clean
86
87 ctest -D ExperimentalStart || true
88
89 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
90       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
91       -Denable_jedule=ON -Denable_mallocators=ON \
92       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
93       -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 -Denable_fortran=OFF  $WORKSPACE
94
95 make -j$NUMPROC
96 ctest -D ExperimentalTest || true
97
98 if [ -f Testing/TAG ] ; then
99    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_undefined.xml
100    mv CTestResults_undefined.xml $WORKSPACE
101 fi
102
103