X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3236ec8d57f45adae06336863e104faf62ff84c6..f275f02285f9b85e302886c73f418df1cfeb6a7a:/buildtools/jenkins/build.sh diff --git a/buildtools/jenkins/build.sh b/buildtools/jenkins/build.sh index eb87979fd9..b75443a0b1 100755 --- a/buildtools/jenkins/build.sh +++ b/buildtools/jenkins/build.sh @@ -2,10 +2,23 @@ set -e -echo "Running $0 with arguments:" >&2 -for arg in "$@"; do - echo "- $arg" -done +# usage: die status message... +die () { + local status=${1:-1} + shift + [ $# -gt 0 ] || set -- "Error - Halting" + echo "$@" >&2 + exit $status +} + +# Get an ON/OFF string from a command: +onoff() { + if "$@" > /dev/null ; then + echo ON + else + echo OFF + fi +} build_mode="$1" echo "Build mode $build_mode on $(uname -np)" >&2 @@ -20,13 +33,7 @@ case "$build_mode" in ;; *) - if test "$(uname -o)" = "Msys"; then - echo "On Windows, jenkins is not willing to expand variables for some reason" >&2 - echo "Force use Debug mode" >&2 - else - echo "Unknown build_mode $build_mode" - exit 1 - fi + die 1 "Unknown build_mode $build_mode" ;; esac @@ -40,42 +47,43 @@ else GENERATOR="Unix Makefiles" fi -# usage: die status message... -die () { - local status=${1:-1} - shift - [ $# -gt 0 ] || set -- "Error - Halting" - echo "$@" >&2 - exit $status -} - -# Get an ON/OFF string from a command: -onoff() { - if "$@" > /dev/null ; then - echo ON - else - echo OFF - fi -} - ulimit -c 0 || true -if [ -d $WORKSPACE/build ] -then - rm -rf $WORKSPACE/build +if test "$(uname -o)" != "Msys"; then + echo "XX" + echo "XX Get out of the tree" + echo "XX" + if [ -d $WORKSPACE/build ] + then + rm -rf $WORKSPACE/build + fi + mkdir $WORKSPACE/build + cd $WORKSPACE/build + + echo "XX" + echo "XX Build the archive out of the tree" + echo "XX pwd: `pwd`" + echo "XX" + + cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE + make dist -j$NUMBER_OF_PROCESSORS + + echo "XX" + echo "XX Open the resulting archive" + echo "XX" + tar xzf `cat VERSION`.tar.gz + cd `cat VERSION` fi -mkdir $WORKSPACE/build -cd $WORKSPACE/build - -cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE -make dist -j$NUMBER_OF_PROCESSORS -tar xzf `cat VERSION`.tar.gz -cd `cat VERSION` +echo "XX" +echo "XX Configure and build SimGrid" +echo "XX pwd: `pwd`" +echo "XX" cmake -G"$GENERATOR"\ -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_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \ + -Denable_compile_optimizations=$(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") \ @@ -83,19 +91,30 @@ cmake -G"$GENERATOR"\ -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 -j$NUMBER_OF_PROCESSORS +make -j$NUMBER_OF_PROCESSORS VERBOSE=1 -cd $WORKSPACE/build -cd `cat VERSION` +if test "$(uname -o)" != "Msys"; then + cd $WORKSPACE/build + cd `cat VERSION` +fi TRES=0 +echo "XX" +echo "XX Run the tests" +echo "XX pwd: `pwd`" +echo "XX" + ctest -T test --output-on-failure --no-compress-output || true if [ -f Testing/TAG ] ; then xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml mv CTestResults.xml $WORKSPACE fi +echo "XX" +echo "XX Done. Return the results to cmake" +echo "XX" + if [ "$build_mode" = "DynamicAnalysis" ] then ctest -D ContinuousStart