Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix the DSO debug ignore list
[simgrid.git] / buildtools / jenkins / build.sh
1 #!/bin/sh
2
3 set -e
4
5 build_mode="$1"
6
7 echo "Build mode $build_mode on $(uname -np)" >&2
8
9 # usage: die status message...
10 die () {
11   local status=${1:-1}
12   shift
13   [ $# -gt 0 ] || set -- "Error - Halting"
14   echo "$@" >&2
15   exit $status
16 }
17
18 # Get an ON/OFF string from a command:
19 onoff() {
20   if "$@" > /dev/null ; then
21     echo ON
22   else
23     echo OFF
24   fi
25 }
26
27 ulimit -c 0
28
29 if [ -d $WORKSPACE/build ]
30 then
31   rm -rf $WORKSPACE/build
32 fi
33 mkdir $WORKSPACE/build
34 cd $WORKSPACE/build
35
36 cmake -Denable_documentation=OFF $WORKSPACE
37 make dist
38 tar xzf `cat VERSION`.tar.gz
39 cd `cat VERSION`
40
41 case "$build_mode" in
42   "Debug")
43   ;;
44
45   "ModelChecker")
46   ;;
47
48   "DynamicAnalysis")
49   ;;
50
51   *)
52   die 1 "Unknown build_mode $build_mode"
53   ;;
54 esac
55
56 cmake -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
57   -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
58   -Denable_compile_optimization=$(onoff test "$build_mode" = "Debug") \
59   -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
60   -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
61   -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
62   -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
63   -Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
64   -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF \
65   -Denable_tracing=ON -Denable_java=ON
66 make
67
68 cd $WORKSPACE/build
69 cd `cat VERSION`
70
71 TRES=0
72
73 ctest -T test --no-compress-output || true
74 if [ -f Testing/TAG ] ; then
75    xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
76    mv CTestResults.xml $WORKSPACE
77 fi
78
79 if [ "$build_mode" = "DynamicAnalysis" ]
80 then
81   ctest -D ContinuousStart
82   ctest -D ContinuousConfigure
83   ctest -D ContinuousBuild
84   ctest -D ContinuousMemCheck
85   ctest -D ContinuousSubmit
86 fi
87
88 ctest -D ContinuousStart
89 ctest -D ContinuousConfigure
90 ctest -D ContinuousBuild
91 ctest -D ContinuousTest
92 ctest -D ContinuousSubmit
93
94 rm -rf `cat VERSION`