summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-test.cmd53
-rw-r--r--tests/build.proj10
-rw-r--r--tests/src/dirs.proj214
3 files changed, 259 insertions, 18 deletions
diff --git a/build-test.cmd b/build-test.cmd
index bd03d6f74d..e65cbcacff 100644
--- a/build-test.cmd
+++ b/build-test.cmd
@@ -51,6 +51,12 @@ set __ZipTests=
set __TargetsWindows=1
set __DoCrossgen=
+@REM CMD has a nasty habit of eating "=" on the argument list, so passing:
+@REM -priority=1
+@REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems,
+@REM and allow the "-priority=1" syntax.
+set __Priority=0
+
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -75,6 +81,7 @@ if /i "%1" == "crossgen" (set __DoCrossgen=1&set processedArgs=!pro
if /i "%1" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "targetsNonWindows" (set __TargetsWindows=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
+if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop)
if [!processedArgs!]==[] (
set __UnprocessedBuildArgs=%__args%
@@ -87,6 +94,9 @@ if [!processedArgs!]==[] (
:ArgsDone
+@REM Special handling for -priority=N argument.
+if %__Priority% GTR 0 (set "__UnprocessedBuildArgs=!__UnprocessedBuildArgs! -priority=%__Priority%")
+
if defined __BuildAgainstPackagesArg (
if not defined __RuntimeID (
echo %__MsgPrefix%Error: When building against packages, you must supply a target Runtime ID.
@@ -267,22 +277,43 @@ if not defined VSINSTALLDIR (
echo %__MsgPrefix%Error: build-test.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
exit /b 1
)
-
+set __AppendToLog=false
set __BuildLogRootName=Tests_Managed
set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err
-set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%"
-set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
-set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
-if errorlevel 1 (
- echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
- echo %__BuildLog%
- echo %__BuildWrn%
- echo %__BuildErr%
- exit /b 1
+REM Execute msbuild test build in stages - workaround for excessive data retention in MSBuild ConfigCache
+REM See https://github.com/Microsoft/msbuild/issues/2993
+
+set __SkipPackageRestore=false
+set __SkipTargetingPackBuild=false
+set __BuildLoopCount=2
+set __TestGroupToBuild=1
+
+if %__Priority% GTR 0 (set __BuildLoopCount=16&set __TestGroupToBuild=2)
+echo %__MsgPrefix%Building tests group %__TestGroupToBuild% with %__BuildLoopCount% subgroups
+
+for /l %%G in (1, 1, %__BuildLoopCount%) do (
+
+ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%";Append=!__AppendToLog!
+ set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%";Append=!__AppendToLog!
+ set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%";Append=!__AppendToLog!
+
+ set TestBuildSlice=%%G
+ call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+
+ if errorlevel 1 (
+ echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
+ echo %__BuildLog%
+ echo %__BuildWrn%
+ echo %__BuildErr%
+ exit /b 1
+ )
+
+ set __SkipPackageRestore=true
+ set __SkipTargetingPackBuild=true
+ set __AppendToLog=true
)
REM Prepare the Test Drop
diff --git a/tests/build.proj b/tests/build.proj
index 43c4997763..aede1317a1 100644
--- a/tests/build.proj
+++ b/tests/build.proj
@@ -9,9 +9,9 @@
</ItemGroup>
<Import Project="dir.targets" />
-
+
<Import Project="dir.traversal.targets" />
-
+
<PropertyGroup>
<TraversalBuildDependsOn>
BatchRestorePackages;
@@ -34,15 +34,15 @@
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\TestWrappersConfig\TestWrappersConfig.csproj" />
</ItemGroup>
- <Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages">
+ <Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages" Condition="$(__SkipTargetingPackBuild) != 'true'">
<Message Text="Building Targeting Pack" Importance="High" />
<Error Text="BuildOS has not been specified. Please do that then run build again." Condition="'$(BuildOS)' == 'AnyOS'" />
<MSBuild Projects="$(MSBuildThisFileDirectory)\src\Common\external\external.depproj" />
</Target>
- <Target Name="BatchRestorePackages">
+ <Target Name="BatchRestorePackages" Condition="$(__SkipPackageRestore) != 'true'">
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." />
-
+
<!-- restore all csproj's with PackageReferences in one pass -->
<MSBuild Projects="build.proj"
Properties="RestoreProj=%(RestoreProjects.Identity)"
diff --git a/tests/src/dirs.proj b/tests/src/dirs.proj
index 6bb138b706..bf3e1888f8 100644
--- a/tests/src/dirs.proj
+++ b/tests/src/dirs.proj
@@ -32,8 +32,9 @@
<DisabledProjects Include="Loader\classloader\generics\regressions\DD117522\Test.csproj" />
<DisabledProjects Include="Loader\classloader\generics\GenericMethods\VSW491668.csproj" /> <!-- issue 5501 -->
</ItemGroup>
-
- <ItemGroup>
+
+ <!-- Unix builds do not support subgroups -->
+ <ItemGroup Condition="$(__BuildOS) != 'Windows_NT' And $(__TestGroupToBuild) == '1' And $(TestBuildSlice) == '1'">
<Project Include="*\**\*.csproj" Exclude="@(DisabledProjects)">
<AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
</Project>
@@ -41,6 +42,215 @@
<AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
</Project>
</ItemGroup>
+
+ <!-- Test build is divided in slices which can be created within Test Group
+ Priority 0 tests are build using Test Group 1 with 2 subgroups or slices -->
+ <ItemGroup Condition="$(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '1' And $(TestBuildSlice) == '1'">
+ <Project Include="*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="$(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '1' And $(TestBuildSlice) == '2'">
+ <Project Include="*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <!-- Test build is divided in slices which can be created within Test Group
+ Priority 1 or higher tests are build using Test Group 2 with 16 subgroups or slices -->
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '1')">
+ <Project Include="baseservices\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="Common\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="baseservices\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="Common\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '2')">
+ <Project Include="CoreMangLib\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="CoreMangLib\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '3')">
+ <Project Include="E*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="GC\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="Interop\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="E*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="GC\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="Interop\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '4')">
+ <Project Include="JIT\B*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\C*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\Directed\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '5')">
+ <Project Include="JIT\B*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\C*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\Directed\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '6')">
+ <Project Include="JIT\Generics\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\*Intrinsics\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\Generics\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\*Intrinsics\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '7')">
+ <Project Include="JIT\IL_Conformance\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\IL_Conformance\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '8')">
+ <Project Include="JIT\jit64\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\jit64\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '9')">
+ <Project Include="JIT\Methodical\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '10')">
+ <Project Include="JIT\Methodical\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '11')">
+ <Project Include="JIT\opt\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\Performance\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\S*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\opt\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\Performance\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="JIT\S*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '12')">
+ <Project Include="JIT\R*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '13')">
+ <Project Include="JIT\R*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '14')">
+ <Project Include="Loader\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '15')">
+ <Project Include="Loader\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
+ <ItemGroup Condition="($(__BuildOS) == 'Windows_NT' And $(__TestGroupToBuild) == '2' And $(TestBuildSlice) == '16')">
+ <Project Include="m*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="p*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="r*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="s*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="t*\**\*.csproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="m*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="p*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="r*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="s*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ <Project Include="t*\**\*.ilproj" Exclude="@(DisabledProjects)">
+ <AdditionalProperties>OSGroup=$(OSGroup)</AdditionalProperties>
+ </Project>
+ </ItemGroup>
+
</Target>
<Import Project="..\dir.traversal.targets" />