diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
commit | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch) | |
tree | 98110734c91668dfdbb126fcc0e15ddbd93738ca /tests/src/CLRTest.Execute.targets | |
parent | fa45f57ed55137c75ac870356a1b8f76c84b229c (diff) | |
download | coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2 coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip |
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'tests/src/CLRTest.Execute.targets')
-rw-r--r-- | tests/src/CLRTest.Execute.targets | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/tests/src/CLRTest.Execute.targets b/tests/src/CLRTest.Execute.targets new file mode 100644 index 0000000000..17cb69f1da --- /dev/null +++ b/tests/src/CLRTest.Execute.targets @@ -0,0 +1,116 @@ +<!-- +*********************************************************************************************** +CLRTest.Execute.targets + +WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have + created a backup copy. Incorrect changes to this file will make it + impossible to load or build your projects from the command-line or the IDE. + +This file contains the logic for providing Execution Script generation. + +*********************************************************************************************** +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + ******************************************************************************************* + PROPERTIES/ITEMS: Used when prepping a test for execution + --> + <!-- Temporary Defaults --> + <PropertyGroup> + <_CLRTestNeedsToRun Condition=" '$(_CLRTestNeedsToRun)' == '' ">true</_CLRTestNeedsToRun> + <_CLRTestBuildsExecutable Condition=" '$(_CLRTestBuildsExecutable)' == '' ">true</_CLRTestBuildsExecutable> + <CLRTestIsHosted Condition=" '$(CLRTestIsHosted)' == '' ">true</CLRTestIsHosted> + <_CLRTestNeedsProjectToRun Condition=" '$(_CLRTestNeedsProjectToRun)' == '' ">false</_CLRTestNeedsProjectToRun> + </PropertyGroup> + + <PropertyGroup> + <!-- TODO:1 Get the right guidance for overriding the default --> + <CLRTestExitCode Condition=" '$(CLRTestExitCode)' == '' ">100</CLRTestExitCode> + </PropertyGroup> + + <ItemDefinitionGroup> + <CLRTestExecutionScriptArgument> + <HasParam>false</HasParam> + </CLRTestExecutionScriptArgument> + </ItemDefinitionGroup> + + <!-- + TASK: GenerateParamList + This task takes a list of CLRTestExecutionScriptArgument items and + returns a string fit for the usage help message. + example: + [-arg1 param1] [-arg2] [-arg3 param3] + --> + <UsingTask + TaskName="GenerateParamList" + TaskFactory="CodeTaskFactory" + AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> + <ParameterGroup> + <ArgumentItems ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true"/> + <ParamList ParameterType="System.String" Output="true"/> + </ParameterGroup> + <Task> + <Reference Include="System.Core"/> + <Using Namespace="System"/> + <Using Namespace="System.Linq"/> + <Code Type="Fragment" Language="cs"><![CDATA[ + Func<string, bool> parseBool = s => + { + bool value; + var success = bool.TryParse(s, out value); + if (success) + return value; + return false; + }; + var items = ArgumentItems.Select(i => new { Item=i, HasParam=parseBool(i.GetMetadata("HasParam"))}); + var noArg = items.Where(i => !i.HasParam).Select(i => new { Identity=i.Item.ItemSpec}); + var haveArg = items.Where(i => i.HasParam).Select(i => new { Identity=i.Item.ItemSpec, Name=i.Item.GetMetadata("ParamName")}); + ParamList = haveArg.Aggregate("", (s,i) => string.Format("{0} [-{1} {2}]", s, i.Identity, i.Name)) + + noArg.Aggregate("", (s,i) => string.Format("{0} [-{1}]", s, i.Identity)); + ]]> + </Code> + </Task> + </UsingTask> + + <!-- + ******************************************************************************************* + TARGET: GenerateExecutionScript + + TODO: get rid of this! + + The PreCheckin system depends directly on this target (boo). This makes sure the script ends up in the right place. + --> + <Target Name="GenerateExecutionScript" + DependsOnTargets="GenerateExecutionScriptsInternal"/> + + <!-- + ******************************************************************************************* + TARGET: GenerateExecutionScriptsInternal + + For tests that "run" we will generate an execution script that wraps any arguments or other + goo. This allows generated .lst files to be very simple and reusable to invoke any "stage" + of test execution. + + Notice this is hooked up to run after targets that generate the stores that are marked with GenerateScripts metadata. + Note also that this means it will run after the first of such targets. + --> + + <ItemGroup> + <ExecutionScriptKind Include="Batch" /> + <ExecutionScriptKind Include="Bash" /> + </ItemGroup> + + <PropertyGroup> + <BashScriptSnippetGen></BashScriptSnippetGen> + <BatchScriptSnippetGen></BatchScriptSnippetGen> + </PropertyGroup> + + <Import Project="CLRTest.CrossGen.targets" /> + <Import Project="CLRTest.GC.targets" /> + <Import Project="CLRTest.Execute.*.targets" /> + + <Target Name="GenerateExecutionScriptsInternal" + Condition="$(_CLRTestNeedsToRun) or $(_CLRTestBuildsExecutable)" + DependsOnTargets="Generate@(ExecutionScriptKind, 'ExecutionScript;Generate')ExecutionScript;" /> + +</Project> |