Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[jenkins] Enable debug (Ã-g) in the builds
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 3 Jul 2015 12:41:09 +0000 (14:41 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 3 Jul 2015 13:03:35 +0000 (15:03 +0200)
buildtools/jenkins/build.sh

index 37c7867..e6be9fa 100755 (executable)
@@ -13,6 +13,15 @@ die () {
   exit $status
 }
 
+# Get an ON/OFF string from a command:
+onoff() {
+  if "$@" > /dev/null ; then
+    echo ON
+  else
+    echo OFF
+  fi
+}
+
 ulimit -c 0
 
 if [ -d $WORKSPACE/build ]
@@ -27,21 +36,31 @@ make dist
 tar xzf `cat VERSION`.tar.gz
 cd `cat VERSION`
 
-if [ "$build_mode" = "Debug" ]
-then
-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 .
-fi
-
-if [ "$build_mode" = "ModelChecker" ]
-then
-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 .
-fi
-
-if [ "$build_mode" = "DynamicAnalysis" ]
-then
-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 .
-fi
-
+case "$build_mode" in
+  "Debug")
+  ;;
+
+  "ModelChecker")
+  ;;
+
+  "DynamicAnalysis")
+  ;;
+
+  *)
+  die 1 "Unknown build_mode $build_mode"
+  ;;
+esac
+
+cmake -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
+  -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
+  -Denable_compile_optimization=$(onoff test "$build_mode" = "Debug") \
+  -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
+  -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
+  -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
+  -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
+  -Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
+  -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF \
+  -Denable_tracing=ON -Denable_java=ON
 make
 
 cd $WORKSPACE/build
@@ -55,16 +74,6 @@ if [ -f Testing/TAG ] ; then
    mv CTestResults.xml $WORKSPACE
 fi
 
-if [ "$build_mode" = "Debug" ]
-then
-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 .
-fi
-
-if [ "$build_mode" = "ModelChecker" ]
-then
-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 .
-fi
-
 if [ "$build_mode" = "DynamicAnalysis" ]
 then
   ctest -D ContinuousStart