Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
4d6f1943eebb3f932f6692c102ce0368fba9e693
[simgrid.git] / buildtools / jenkins / run.sh
1 #!/bin/bash
2
3 WORKSPACE=$1
4 build_mode=$2
5
6 rm -rf $WORKSPACE/build
7
8 mkdir $WORKSPACE/build
9 cd $WORKSPACE/build
10
11 export PATH=./lib/:../../lib:$PATH
12
13 if test "$(uname -o)" = "Msys"
14 then 
15     cmake -G "MSYS Makefiles" $WORKSPACE
16
17     if [ $? -ne 0 ] ; then
18         echo "Failed to do the first cmake - Halting"
19         exit 1
20     fi
21
22     make dist
23
24     if [ $? -ne 0 ] ; then
25         echo "Failed to build dist - Halting"
26         exit 2
27     fi
28
29     cmake -G "MSYS Makefiles" -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=ON  -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=OFF .
30
31     if [ $? -ne 0 ] ; then
32         echo "Failed to perform the Cmake for $build_mode - Halting"
33         exit 5
34     fi
35
36     make
37
38     if [ $? -ne 0 ] ; then
39         echo "Build failure - Halting"
40         exit 5
41     fi
42
43     make nsis
44
45     if [ $? -ne 0 ] ; then
46         echo "Failure while generating the Windows executable - Halting"
47         exit 6
48     fi
49
50 else    
51     cmake $WORKSPACE
52
53     if [ $? -ne 0 ] ; then
54         echo "Failed to do the first cmake - Halting"
55         exit 1
56     fi
57
58     rm Simgrid*.tar.gz
59     make dist
60
61     if [ $? -ne 0 ] ; then
62         echo "Failed to build dist - Halting"
63         exit 2
64     fi
65
66     tar xzf `cat VERSION`.tar.gz
67
68     if [ $? -ne 0 ] ; then
69         echo "Failed to extract the generated tgz - Halting"
70         exit 3
71     fi
72
73     cd `cat VERSION`
74
75     if [ $? -ne 0 ] ; then
76         echo "Path `cat VERSION` cannot be found - Halting"
77         exit 4
78     fi
79
80     if [ "$build_mode" = "Debug" ]
81     then
82     cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON  -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON .
83     fi
84
85     if [ "$build_mode" = "ModelChecker" ]
86     then
87     cmake -Denable_coverage=ON -Denable_java=ON -Denable_smpi=ON -Denable_model-checking=ON -Denable_lua=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON .
88     fi
89
90     if [ "$build_mode" = "DynamicAnalysis" ]
91     then
92     cmake -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 .
93     fi
94
95     if [ $? -ne 0 ] ; then
96         echo "Failed to perform the Cmake for $build_mode - Halting"
97         exit 5
98     fi
99
100     make
101
102     if [ $? -ne 0 ] ; then
103         echo "Build failure - Halting"
104         exit 6
105     fi
106
107 fi
108
109 ctest -T test --no-compress-output  --timeout 100 || true
110 if [ -f Testing/TAG ] ; then
111    xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl -o "$WORKSPACE/CTestResults.xml" Testing/`head -n 1 < Testing/TAG`/Test.xml
112 fi
113
114 ctest -D ContinuousStart
115 ctest -D ContinuousConfigure
116 ctest -D ContinuousBuild
117 ctest -D ContinuousTest
118 ctest -D ContinuousSubmit
119
120 rm -rf `cat VERSION`