Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
activates the ISP test for model-checking
[simgrid.git] / buildtools / jenkins / build.sh
1 #!/bin/sh
2
3 set -e
4
5 # usage: die status message...
6 die () {
7   local status=${1:-1}
8   shift
9   [ $# -gt 0 ] || set -- "Error - Halting"
10   echo "$@" >&2
11   exit $status
12 }
13
14 # Get an ON/OFF string from a command:
15 onoff() {
16   if "$@" > /dev/null ; then
17     echo ON
18   else
19     echo OFF
20   fi
21 }
22
23 build_mode="$1"
24 echo "Build mode $build_mode on $(uname -np)" >&2
25 case "$build_mode" in
26   "Debug")
27   ;;
28
29   "ModelChecker")
30   ;;
31
32   "DynamicAnalysis")
33   ;;
34
35   *)
36     die 1 "Unknown build_mode $build_mode"
37   ;;
38 esac
39
40 if test "$(uname -o)" = "Msys"; then
41   if [ -z "$NUMBER_OF_PROCESSORS" ]; then
42     NUMBER_OF_PROCESSORS=1
43   fi
44   GENERATOR="MSYS Makefiles"
45 else
46   NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
47   GENERATOR="Unix Makefiles"
48 fi
49
50 ulimit -c 0 || true
51
52 if test "$(uname -o)" != "Msys"; then
53   echo "XX"
54   echo "XX Get out of the tree"
55   echo "XX"
56   if [ -d $WORKSPACE/build ]
57   then
58     rm -rf $WORKSPACE/build
59   fi
60   mkdir $WORKSPACE/build
61   cd $WORKSPACE/build
62
63   echo "XX"
64   echo "XX Build the archive out of the tree"
65   echo "XX   pwd: `pwd`"
66   echo "XX"
67
68   cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
69   make dist -j$NUMBER_OF_PROCESSORS
70
71   echo "XX"
72   echo "XX Open the resulting archive"
73   echo "XX"
74   tar xzf `cat VERSION`.tar.gz
75   cd `cat VERSION`
76 fi
77
78 echo "XX"
79 echo "XX Configure and build SimGrid"
80 echo "XX   pwd: `pwd`"
81 echo "XX"
82 cmake -G"$GENERATOR"\
83   -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
84   -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
85   -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
86   -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
87   -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
88   -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
89   -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
90   -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
91   -Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
92   -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF \
93   -Denable_tracing=ON -Denable_java=ON
94 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
95
96 if test "$(uname -o)" != "Msys"; then
97   cd $WORKSPACE/build
98   cd `cat VERSION`
99 fi
100
101 TRES=0
102
103 echo "XX"
104 echo "XX Run the tests"
105 echo "XX   pwd: `pwd`"
106 echo "XX"
107
108 ctest -T test --output-on-failure --no-compress-output || true
109 if [ -f Testing/TAG ] ; then
110    xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
111    mv CTestResults.xml $WORKSPACE
112 fi
113
114 echo "XX"
115 echo "XX Done. Return the results to cmake"
116 echo "XX"
117
118 if [ "$build_mode" = "DynamicAnalysis" ]
119 then
120   ctest -D ContinuousStart
121   ctest -D ContinuousConfigure
122   ctest -D ContinuousBuild
123   ctest -D ContinuousMemCheck
124   ctest -D ContinuousSubmit
125 fi
126
127 ctest -D ContinuousStart
128 ctest -D ContinuousConfigure
129 ctest -D ContinuousBuild
130 ctest -D ContinuousTest
131 ctest -D ContinuousSubmit
132
133 rm -rf `cat VERSION`