Skip to content

Commit

Permalink
[gcov]: Change coverage.xml file references (#2120)
Browse files Browse the repository at this point in the history
* [gcov] In gcov_support.sh, in the final coverage.xml that is generated remove all references to the common_work/gcov/ directory.
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
  • Loading branch information
theasianpianist authored Mar 17, 2022
1 parent 829b219 commit bea0b70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .azure-pipelines/gcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
variables:
DIFF_COVER_CHECK_THRESHOLD: 0
DIFF_COVER_ENABLE: 'true'
DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/gcov/

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
Expand Down Expand Up @@ -106,8 +105,7 @@ jobs:
sudo ./gcov_support.sh generate
sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory)
sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory)
mkdir -p $(System.DefaultWorkingDirectory)/gcov
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/* $(System.DefaultWorkingDirectory)/gcov/
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/coverage.xml $(System.DefaultWorkingDirectory)/
ls -lh $(Build.ArtifactStagingDirectory)
popd
workingDirectory: $(Pipeline.Workspace)
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include /usr/share/dpkg/default.mk

ifeq ($(ENABLE_GCOV), y)
override_dh_auto_configure:
dh_auto_configure -- --enable-gcov
dh_auto_configure -- --enable-gcov CFLAGS="-g -O0" CXXFLAGS="-g -O0"
endif

override_dh_auto_install:
Expand Down
3 changes: 2 additions & 1 deletion tests/gcov_support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ lcov_merge_all()
cp $1/lcov_cobertura.py $1/common_work/gcov/
python $1/common_work/gcov/lcov_cobertura.py total.info -o coverage.xml

sed -i "s#common_work/#$1/common_work/#" coverage.xml
sed -i "s#common_work/gcov/##" coverage.xml
sed -i "s#common_work.gcov.##" coverage.xml

cd gcov_output/
if [ ! -d ${ALLMERGE_DIR} ]; then
Expand Down

0 comments on commit bea0b70

Please sign in to comment.