Skip to content

Commit

Permalink
Hacking test script
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung committed Aug 19, 2024
1 parent 12969bb commit f047c32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tests/Common/CLRTest.Execute.Batch.targets
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ if not defined CLRTestExecutionArguments (set CLRTestExecutionArguments=$(CLRTes
]]></BatchCLRTestArgPrep>

<!-- By default, be prepared to do a full check -->
<BatchLoopPart2 Condition="'$(CLRTestLoop)' == 'true'"><![CDATA[SET /A RetryCount=%RetryCount%-1
IF NOT "%RetryCount%"=="0" (
GOTO :RetryingRerun
) ELSE (
ECHO END EXECUTION - PASSED BUT ALSO FAILED
ECHO FAILED
popd
Exit /b 1
)]]></BatchLoopPart2>
<BatchCLRTestExitCodeCheck><![CDATA[
ECHO Expected: %CLRTestExpectedExitCode%
ECHO Actual: %CLRTestExitCode%
Expand All @@ -157,6 +166,7 @@ IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" (
) ELSE (
ECHO END EXECUTION - PASSED
ECHO PASSED
$(BatchLoopPart2)
popd
Exit /b 0
)
Expand Down Expand Up @@ -305,6 +315,8 @@ REM Local CoreShim requested - see MSBuild property 'CLRTestScriptLocalCoreShim'
ECHO Copying '%CORE_ROOT%\CoreShim.dll'...
COPY /y %CORE_ROOT%\CoreShim.dll .
]]></BatchCopyCoreShimLocalCmds>
<BatchLoopPart1 Condition="'$(CLRTestLoop)' == 'true'"><![CDATA[SET RetryCount=100
:RetryingRerun]]></BatchLoopPart1>
<BatchCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And $(TargetOS) != 'android'">
<![CDATA[
$(BatchLinkerTestLaunchCmds)
Expand All @@ -323,6 +335,7 @@ if defined RunCrossGen2 (
)
ECHO %LAUNCHER% %ExePath% %CLRTestExecutionArguments%
$(BatchLoopPart1)
%LAUNCHER% %ExePath% %CLRTestExecutionArguments%
set CLRTestExitCode=!ERRORLEVEL!
if defined RunCrossGen2 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<!-- We skip the ReadyToRun tests when sanitized due to build complexity -->
<DisableProjectBuild Condition="'$(EnableNativeSanitizers)' != ''">true</DisableProjectBuild>
<OldToolsVersion>2.0</OldToolsVersion>
<!-- Rerun the test for 100 times or stop if we get a failure -->
<CLRTestLoop>true</CLRTestLoop>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
Expand Down

0 comments on commit f047c32

Please sign in to comment.