summaryrefslogtreecommitdiff
path: root/tests/src/dir.targets
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@microsoft.com>2015-09-30 12:20:52 -0700
committerBryan P. Arant <bryanar@microsoft.com>2015-10-15 03:15:54 +0000
commit4cf34fe7988ad04eaa7f699a5d0faea8a8394f95 (patch)
tree29cc1fd9de029a9b8a1c0e2f7e57e5a3e568667a /tests/src/dir.targets
parent06579986abb889d2a509be7e2c6370b4fa363fd6 (diff)
downloadcoreclr-4cf34fe7988ad04eaa7f699a5d0faea8a8394f95.tar.gz
coreclr-4cf34fe7988ad04eaa7f699a5d0faea8a8394f95.tar.bz2
coreclr-4cf34fe7988ad04eaa7f699a5d0faea8a8394f95.zip
Changes to Test Infrastructure
The following changes are being submitted in order to prepare for a large collection of tests to be ported from the internal legacy test tree. - Adds "build kinds" to the test tree. - Adds some documentation for the test tree - Adds a Test Priority feature (see documentation Documentation/project-docs/tests.md for more information. - Dropped the cs_template.csproj types and converted to individual CSProject files.
Diffstat (limited to 'tests/src/dir.targets')
-rw-r--r--tests/src/dir.targets81
1 files changed, 76 insertions, 5 deletions
diff --git a/tests/src/dir.targets b/tests/src/dir.targets
index d874ce0959..7224ff5e1e 100644
--- a/tests/src/dir.targets
+++ b/tests/src/dir.targets
@@ -1,12 +1,86 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(OutputType.ToUpper())' == 'EXE'">
+ <_CLRTestBuildsExecutable>true</_CLRTestBuildsExecutable>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(OutputType.ToUpper())' != 'EXE'">
+ <_CLRTestBuildsExecutable>false</_CLRTestBuildsExecutable>
+ </PropertyGroup>
+
+ <!-- All CLRTests need to be of a certain "kind". These kinds are enumerated below.
+ By default all tests are BuildAndRun. This means that the build system will Build them
+ and construct a run-batch-script for them. -->
+ <Choose>
+ <When Condition=" '$(CLRTestKind)'=='BuildAndRun' ">
+ <PropertyGroup>
+ <GenerateRunScript>true</GenerateRunScript>
+ <_CLRTestNeedsToRun>true</_CLRTestNeedsToRun>
+ <_CLRTestCompilesSource>true</_CLRTestCompilesSource>
+ </PropertyGroup>
+ </When>
+ <When Condition=" '$(CLRTestKind)'=='BuildOnly'">
+ <PropertyGroup>
+ <_CLRTestNeedsToRun>false</_CLRTestNeedsToRun>
+ <GenerateRunScript>false</GenerateRunScript>
+ <_CLRTestCompilesSource>true</_CLRTestCompilesSource>
+ </PropertyGroup>
+ </When>
+ <When Condition=" '$(CLRTestKind)'=='RunOnly' ">
+ <PropertyGroup>
+ <GenerateRunScript>true</GenerateRunScript>
+ <SkipSigning>true</SkipSigning>
+ <_CLRTestNeedsToRun>true</_CLRTestNeedsToRun>
+ <_CLRTestCompilesSource>false</_CLRTestCompilesSource>
+ </PropertyGroup>
+ </When>
+ <When Condition=" '$(CLRTestKind)'=='SharedLibrary' Or '$(OutputType)' == 'Library' ">
+ <PropertyGroup>
+ <_CLRTestCompilesSource>true</_CLRTestCompilesSource>
+ <_CLRTestNeedsToRun>false</_CLRTestNeedsToRun>
+ <GenerateRunScript>false</GenerateRunScript>
+ </PropertyGroup>
+ </When>
+ </Choose>
+
+ <PropertyGroup>
+ <_CLRTestNeedsProjectToRun>false</_CLRTestNeedsProjectToRun>
+ <_CLRTestNeedsProjectToRun Condition=" '$(_CLRTestNeedsToRun)' and '!$(_CLRTestBuildsExecutable)' ">true</_CLRTestNeedsProjectToRun>
+ </PropertyGroup>
+
+ <!--
+ If it needs ProjectToRun, turn the project into a ProjectReference so it gets built
+ -->
+ <ItemGroup Condition=" $(_CLRTestNeedsProjectToRun) ">
+ <ProjectReference Include="$(CLRTestProjectToRun)">
+ <Private>false</Private>
+ </ProjectReference>
+ </ItemGroup>
+
<PropertyGroup>
<ErrorIfBuildToolsRestoredFromIndividualProject Condition="!Exists('$(ToolsDir)')">true</ErrorIfBuildToolsRestoredFromIndividualProject>
</PropertyGroup>
<Import Project="..\dir.targets" />
+
+ <Target Name="CreateManifestResourceNames" />
+ <Target Name="CoreCompile" />
- <Import Project="$(ToolsDir)Build.Common.targets" Condition="Exists('$(ToolsDir)Build.Common.targets')" />
+ <!-- If we are a run-only, that depends on another project, this is the "Build" we use. I.e. build all dependency projects, absolutely.
+ OR, in rare conditions (i.e. non-existant ones so far) a run-only script might be something we depend on, and so we may be asked to
+ build a run only for a higher priority testcase.
+ -->
+ <Target Name="Build" Condition="('$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)') Or ('$(_CLRTestInServiceOfHigherPriority)')">
+ <MSBuild Projects="@(ProjectReference)" Properties="_CLRTestInServiceOfHigherPriority=true"/>
+ </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="(Exists('$(ToolsDir)Build.Common.targets') And $(_CLRTestCompilesSource) And '$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)') Or ('$(_CLRTestInServiceOfHigherPriority)')" />
+
+
<Import Project="..\override.targets" Condition="Exists('..\override.targets')"/>
<!-- We enable auto-unification of assembly references after importing the common targets. Binding redirects are not needed
@@ -25,14 +99,11 @@
<!-- TODO (#1122): import this from the ToolsDir once it becomes available -->
<Import Project="$(ProjectDir)src\IL.targets" Condition="'$(ProjectLanguage)' == 'IL'" />
- <PropertyGroup>
- <GenerateRunScript Condition="'$(OutputType.ToUpper())' != 'EXE' And '$(GenerateRunScript)' == ''">false</GenerateRunScript>
- </PropertyGroup>
<Import Project="CLRTest.Execute.targets" />
<Target Name="CreateExecuteScript"
AfterTargets="Build"
- Condition="'$(GenerateRunScript)' != 'false'"
+ Condition="'$(GenerateRunScript)' != 'false' And (('$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)') Or '$(_CLRTestInServiceOfHigherPriority)')"
DependsOnTargets="GenerateExecutionScriptsInternal" />
<PropertyGroup>