A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetics: init fields at declaration, emptying the ctor
[simgrid.git]
/
tools
/
jenkins
/
Coverage.sh
diff --git
a/tools/jenkins/Coverage.sh
b/tools/jenkins/Coverage.sh
index
5055db7
..
2d9a332
100755
(executable)
--- a/
tools/jenkins/Coverage.sh
+++ b/
tools/jenkins/Coverage.sh
@@
-1,14
+1,16
@@
-#!/
bin/
sh
+#!/
usr/bin/env
sh
set -e
set -e
+BUILDFOLDER=$WORKSPACE/build
+
die() {
echo "$@"
exit 1
}
do_cleanup() {
die() {
echo "$@"
exit 1
}
do_cleanup() {
- for d in "$
WORKSPACE/build
"
+ for d in "$
BUILDFOLDER
"
do
if [ -d "$d" ]
then
do
if [ -d "$d" ]
then
@@
-29,14
+31,14
@@
do
fi
done
fi
done
-###
Cleanup previous runs
+###
Cleanup previous runs
! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
do_cleanup
! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
do_cleanup
-for d in "$
WORKSPACE/build
"
+for d in "$
BUILDFOLDER
"
do
mkdir "$d" || die "Could not create $d"
done
do
mkdir "$d" || die "Could not create $d"
done
@@
-44,7
+46,7
@@
done
NUMPROC="$(nproc)" || NUMPROC=1
NUMPROC="$(nproc)" || NUMPROC=1
-cd $
WORKSPACE/build
+cd $
BUILDFOLDER
ctest -D ExperimentalStart || true
ctest -D ExperimentalStart || true
@@
-58,22
+60,26
@@
make -j$NUMPROC
JACOCO_PATH="/usr/local/share/jacoco"
export JAVA_TOOL_OPTIONS="-javaagent:${JACOCO_PATH}/lib/jacocoagent.jar"
JACOCO_PATH="/usr/local/share/jacoco"
export JAVA_TOOL_OPTIONS="-javaagent:${JACOCO_PATH}/lib/jacocoagent.jar"
-ctest -D ExperimentalTest -j$NUMPROC || true
+ctest -
-no-compress-output -
D ExperimentalTest -j$NUMPROC || true
ctest -D ExperimentalCoverage || true
unset JAVA_TOOL_OPTIONS
ctest -D ExperimentalCoverage || true
unset JAVA_TOOL_OPTIONS
-i=0
if [ -f Testing/TAG ] ; then
if [ -f Testing/TAG ] ; then
- for example in app/bittorrent app/centralizedmutex app/masterworker app/pingpong app/tokenring async/yield async/waitall async/dsend cloud/migration cloud/masterworker dht/chord dht/kademlia energy/consumption energy/pstate energy/vm io/file io/storage process/kill process/migration process/startkilltime process/suspend task/priority trace/pingpong
+
+ files=$( find . -name "jacoco.exec" )
+ i=0
+ for file in $files
do
do
+ sourcepath=$( dirname $file )
#convert jacoco reports in xml ones
#convert jacoco reports in xml ones
- ant -f $WORKSPACE/tools/jenkins/jacoco.xml -D
srcdir=$WORKSPACE/examples/java/${example} -Dbuilddir=$WORKSPACE/build/examples/java/${example}
-Djacocodir=${JACOCO_PATH}/lib
+ ant -f $WORKSPACE/tools/jenkins/jacoco.xml -D
examplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar
-Djacocodir=${JACOCO_PATH}/lib
#convert jacoco xml reports in cobertura xml reports
#convert jacoco xml reports in cobertura xml reports
- cover2cover.py $
WORKSPACE/build/examples/java/${example}/report.xml $WORKSPACE/examples/java/
> $WORKSPACE/java_coverage_${i}.xml
-
i=$(($
i + 1))
+ cover2cover.py $
BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java
> $WORKSPACE/java_coverage_${i}.xml
+
i=$((
i + 1))
done
done
+
#convert all gcov reports to xml cobertura reports
gcovr -r .. --xml-pretty -e teshsuite.* -u -o $WORKSPACE/xml_coverage.xml
#convert all gcov reports to xml cobertura reports
gcovr -r .. --xml-pretty -e teshsuite.* -u -o $WORKSPACE/xml_coverage.xml
- xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/
`head -n 1 < Testing/TAG`
/Test.xml > CTestResults_memcheck.xml
+ xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/
$( head -n 1 < Testing/TAG )
/Test.xml > CTestResults_memcheck.xml
mv CTestResults_memcheck.xml $WORKSPACE
fi
mv CTestResults_memcheck.xml $WORKSPACE
fi