Additionally, there is a Visual Studio solution, `<repo_root>\tests\src\AllTestProjects.sln`, where users can build a particular testcase, or all priority 0 testcases that are within it.
+**Building Individual Tests**
+
+Note: buildtest.cmd or build.cmd skipnative skipmscorlib needs to be run atleast once
+
+* Native Test: Build the generated Visual Studio solution or make file corresponding to Test cmake file.
+
+* Managed Test: You can invoke msbuild on the project directly from Visual Studio Command Prompt.
+
**Running Tests**
In a clean command prompt: `<repo_root>\tests\runtest.cmd`
8. Add any other projects as a dependency, if needed.
9. Build the test.
10. Follow the steps to re-run a failed test to validate the new test.
+
+Note:
+
+1. You can disable building of a test per architecture or configuration by using DisableProjectBuild tag in the project. for example:
+
+ ``<PropertyGroup>``
+
+ ``<DisableProjectBuild Condition=" '$(Platform)' == 'arm64' ">true</DisableProjectBuild>``
+
+ ``</PropertyGroup>``
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <OutputType>Library</OutputType>
- <GenerateRunScript>false</GenerateRunScript>
<CLRTestKind>BuildOnly</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
\ No newline at end of file
+ <Target Name="Build" />
+</Project>
<!-- If we are a run-only, that depends on another project, this is the "Build" we use. I.e. build all dependency projects, absolutely.
-->
- <Target Name="Build" Condition="('$(CLRTestKind)'=='RunOnly') And ('$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)')">
+ <PropertyGroup>
+ <BuildAllProjects Condition=" '$(BuildAllProjects)' == ''">false</BuildAllProjects>
+ <_WillCLRTestProjectBuild Condition="'$(_WillCLRTestProjectBuild)' == ''">false</_WillCLRTestProjectBuild>
+ <_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != true">true</_WillCLRTestProjectBuild>
+ <_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' != true And '$(BuildAllProjects)' == true And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true</_WillCLRTestProjectBuild>
+ </PropertyGroup>
+
+ <Target Name="Build" Condition="('$(CLRTestKind)'=='RunOnly') And '$(_WillCLRTestProjectBuild)'">
<MSBuild Projects="@(ProjectReference)" />
<MakeDir Condition="'$(CLRTestKind)' == 'RunOnly'" ContinueOnError="false" Directories="$(OutputPath)" />
</Target>
<!-- We will use an imported build here in the instance that we have source that we need to build, and we are the correct priority...OR if we are being asked to build for
a test with a higher priority. -->
- <Import Project="$(ToolsDir)Build.Common.targets" Condition="('$(CLRTestKind)'!='RunOnly') And (Exists('$(ToolsDir)Build.Common.targets') And $(_CLRTestCompilesSource) And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)')" />
+ <Import Project="$(ToolsDir)Build.Common.targets" Condition="('$(CLRTestKind)'!='RunOnly') And $(_CLRTestCompilesSource) And ('$(_WillCLRTestProjectBuild)')"/>
<Import Project="..\override.targets" Condition="Exists('..\override.targets')"/>
<Import Project="CLRTest.Execute.targets" />
<Target Name="CreateExecuteScript"
AfterTargets="Build"
- Condition="'$(GenerateRunScript)' != 'false' And ('$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)')"
+ Condition="'$(GenerateRunScript)' != 'false' And ('$(_WillCLRTestProjectBuild)')"
DependsOnTargets="GenerateExecutionScriptsInternal" />
<PropertyGroup>