File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ # Replaces 'ldc.i4.s 100' with 'ldc.i4.m1, nop' to fix incorrect termination of the test host
2+ # https://github.com/Microsoft/vstest/issues/1900
3+
4+ $file = Join-Path $PSScriptRoot ' ..\Tools\dotnetcli\sdk\2.1.503\Microsoft.TestPlatform.CrossPlatEngine.dll' ;
5+ $bytes = [System.IO.File ]::ReadAllBytes($file );
6+ If ($bytes [0xE259 ] -eq 0x15 -and $bytes [0xE25A ] -eq 0x00 ) {
7+ # Already patched
8+ Exit 0
9+ }
10+
11+ If ($bytes [0xE259 ] -ne 0x1F -or $bytes [0xE25A ] -ne 0x64 ) {
12+ # Unexpected file
13+ Exit 1
14+ }
15+
16+ $bytes [0xE259 ] = 0x15 ;
17+ $bytes [0xE25A ] = 0x00 ;
18+ [System.IO.File ]::WriteAllBytes($file , $bytes );
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ phases:
4040 - ${{ if eq(parameters.name, 'MacOS') }} :
4141 - script : brew update && brew install libomp mono-libgdiplus gettext && brew link gettext --force
4242 displayName : Install runtime dependencies
43+ - powershell : $(Build.SourcesDirectory)/build/PatchVSTestConsole.ps1
44+ displayName : Hot patch vstest.console
45+ condition : and(succeeded(), eq(variables._codeCoverage, 'true'))
4346 - script : $(_buildScript) -$(_configuration) -runtests -coverage=$(_codeCoverage)
4447 displayName : Run Tests.
4548 - script : $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet msbuild build/Codecoverage.proj /p:CodeCovToken=$(CODECOV_TOKEN)
You can’t perform that action at this time.
0 commit comments