Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
unPERLifies a bit the routing: use the object, not its name
[simgrid.git] / tools / jenkins / Coverage.sh
1 #!/bin/sh
2
3 set -e
4
5 die() {
6     echo "$@"
7     exit 1
8 }
9
10 do_cleanup() {
11   for d in "$WORKSPACE/build"
12   do
13     if [ -d "$d" ]
14     then
15       rm -rf "$d" || die "Could not remote $d"
16     fi
17   done
18 }
19
20 ### Check the node installation
21
22 for pkg in xsltproc gcovr
23 do
24    if command -v $pkg
25    then 
26       echo "$pkg is installed. Good."
27    else 
28       die "please install $pkg before proceeding" 
29    fi
30 done
31
32 ###¬†Cleanup previous runs
33
34 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
35 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
36
37 do_cleanup
38
39 for d in "$WORKSPACE/build"
40 do
41   mkdir "$d" || die "Could not create $d"
42 done
43
44 NUMPROC="$(nproc)" || NUMPROC=1
45
46 cd $WORKSPACE/build
47
48 ctest -D ExperimentalStart || true
49
50 cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=ON \
51       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
52       -Denable_jedule=ON -Denable_mallocators=ON \
53       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
54       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=ON $WORKSPACE
55
56 make -j$NUMPROC
57 ctest -D ExperimentalTest -j$NUMPROC || true
58 ctest -D ExperimentalCoverage || true
59
60 if [ -f Testing/TAG ] ; then
61    gcovr -r .. --xml-pretty -e teshsuite.* -u -o $WORKSPACE/xml_coverage.xml
62    xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_memcheck.xml
63    mv CTestResults_memcheck.xml $WORKSPACE
64 fi