Logo AND Algorithmique Numérique Distribuée

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