Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
[release/2.2] Use runtest.py to run tests for all platforms (#19213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarret Shook authored and echesakov committed Oct 23, 2018
1 parent 3b39011 commit 3552dad
Show file tree
Hide file tree
Showing 10 changed files with 2,613 additions and 794 deletions.
26 changes: 25 additions & 1 deletion init-tools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,33 @@ echo Running %0 > "%INIT_TOOLS_LOG%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
if exist "%DOTNET_CMD%" goto :afterdotnetrestore

REM Use x86 tools on arm64 and x86.
REM arm32 host is not currently supported, please crossbuild.
if /i "%PROCESSOR_ARCHITECTURE%" == "arm" (
echo "Error, arm32 arch not supported for build tools."
exit /b 1
)

if /i "%PROCESSOR_ARCHITECTURE%" == "amd64" (
set _Arch="x64"
goto ArchSet
)

REM If this is not amd64 and not arm, then we should be running on arm64 or x86
REM either way we can (and should) use the x86 dotnet cli
REM
REM TODO: consume native arm64 toolset, blocked by official arm64 windows cli
REM : release. See https://github.com/dotnet/coreclr/issues/19614 for more
REM : information
set _Arch="x86"

echo "init-tools.cmd: Setting arch to %_Arch% for build tools"

:ArchSet

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-x64.zip
set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-%_Arch%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.azureedge.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
Expand Down
8 changes: 0 additions & 8 deletions tests/arm/Tests.lst
Original file line number Diff line number Diff line change
Expand Up @@ -53340,14 +53340,6 @@ MaxAllowedDurationSeconds=600
Categories=EXPECTED_PASS;Pri1
HostStyle=0

[b12011.cmd_6691]
RelativePath=JIT\Regression\VS-ia64-JIT\V1.2-M02\b12011\b12011\b12011.cmd
WorkingDir=JIT\Regression\VS-ia64-JIT\V1.2-M02\b12011\b12011
Expected=0
MaxAllowedDurationSeconds=600
Categories=EXPECTED_PASS
HostStyle=0

[FlowControlNext.cmd_6692]
RelativePath=CoreMangLib\cti\system\reflection\emit\flowcontrol\FlowControlNext\FlowControlNext.cmd
WorkingDir=CoreMangLib\cti\system\reflection\emit\flowcontrol\FlowControlNext
Expand Down
8 changes: 0 additions & 8 deletions tests/arm64/Tests.lst
Original file line number Diff line number Diff line change
Expand Up @@ -70452,14 +70452,6 @@ MaxAllowedDurationSeconds=600
Categories=JIT;EXPECTED_PASS
HostStyle=0

[b12011.cmd_9160]
RelativePath=JIT\Regression\VS-ia64-JIT\V1.2-M02\b12011\b12011\b12011.cmd
WorkingDir=JIT\Regression\VS-ia64-JIT\V1.2-M02\b12011\b12011
Expected=0
MaxAllowedDurationSeconds=600
Categories=EXPECTED_PASS
HostStyle=0

[b14355.cmd_9161]
RelativePath=JIT\Regression\VS-ia64-JIT\V1.2-M02\b14355\b14355\b14355.cmd
WorkingDir=JIT\Regression\VS-ia64-JIT\V1.2-M02\b14355\b14355
Expand Down
1,495 changes: 848 additions & 647 deletions tests/issues.targets

Large diffs are not rendered by default.

76 changes: 75 additions & 1 deletion tests/runtest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ set __CollectDumps=
set __DoCrossgen=
set __CrossgenAltJit=
set __PerfTests=
set __SkipGenerateLayout=
set __BuildXUnitWrappers=

:Arg_Loop
if "%1" == "" goto ArgsDone
Expand Down Expand Up @@ -76,6 +78,8 @@ if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&goto Arg_
if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop)
if /i "%1" == "ilasmroundtrip" (set __IlasmRoundTrip=1&shift&goto Arg_Loop)
if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&shift&goto Arg_Loop)
if /i "%1" == "skipgeneratelayout" (set __SkipGenerateLayout=1&shift&goto Arg_Loop)
if /i "%1" == "buildxunitwrappers" (set __BuildXunitWrappers=1&shift&goto Arg_Loop)
if /i "%1" == "PerfTests" (set __PerfTests=true&shift&goto Arg_Loop)
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift&goto Arg_Loop)
Expand All @@ -85,7 +89,7 @@ if /i "%1" == "gcname" (set COMPlus_GCName=%2&shift&shift&goto Ar
if /i "%1" == "timeout" (set __TestTimeout=%2&shift&shift&goto Arg_Loop)

REM change it to COMPlus_GCStress when we stop using xunit harness
if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
if /i "%1" == "gcstresslevel" (set COMPlus_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop)

if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
Expand Down Expand Up @@ -119,6 +123,76 @@ set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildTyp
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
if not defined XunitTestReportDirBase set XunitTestReportDirBase=%XunitTestBinBase%\Reports\

REM At this point in the script there will be a divergence in how the tests are run.
REM For official builds we will continue to run tests using the un-unified scripting
REM which relies on msbuild and calls runtest.proj directly. For all other scenarios
REM runtest.py will handle setup and will then call runtest.proj

if defined __AgainstPackages goto SetupMSBuildAndCallRuntestProj
if "%__PerfTests%"=="true" goto SetupMSBuildAndCallRuntestProj
if defined __GenerateLayoutOnly goto SetupMSBuildAndCallRuntestProj

REM We are not running in the official build scenario, call runtest.py

set __RuntestPyArgs=-arch %__BuildArch% -build_type %__BuildType%

if defined DoLink (
set __RuntestPyArgs=%__RuntestPyArgs% --il_link
)

if defined __LongGCTests (
set __RuntestPyArgs=%__RuntestPyArgs% --long_gc
)

if defined __GCSimulatorTests (
set __RuntestPyArgs=%__RuntestPyArgs% --gcsimulator
)

if defined __JitDisasm (
set __RuntestPyArgs=%__RuntestPyArgs% --jitdisasm
)

if defined __IlasmRoundTrip (
set __RuntestPyArgs=%__RuntestPyArgs% --ilasmroundtrip
)

if defined __TestEnv (
set __RuntestPyArgs=%__RuntestPyArgs% -test_env %__TestEnv%
)

if defined __Sequential (
set __RuntestPyArgs=%__RuntestPyArgs% --sequential
)

if not defined __SkipGenerateLayout (
set __RuntestPyArgs=%__RuntestPyArgs% --generate_layout
)

if defined __GenerateLayoutOnly (
set __RuntestPyArgs=%__RuntestPyArgs% --generate_layout_only
)

if defined __BuildXUnitWrappers (
set __RuntestPyArgs=%__RuntestPyArgs% --build_xunit_test_wrappers
)

if defined RunCrossGen (
set __RuntestPyArgs=%__RuntestPyArgs% --run_crossgen_tests
)

if defined __DoCrossgen (
set __RuntestPyArgs=%__RuntestPyArgs% --precompile_core_root
)

REM __ProjectDir is poorly named, it is actually <projectDir>/tests
set NEXTCMD=python "%__ProjectDir%\runtest.py" %__RuntestPyArgs%
echo !NEXTCMD!
!NEXTCMD!

exit /b %ERRORLEVEL%

:SetupMSBuildAndCallRuntestProj

:: Set up msbuild and tools environment. Check if msbuild and VS exist.

set _msbuildexe=
Expand Down
3 changes: 3 additions & 0 deletions tests/runtest.proj
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
<AllXUnitFacts Include= "%(AllCommands._XunitFact)" />
</ItemGroup>

<Message Text="HasExcludes: $(HaveExcludes)" Importance="high"/>
<Message Text="CanonicalExcludeList: @(CanonicalExcludeList)" Importance="high"/>

</Target>

<Target Name="CreateAllWrappers" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
Expand Down
Loading

0 comments on commit 3552dad

Please sign in to comment.