33# Executable paths for OpenCover
44# Note if OpenCover fails, it won't affect the exit codes.
55$OPENCOVER = Resolve-Path .\packages\OpenCover.* \tools\OpenCover.Console.exe
6- $NUNIT = Resolve-Path .\packages\NUnit.Runners * \tools\" $env: NUNIT " .exe
6+ $NUNIT = Resolve-Path .\packages\NUnit.* \tools\" $env: NUNIT " .exe
77$PY = Get-Command python
88
99# Can't use ".\build\*\Python.EmbeddingTest.dll". Missing framework files.
@@ -13,15 +13,22 @@ $RUNTIME_DIR = ".\src\runtime\bin\"
1313# Run python tests with C# coverage
1414# why `2>&1 | %{ "$_" }`? see: http://stackoverflow.com/a/20950421/5208670
1515Write-Host (" Starting Python tests" ) - ForegroundColor " Green"
16- .$OPENCOVER - register:user - searchdirs:" $RUNTIME_DIR " - output:py.coverage - target:" $PY " - targetargs:src\tests\runtests.py - returntargetcode 2>&1 | % { " $_ " }
16+ .$OPENCOVER - register:user - searchdirs:" $RUNTIME_DIR " - output:py.coverage `
17+ - target:" $PY " - targetargs:src\tests\runtests.py `
18+ - returntargetcode `
19+ 2>&1 | % { " $_ " }
1720$PYTHON_STATUS = $LastExitCode
1821if ($PYTHON_STATUS -ne 0 ) {
1922 Write-Host " Python tests failed, continuing to embedded tests" - ForegroundColor " Red"
2023}
2124
2225# Run Embedded tests with C# coverage
26+ # Powershell continuation: http://stackoverflow.com/a/2608186/5208670
27+ # Powershell options splatting: http://stackoverflow.com/a/24313253/5208670
2328Write-Host (" Starting embedded tests" ) - ForegroundColor " Green"
24- .$OPENCOVER - register:user - searchdirs:" $RUNTIME_DIR " - output:cs.coverage - target:" $NUNIT " - targetargs:" $CS_TESTS " - returntargetcode
29+ .$OPENCOVER - register:user - searchdirs:" $RUNTIME_DIR " - output:cs.coverage `
30+ - target:" $NUNIT " - targetargs:" $CS_TESTS " `
31+ - returntargetcode
2532$NUNIT_STATUS = $LastExitCode
2633if ($NUNIT_STATUS -ne 0 ) {
2734 Write-Host " Embedded tests failed" - ForegroundColor " Red"
0 commit comments