Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a09b951f20d043f7749084df9622647d1aad468b
[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     
30     if [ "$build_mode" = "Debug" ]
31     then
32     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 .
33     fi
34
35     if [ "$build_mode" = "ModelChecker" ]
36     then
37     cmake -G "MSYS Makefiles" -Denable_java=ON -Denable_smpi=ON -Denable_model-checking=ON -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_compile_warnings=OFF .
38     fi
39
40     if [ "$build_mode" = "DynamicAnalysis" ]
41     then
42     cmake -G "MSYS Makefiles" -Denable_lua=OFF -Denable_java=ON -Denable_tracing=ON -Denable_smpi=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=OFF -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 .
43     fi
44
45     if [ $? -ne 0 ] ; then
46         echo "Failed to perform the Cmake for $build_mode - Halting"
47         exit 5
48     fi
49
50     make
51
52     if [ $? -ne 0 ] ; then
53         echo "Build failure - Halting"
54         exit 5
55     fi
56
57     make nsis
58
59     if [ $? -ne 0 ] ; then
60         echo "Failure while generating the Windows executable - Halting"
61         exit 6
62     fi
63
64 else    
65     cmake $WORKSPACE
66
67     if [ $? -ne 0 ] ; then
68         echo "Failed to do the first cmake - Halting"
69         exit 1
70     fi
71
72     rm Simgrid*.tar.gz
73     make dist
74
75     if [ $? -ne 0 ] ; then
76         echo "Failed to build dist - Halting"
77         exit 2
78     fi
79
80     tar xzf `cat VERSION`.tar.gz
81
82     if [ $? -ne 0 ] ; then
83         echo "Failed to extract the generated tgz - Halting"
84         exit 3
85     fi
86
87     cd `cat VERSION`
88
89     if [ $? -ne 0 ] ; then
90         echo "Path `cat VERSION` cannot be found - Halting"
91         exit 4
92     fi
93
94     if [ "$build_mode" = "Debug" ]
95     then
96     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 .
97     fi
98
99     if [ "$build_mode" = "ModelChecker" ]
100     then
101     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 .
102     fi
103
104     if [ "$build_mode" = "DynamicAnalysis" ]
105     then
106     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 .
107     fi
108
109     if [ $? -ne 0 ] ; then
110         echo "Failed to perform the Cmake for $build_mode - Halting"
111         exit 5
112     fi
113
114     make
115
116     if [ $? -ne 0 ] ; then
117         echo "Build failure - Halting"
118         exit 6
119     fi
120
121 fi
122
123 ctest -T test --no-compress-output  --timeout 100 || true
124 if [ -f Testing/TAG ] ; then
125    xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl -o "$WORKSPACE/CTestResults.xml" Testing/`head -n 1 < Testing/TAG`/Test.xml
126 fi
127
128 ctest -D ContinuousStart
129 ctest -D ContinuousConfigure
130 ctest -D ContinuousBuild
131 ctest -D ContinuousTest
132 ctest -D ContinuousSubmit
133
134 rm -rf `cat VERSION`