X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f4f03348bd07609e258eb3b545bdafc2c881847..HEAD:/tools/jenkins/DynamicAnalysis.sh?ds=sidebyside diff --git a/tools/jenkins/DynamicAnalysis.sh b/tools/jenkins/DynamicAnalysis.sh index 0e50a6e048..2f7d99fe5e 100755 --- a/tools/jenkins/DynamicAnalysis.sh +++ b/tools/jenkins/DynamicAnalysis.sh @@ -1,95 +1,78 @@ -#!/bin/sh - -set -e +#!/usr/bin/env sh die() { echo "$@" exit 1 } -do_cleanup() { - for d in "$WORKSPACE/build" "$WORKSPACE/memcheck" +[ -n "$WORKSPACE" ] || die "No WORKSPACE" +[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist" + +echo "XXXX Cleanup previous attempts. Remaining content of /tmp:" +rm -f /tmp/cc* +rm -f /tmp/simgrid-mc-* +rm -f /tmp/*.so +rm -f /tmp/*.so.* +ls /tmp +df -h +echo "XXXX Let's go" + +set -e + +### Check the node installation + +pkg_check() { + for pkg do - if [ -d "$d" ] + if command -v "$pkg" then - rm -rf "$d" || die "Could not remote $d" + echo "$pkg is installed. Good." + else + die "please install $pkg before proceeding" fi done - find $WORKSPACE -name "memcheck_test_*.memcheck" -exec rm {} \; } -### Check the node installation - -for pkg in xsltproc valgrind -do - if dpkg -l |grep -q $pkg - then - echo "$pkg is installed. Good." - else - die "please install $pkg before proceeding" - fi -done - -if [ -e /usr/local/gcovr-3.1/scripts/gcovr ] -then - echo "gcovr is installed, good." -else - die "Please install /usr/local/gcovr-3.1/scripts/gcovr" -fi - -### Cleanup previous runs - -! [ -z "$WORKSPACE" ] || die "No WORKSPACE" -[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist" +pkg_check valgrind pcregrep -do_cleanup +### Cleanup previous runs -for d in "$WORKSPACE/build" "$WORKSPACE/memcheck" -do - mkdir "$d" || die "Could not create $d" -done +do_cleanup() { + for d + do + if [ -d "$d" ] + then + rm -rf "$d" || die "Could not remove $d" + fi + mkdir "$d" || die "Could not create $d" + done + find "$WORKSPACE" -name "memcheck_test_*.memcheck" -exec rm {} \; +} -cd $WORKSPACE/build +do_cleanup "$WORKSPACE/build" "$WORKSPACE/memcheck" -### Proceed with the tests +NUMPROC="$(nproc)" || NUMPROC=1 -cmake -Denable_documentation=OFF -Denable_lua=OFF -Denable_tracing=ON \ - -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF -Denable_mallocators=OFF \ - -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_model-checking=OFF \ - -Denable_memcheck_xml=ON $WORKSPACE -make +cd "$WORKSPACE"/build +### Proceed with the tests ctest -D ExperimentalStart || true -ctest -D ExperimentalConfigure || true -ctest -D ExperimentalBuild || true -ctest -D ExperimentalMemCheck || true - -cd $WORKSPACE/build -if [ -f Testing/TAG ] ; then - find . -iname "*.memcheck" -exec mv {} $WORKSPACE/memcheck \; - mv Testing/`head -n 1 < Testing/TAG`/DynamicAnalysis.xml $WORKSPACE -fi -make clean - -cmake -Denable_documentation=OFF -Denable_lua=OFF -Denable_tracing=ON \ +cmake -Denable_documentation=OFF -Denable_python=OFF \ -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF -Denable_mallocators=OFF \ - -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_model-checking=OFF \ - -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_coverage=ON $WORKSPACE + -Denable_mallocators=OFF \ + -Denable_smpi=ON -Denable_testsuite_smpi_MPICH3=OFF -Denable_testsuite_McMini=OFF -Denable_model-checking=OFF \ + -Denable_ns3=ON \ + -Denable_memcheck_xml=ON -DLTO_EXTRA_FLAG="auto" "$WORKSPACE" -make -ctest -D ExperimentalStart || true -ctest -D ExperimentalConfigure || true -ctest -D ExperimentalBuild || true -ctest -D ExperimentalTest || true -ctest -D ExperimentalCoverage || true +make -j$NUMPROC tests +ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true + +cd "$WORKSPACE"/build if [ -f Testing/TAG ] ; then - /usr/local/gcovr-3.1/scripts/gcovr -r .. --xml-pretty -o $WORKSPACE/xml_coverage.xml - xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_memcheck.xml - mv CTestResults_memcheck.xml $WORKSPACE + find "$WORKSPACE" -iname "*.memcheck" -exec mv {} "$WORKSPACE"/memcheck \; + #remove all "empty" files + grep -r -L "error>" "$WORKSPACE"/memcheck | xargs rm -f + mv Testing/"$(head -n 1 < Testing/TAG)"/Test.xml "$WORKSPACE"/DynamicAnalysis.xml fi - -do_cleanup