Skip to content

Commit bea0b70

Browse files
[gcov]: Change coverage.xml file references (#2120)
* [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 <[email protected]>
1 parent 829b219 commit bea0b70

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.azure-pipelines/gcov.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
variables:
5050
DIFF_COVER_CHECK_THRESHOLD: 0
5151
DIFF_COVER_ENABLE: 'true'
52-
DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/gcov/
5352

5453
container:
5554
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
@@ -106,8 +105,7 @@ jobs:
106105
sudo ./gcov_support.sh generate
107106
sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory)
108107
sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory)
109-
mkdir -p $(System.DefaultWorkingDirectory)/gcov
110-
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/* $(System.DefaultWorkingDirectory)/gcov/
108+
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/coverage.xml $(System.DefaultWorkingDirectory)/
111109
ls -lh $(Build.ArtifactStagingDirectory)
112110
popd
113111
workingDirectory: $(Pipeline.Workspace)

debian/rules

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include /usr/share/dpkg/default.mk
2929

3030
ifeq ($(ENABLE_GCOV), y)
3131
override_dh_auto_configure:
32-
dh_auto_configure -- --enable-gcov
32+
dh_auto_configure -- --enable-gcov CFLAGS="-g -O0" CXXFLAGS="-g -O0"
3333
endif
3434

3535
override_dh_auto_install:

tests/gcov_support.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ lcov_merge_all()
146146
cp $1/lcov_cobertura.py $1/common_work/gcov/
147147
python $1/common_work/gcov/lcov_cobertura.py total.info -o coverage.xml
148148

149-
sed -i "s#common_work/#$1/common_work/#" coverage.xml
149+
sed -i "s#common_work/gcov/##" coverage.xml
150+
sed -i "s#common_work.gcov.##" coverage.xml
150151

151152
cd gcov_output/
152153
if [ ! -d ${ALLMERGE_DIR} ]; then

0 commit comments

Comments
 (0)