From bea0b70ad8c684b78177b389cd44368ef26e030c Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 17 Mar 2022 10:53:55 -0700 Subject: [PATCH] [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 --- .azure-pipelines/gcov.yml | 4 +--- debian/rules | 2 +- tests/gcov_support.sh | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/gcov.yml b/.azure-pipelines/gcov.yml index 0940f82cce5f..37e4371e4a69 100644 --- a/.azure-pipelines/gcov.yml +++ b/.azure-pipelines/gcov.yml @@ -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 @@ -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) diff --git a/debian/rules b/debian/rules index a8a8b835fba6..a594bb54d403 100755 --- a/debian/rules +++ b/debian/rules @@ -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: diff --git a/tests/gcov_support.sh b/tests/gcov_support.sh index 4200e20813b8..d96ee1c25053 100755 --- a/tests/gcov_support.sh +++ b/tests/gcov_support.sh @@ -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