summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBryan Arant <bryanar@microsoft.com>2015-10-21 20:19:51 -0700
committerBryan Arant <bryanar@microsoft.com>2015-10-22 15:26:32 -0700
commit3ff774096c0a6634911db24a8406d3ca1466a289 (patch)
treefa8d6461f471c6fd11ad6ecdf95d38c61fe18849 /tests
parent4be080ee4c52211247d720e24f71d87b657357ee (diff)
downloadcoreclr-3ff774096c0a6634911db24a8406d3ca1466a289.tar.gz
coreclr-3ff774096c0a6634911db24a8406d3ca1466a289.tar.bz2
coreclr-3ff774096c0a6634911db24a8406d3ca1466a289.zip
Changes required to enable crossgen on the tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/buildtest.cmd11
-rw-r--r--tests/src/CLRTest.Execute.Batch.targets51
-rw-r--r--tests/src/dir.props1
3 files changed, 57 insertions, 6 deletions
diff --git a/tests/buildtest.cmd b/tests/buildtest.cmd
index 92d6dc0c1b..6d4f16c1b6 100644
--- a/tests/buildtest.cmd
+++ b/tests/buildtest.cmd
@@ -29,11 +29,16 @@ if /i "%1" == "clean" (set __CleanBuild=1&shift&goto Arg_Loop)
if /i "%1" == "vs2013" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
+if /i "%1" == "crossgen" (set _crossgen=true&shift&goto Arg_Loop)
+if /i "%1" == "priority" (set _priorityvalue=%2&shift&shift&goto Arg_Loop)
+
goto Usage
:ArgsDone
+if defined _crossgen echo Building tests with CrossGen enabled.&set _buildParameters=%_buildParameters% /p:CrossGen=true
+if defined _priorityvalue echo Building Test Priority %_priorityvalue%&set _buildParameters=%_buildParameters% /p:CLRTestPriorityToBuild=%_priorityvalue%
if not defined __BuildArch set __BuildArch=x64
if not defined __BuildType set __BuildType=Debug
@@ -187,7 +192,7 @@ exit /b %ERRORLEVEL%
:build
-%_buildprefix% %_msbuildexe% "%__ProjectFilesDir%\build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diagnostic;LogFile="%__TestManagedBuildLog%";Append %* %_buildpostfix%
+%_buildprefix% %_msbuildexe% "%__ProjectFilesDir%\build.proj" %__MSBCleanBuildArgs% /nologo /maxcpucount /verbosity:minimal /nodeReuse:false %_buildParameters% /fileloggerparameters:Verbosity=diagnostic;LogFile="%__TestManagedBuildLog%";Append %* %_buildpostfix%
IF ERRORLEVEL 1 echo Test build failed. Refer to !__TestManagedBuildLog! for details && exit /b 1
exit /b 0
@@ -200,10 +205,12 @@ exit /b 0
:Usage
echo.
echo Usage:
-echo %0 BuildArch BuildType [clean] [vsversion] where:
+echo %0 BuildArch BuildType [clean] [vsversion] [crossgen] [priority N] where:
echo.
echo BuildArch can be: x64
echo BuildType can be: Debug, Release
echo Clean - optional argument to force a clean build.
echo VSVersion - optional argument to use VS2013 or VS2015 (default VS2015)
+echo CrossGen - Enables the tests to run crossgen on the test executables before executing them.
+echo Priority (N) where N is a number greater than zero that signifies the set of tests that will be built and consequently run.
exit /b 1
diff --git a/tests/src/CLRTest.Execute.Batch.targets b/tests/src/CLRTest.Execute.Batch.targets
index acc1eaf8eb..88ca8797f1 100644
--- a/tests/src/CLRTest.Execute.Batch.targets
+++ b/tests/src/CLRTest.Execute.Batch.targets
@@ -18,6 +18,30 @@ WARNING: When setting properties based on their current state (for example:
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <CLRTestEnvironmentVariable Condition="'$(CrossGen)' == 'true'" Include="set complus_zaprequire=2" />
+ <CLRTestEnvironmentVariable Condition="'$(CrossGen)' == 'true'" Include="set complus_zaprequireexcludelist=corerun" />
+ </ItemGroup>
+ <!--
+ Target: GetBatchCrossgenScript
+ This returns the portion of the execution script that generates the required lines to crossgen the test executable.
+ -->
+ <Target
+ Name="GetCrossgenBatchScript"
+ Returns="$(CrossgenBatchScript)">
+
+ <PropertyGroup>
+<!-- CrossGen will create output if it needs to crossgen. Otherwise there will be silence. -->
+ <CrossgenBatchScript Condition="'$(CLRTestKind)' == 'BuildOnly'
+ OR '$(CLRTestKind)' == 'BuildAndRun'
+ OR '$(CLRTestKind)' == 'SharedLibrary'">
+ <![CDATA[
+if not exist "$(OutputPath)\$(MSBuildProjectName).ni.$(OutputType)" "%CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B. "$(OutputPath)\$(MSBuildProjectName).$(OutputType)"
+ ]]>
+ </CrossgenBatchScript>
+ </PropertyGroup>
+ </Target>
+
<!--
Target: GetExecuteCmdFullPath
Return Executed Cmd Relative Full Path
@@ -49,9 +73,11 @@ WARNING: When setting properties based on their current state (for example:
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)\$(MSBuildProjectName).cmd">
- <PropertyGroup>
+ <CallTarget Targets="GetCrossgenBatchScript" Condition="'$(CrossGen)' == 'true'">
+ <Output TaskParameter="TargetOutputs" PropertyName="CrossgenBatchScript"/>
+ </CallTarget>
- <!-- TODO:2 build in debugger experience support -->
+ <PropertyGroup>
<BatchCLRTestExitCodePrep Condition="$(_CLRTestNeedsToRun)"><![CDATA[
set CLRTestExpectedExitCode=$(CLRTestExitCode)
@@ -103,6 +129,13 @@ IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" (
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
+ <ItemGroup>
+ <CLRTestEnvironmentVariable Condition="'$(CrossGen)' == 'true' AND '$(_CLRTestNeedsProjectToRun)' == 'true'" Include="set complus_zaprequirelist=$(_CLRTestToRunFileFullPath)" />
+ <CLRTestEnvironmentVariable Condition="'$(CrossGen)' == 'true' AND '$(_CLRTestNeedsProjectToRun)' == 'false'" Include="set complus_zaprequirelist=$(MSBuildProjectName)" />
+ </ItemGroup>
+
+
+
<PropertyGroup>
<_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'true'">"$(_CLRTestToRunFileFullPath)"</_CLRTestRunFile>
<_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' And $(_CLRTestNeedsProjectToRun) ">"%CORE_ROOT%\corerun.exe" $(_CLRTestToRunFileFullPath)</_CLRTestRunFile>
@@ -115,9 +148,13 @@ ECHO $(_CLRTestRunFile) %CLRTestExecutionArguments% %Host_Args%
%_DebuggerFullPath% $(_CLRTestRunFile) %CLRTestExecutionArguments% %Host_Args%
set CLRTestExitCode=%ERRORLEVEL%
]]></BatchCLRTestLaunchCmds>
-
+ </PropertyGroup>
+ <PropertyGroup>
+ <BatchEnvironmentVariables>
+@(CLRTestEnvironmentVariable -> '%(Identity)', '%0d%0a')
+ </BatchEnvironmentVariables>
</PropertyGroup>
-
+
<Message Text="MSBuildProjectDirectory:$(MSBuildProjectDirectory)" />
<Message Text="_CLRTestToRunFileFullPath:$(_CLRTestToRunFileFullPath)"/>
<Message Text="_CLRTestRunFile:$(_CLRTestRunFile)" />
@@ -193,6 +230,12 @@ $(BatchCLRTestExitCodePrep)
REM The __TestEnv variable may be used to specify something to run before the test.
IF NOT "%__TestEnv%"=="" call %__TestEnv%
+REM Environment Variables
+$(BatchEnvironmentVariables)
+
+REM CrossGen
+$(CrossgenBatchScript)
+
REM Precommands
$(CLRTestBatchPreCommands)
REM Launch
diff --git a/tests/src/dir.props b/tests/src/dir.props
index 6fe1cd2d1c..8803c7fafd 100644
--- a/tests/src/dir.props
+++ b/tests/src/dir.props
@@ -11,6 +11,7 @@
<NoWarn>78,162,164,168,169,219,251,252,414,429,642,649,652,675,1691,1717,1718,3001,3002,3003,3005,3008</NoWarn>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CLRTestKind>BuildAndRun</CLRTestKind>
+ <SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
</PropertyGroup>
</Project>