8 [ -n "$WORKSPACE" ] || die "No WORKSPACE"
9 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
11 echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
21 BUILDFOLDER=$WORKSPACE/build
23 ### Check the node installation
30 echo "$pkg is installed. Good."
32 die "please install $pkg before proceeding"
37 pkg_check xsltproc gcovr ant cover2cover.py
39 ### Cleanup previous runs
46 rm -rf "$d" || die "Could not remove $d"
48 mkdir "$d" || die "Could not create $d"
52 do_cleanup "$BUILDFOLDER"
54 NUMPROC="$(nproc)" || NUMPROC=1
60 rm -rf xml_coverage.xml
62 ctest -D ExperimentalStart || true
64 cmake -Denable_documentation=OFF \
65 -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
66 -Denable_mallocators=ON \
68 -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
69 -Denable_smpi_papi=ON \
70 -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_MBI_testsuite=ON \
71 -Denable_coverage=ON -DLTO_EXTRA_FLAG="auto" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "$WORKSPACE"
73 #build with sonarqube scanner wrapper
74 /home/ci/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-outputs make -j$NUMPROC tests
75 JACOCO_PATH="/usr/local/share/jacoco"
76 export JAVA_TOOL_OPTIONS="-javaagent:${JACOCO_PATH}/lib/jacocoagent.jar"
78 export PYTHON_TOOL_OPTIONS="/usr/bin/python3-coverage run --parallel-mode --branch"
80 ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
81 ctest -D ExperimentalCoverage || true
83 unset JAVA_TOOL_OPTIONS
84 if [ -f Testing/TAG ] ; then
86 files=$( find . -size +1c -name "jacoco.exec" )
90 sourcepath=$( dirname "$file" )
91 #convert jacoco reports in xml ones
92 ant -f "$WORKSPACE"/tools/jenkins/jacoco.xml -Dexamplesrcdir="$WORKSPACE" -Dbuilddir="$BUILDFOLDER"/"${sourcepath}" -Djarfile="$BUILDFOLDER"/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
93 #convert jacoco xml reports in cobertura xml reports
94 cover2cover.py "$BUILDFOLDER"/"${sourcepath}"/report.xml .. ../src/bindings/java src/bindings/java > "$BUILDFOLDER"/java_coverage_${i}.xml
95 #save jacoco xml report as sonar only allows it
96 mv "$BUILDFOLDER"/"${sourcepath}"/report.xml "$BUILDFOLDER"/jacoco_cov_${i}.xml
100 #convert python coverage reports in xml ones
102 find .. -size +1c -name ".coverage*" -exec mv {} . \;
103 /usr/bin/python3-coverage combine
104 /usr/bin/python3-coverage xml -i -o ./python_coverage.xml
106 #convert all gcov reports to xml cobertura reports
107 gcovr -r "$WORKSPACE" --xml-pretty -e "$WORKSPACE"/teshsuite -e MBI -e "$WORKSPACE"/examples/smpi/NAS -e "$WORKSPACE"/examples/smpi/mc -u -o xml_coverage.xml --gcov-ignore-parse-errors
110 xsltproc "$WORKSPACE"/tools/jenkins/ctest2junit.xsl build/Testing/"$( head -n 1 < build/Testing/TAG )"/Test.xml > CTestResults_memcheck.xml
112 #generate sloccount report
113 sloccount --duplicates --wide --details "$WORKSPACE" | grep -v -e '.git' -e 'mpich3-test' -e 'sloccount.sc' -e 'build/' -e 'xml_coverage.xml' -e 'CTestResults_memcheck.xml' -e 'DynamicAnalysis.xml' > "$WORKSPACE"/sloccount.sc
115 #generate PVS-studio report
116 EXCLUDEDPATH="-e $WORKSPACE/src/include/catch.hpp -e $WORKSPACE/src/include/xxhash.hpp -e $WORKSPACE/teshsuite/smpi/mpich3-test/ -e *_dtd.c -e *_dtd.h -e *.yy.c -e *.tab.cacc -e *.tab.hacc -e $WORKSPACE/src/smpi/colls/ -e $WORKSPACE/examples/smpi/NAS/ -e $WORKSPACE/examples/smpi/gemm/gemm.c -e $WORKSPACE/src/msg/ -e $WORKSPACE/include/msg/ -e $WORKSPACE/examples/deprecated/ -e $WORKSPACE/teshsuite/msg/"
117 pvs-studio-analyzer analyze -f "$BUILDFOLDER"/compile_commands.json -o "$WORKSPACE"/pvs.log $EXCLUDEDPATH -j$NUMPROC
119 # V521 Such expressions using the ',' operator are dangerous. (-> commas in catch.hpp),
120 # V576 Incorrect format. (-> gives false alarms, and already checked elsewhere)
121 # V1042 This file is marked with copyleft license, which requires you to open the derived source code.
122 # V1056 The predefined identifier '__func__' always contains the string 'operator()' inside function body of the overloaded 'operator()'.
123 plog-converter -t xml -o "$WORKSPACE"/pvs.plog -d V521,V576,V1042,V1056 "$WORKSPACE"/pvs.log