mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
* added the runcoverage powershell script * updated the run coverage script. added installation to the windows CI for trying * exclude other parts of win ci * fix in the download script * fix in the download script * fix in the download script * fix in the download script * fix in the download script * fix in the download script * fix in the download script * fix in the download script * fix in the download script * added the runtestcoverage script to the pipeline * some typo fix * formatting * re-commenting previously commented block * cleaned up the powershell script * fix path in pipeline * fix path in pipeline * fixed model path * some fixes * excluded long running tests * add the publish job * uncomment other tasks * fixed excluded tests * some format correction * stopped running the test debug * try placing the tes-all at the beginning * try running the failing test only * edit run_coverage * some fix * skip onnx_model_test * Added memory size log in powershell script * try running the onnxruntime_test_all.exe separately from codecov * enable error reporting, and double memory size in powershell * corrected the set-item * remove memory resize, since we are already at max 2 GB * fixed the tvm.dll issue * added back the onnx tests in codecov. added back the regular test run * cleanup * remove * from the the module path * add junction target resolution for modules dir * remove junction-resolution * reduced tests * added target extraction for the junction paths in build machine * added the appropriate change in win ci pipeline to call the updated ps script * fix typo * added back all the tests that were disabled * try fixing the source root * cleanup and enable all tests * increase timeout for windows CPU CI due to codecoverage * templatized the code coverage steps. Conitnue on error with any codecoverage step * change quote marks
79 lines
3.2 KiB
PowerShell
79 lines
3.2 KiB
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
|
|
# Runs OpenCppCoverage for the Lotus unit tests and ONNX tests, and merges the coverage from all test runs.
|
|
Param(
|
|
[Parameter(Mandatory=$true, HelpMessage="OpenCppCoverage exe.")][string]$OpenCppCoverageExe,
|
|
[Parameter(Mandatory=$true, HelpMessage="Lotus enlistment root.")][string]$SourceRoot,
|
|
[Parameter(Mandatory=$true, HelpMessage="Build root.")][string]$BuildRoot,
|
|
[Parameter(Mandatory=$false, HelpMessage="IsLocalBuild")][switch]$LocalBuild = $true
|
|
)
|
|
|
|
if (-not $LocalBuild) {
|
|
# This is a hack to get the target path of the junctions in the build machine, lacking a neater way to do this.
|
|
# Assumes that the junction is 2 level upper from the SourceRoot/BuildRoot
|
|
# This is needed, because apparently the OpenCppCoverage cannot load the PDB symbol files from a junction
|
|
|
|
$buildLeaf = Split-Path $BuildRoot -Leaf
|
|
$buildParent = Split-Path $BuildRoot -Parent
|
|
$buildParentLeaf = Split-Path $buildParent -Leaf
|
|
$buildParentParent = Split-Path $buildParent -Parent
|
|
$buildParentParentTarget = Get-Item $buildParentParent | Select-Object -ExpandProperty Target
|
|
|
|
$BuildRoot = Join-Path $buildParentParentTarget $buildParentLeaf
|
|
$BuildRoot = Join-Path $BuildRoot $buildLeaf
|
|
}
|
|
|
|
$coreSources = Join-Path $SourceRoot "onnxruntime\core"
|
|
$headerSources = Join-Path $SourceRoot "include"
|
|
$buildDir = Join-Path $BuildRoot "Debug\Debug"
|
|
|
|
function RunTest([string]$test_cmd, [string[]]$test_cmd_args, [string[]]$export_types, [string[]]$inputs)
|
|
{
|
|
$cmd = "$OpenCppCoverageExe"
|
|
$cmdParams = @("--sources=$headerSources","--sources=$coreSources","--modules=$buildDir","--working_dir=$buildDir")
|
|
|
|
foreach($input in $inputs)
|
|
{
|
|
$inputPath = Join-Path $buildDir $input
|
|
$cmdParams += "--input_coverage=$inputPath"
|
|
}
|
|
|
|
foreach($export_type in $export_types)
|
|
{
|
|
$cmdParams += "--export_type=$export_type"
|
|
}
|
|
|
|
$cmdParams += @("--","$test_cmd")
|
|
$cmdParams += $test_cmd_args
|
|
|
|
& $cmd $cmdParams
|
|
}
|
|
|
|
# generate cobertura xml output and html report
|
|
$outputXml = Join-Path $buildDir "cobertura.xml"
|
|
$outputDir = Join-Path $buildDir "OpenCppCoverageResults"
|
|
$modelDir = Join-Path $BuildRoot "models"
|
|
|
|
|
|
# ONNX test runner tests.
|
|
$onnx_test_runner = Join-Path $buildDir "onnx_test_runner.exe"
|
|
RunTest $onnx_test_runner ($modelDir) ("binary:" + (Join-Path $buildDir "onnx_test_runner.cov"))
|
|
|
|
|
|
# C-API/Shared-lib test
|
|
$shared_lib_test = Join-Path $buildDir "onnxruntime_shared_lib_test.exe"
|
|
RunTest $shared_lib_test @() ("binary:" + (Join-Path $buildDir "onnxruntime_shared_lib_test.cov"))
|
|
|
|
|
|
# MLAS test
|
|
$mlas_test = Join-Path $buildDir "onnxruntime_mlas_test.exe"
|
|
RunTest $mlas_test @() ("binary:" + (Join-Path $buildDir "onnxruntime_mlas_test.cov"))
|
|
|
|
# Lotus unit tests
|
|
# need to copy the tvm.dll, since it is not in the buildDir path
|
|
Copy-Item -Path $BuildRoot\Debug\external\tvm\Debug\tvm.dll -Destination $buildDir
|
|
|
|
$onnxruntime_test_all = Join-Path $buildDir "onnxruntime_test_all.exe"
|
|
RunTest $onnxruntime_test_all @() ("cobertura:$outputXml","html:$outputDir") ("onnxruntime_shared_lib_test.cov","onnx_test_runner.cov","onnxruntime_mlas_test.cov")
|
|
|