Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Shell scripts: remove useless variable expansion in arithmetic expressions.
[simgrid.git] / tools / jenkins / Coverage.sh
index a0f0149..a8503ca 100755 (executable)
@@ -31,7 +31,7 @@ do
    fi
 done
 
-### Cleanup previous runs
+### Cleanup previous runs
 
 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
@@ -66,20 +66,20 @@ ctest -D ExperimentalCoverage || true
 unset JAVA_TOOL_OPTIONS
 if [ -f Testing/TAG ] ; then
 
-  files=`find . -name "jacoco.exec"`
+  files=$( find . -name "jacoco.exec" )
   i=0
   for file in $files
   do
-    sourcepath=`dirname $file`
+    sourcepath=$( dirname $file )
     #convert jacoco reports in xml ones
-    ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE/${sourcepath} -Dsimgridsrcdir=$WORKSPACE/src/bindings/java -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
+    ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
     #convert jacoco xml reports in cobertura xml reports
-    cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml $WORKSPACE > $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
 
    #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