mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 05:34:31 +02:00
.azurepipelines: Install code coverage tool
For Windows add below tool for code coverage 1. OpenCppCoverage: parsing pdb file to generate coverage data 2. pycobertura: show up html format data for coverage data For Linux add below tool for code coverage 1. lcov: parsing gcda gcno file to generate coverage data 2. lcov-cobertura: convert coverage data to cobertura format 3. pycobertura: show up html format data for coverage data Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Gua Guo <gua.guo@intel.com>
This commit is contained in:
parent
6bb00aa484
commit
89c5d90003
@ -19,4 +19,7 @@ jobs:
|
|||||||
tool_chain_tag: 'GCC5'
|
tool_chain_tag: 'GCC5'
|
||||||
vm_image: 'ubuntu-latest'
|
vm_image: 'ubuntu-latest'
|
||||||
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
|
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
|
||||||
|
extra_install_step:
|
||||||
|
- bash: sudo apt-get install -y lcov
|
||||||
|
displayName: Install Code Coverage Tools
|
||||||
|
condition: and(gt(variables.pkg_count, 0), succeeded())
|
||||||
|
@ -18,3 +18,8 @@ jobs:
|
|||||||
tool_chain_tag: 'VS2019'
|
tool_chain_tag: 'VS2019'
|
||||||
vm_image: 'windows-2019'
|
vm_image: 'windows-2019'
|
||||||
arch_list: "IA32,X64"
|
arch_list: "IA32,X64"
|
||||||
|
extra_install_step:
|
||||||
|
- powershell: choco install opencppcoverage; Write-Host "##vso[task.prependpath]C:\Program Files\OpenCppCoverage"
|
||||||
|
displayName: Install Code Coverage Tool
|
||||||
|
condition: and(gt(variables.pkg_count, 0), succeeded())
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ parameters:
|
|||||||
tool_chain_tag: ''
|
tool_chain_tag: ''
|
||||||
vm_image: ''
|
vm_image: ''
|
||||||
arch_list: ''
|
arch_list: ''
|
||||||
|
extra_install_step: []
|
||||||
|
|
||||||
# Build step
|
# Build step
|
||||||
jobs:
|
jobs:
|
||||||
@ -77,3 +78,38 @@ jobs:
|
|||||||
build_pkgs: $(Build.Pkgs)
|
build_pkgs: $(Build.Pkgs)
|
||||||
build_targets: $(Build.Targets)
|
build_targets: $(Build.Targets)
|
||||||
build_archs: ${{ parameters.arch_list }}
|
build_archs: ${{ parameters.arch_list }}
|
||||||
|
extra_install_step: ${{ parameters.extra_install_step }}
|
||||||
|
|
||||||
|
- job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
|
||||||
|
dependsOn: Build_${{ parameters.tool_chain_tag }}
|
||||||
|
workspace:
|
||||||
|
clean: all
|
||||||
|
|
||||||
|
pool:
|
||||||
|
vmImage: 'windows-2019'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
clean: true
|
||||||
|
fetchDepth: 1
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
displayName: 'Download Build Artifacts'
|
||||||
|
inputs:
|
||||||
|
buildType: 'current'
|
||||||
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
|
||||||
|
- task: CmdLine@2
|
||||||
|
displayName: Create code coverage report
|
||||||
|
inputs:
|
||||||
|
script: |
|
||||||
|
dotnet tool install -g dotnet-reportgenerator-globaltool
|
||||||
|
reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
|
||||||
|
|
||||||
|
- task: PublishCodeCoverageResults@1
|
||||||
|
displayName: 'Publish code coverage'
|
||||||
|
inputs:
|
||||||
|
codeCoverageTool: Cobertura
|
||||||
|
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ parameters:
|
|||||||
build_pkgs: ''
|
build_pkgs: ''
|
||||||
build_targets: ''
|
build_targets: ''
|
||||||
build_archs: ''
|
build_archs: ''
|
||||||
|
extra_install_step: []
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
@ -37,6 +38,8 @@ steps:
|
|||||||
displayName: fetch target branch
|
displayName: fetch target branch
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
condition: eq(variables['Build.Reason'], 'PullRequest')
|
||||||
|
|
||||||
|
- ${{ parameters.extra_install_step }}
|
||||||
|
|
||||||
# trim the package list if this is a PR
|
# trim the package list if this is a PR
|
||||||
- task: CmdLine@1
|
- task: CmdLine@1
|
||||||
displayName: Check if ${{ parameters.build_pkgs }} need testing
|
displayName: Check if ${{ parameters.build_pkgs }} need testing
|
||||||
@ -125,6 +128,7 @@ steps:
|
|||||||
TestSuites.xml
|
TestSuites.xml
|
||||||
**/BUILD_TOOLS_REPORT.html
|
**/BUILD_TOOLS_REPORT.html
|
||||||
**/OVERRIDELOG.TXT
|
**/OVERRIDELOG.TXT
|
||||||
|
coverage.xml
|
||||||
flattenFolders: true
|
flattenFolders: true
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
|
@ -16,3 +16,5 @@ edk2-pytool-library==0.12.1
|
|||||||
edk2-pytool-extensions~=0.20.0
|
edk2-pytool-extensions~=0.20.0
|
||||||
edk2-basetools==0.1.39
|
edk2-basetools==0.1.39
|
||||||
antlr4-python3-runtime==4.7.1
|
antlr4-python3-runtime==4.7.1
|
||||||
|
lcov-cobertura==2.0.2
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user