summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/publishdependency.targets183
-rw-r--r--tests/runtest.cmd9
-rw-r--r--tests/runtest.proj22
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj15
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/project.json32
-rw-r--r--tests/src/Common/targeting_pack_ref/project.json22
-rw-r--r--tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj12
7 files changed, 290 insertions, 5 deletions
diff --git a/tests/publishdependency.targets b/tests/publishdependency.targets
index 997a5237d4..9e286fc3ba 100644
--- a/tests/publishdependency.targets
+++ b/tests/publishdependency.targets
@@ -8,13 +8,45 @@
</TestTargetFramework>
</ItemGroup>
+ <PropertyGroup>
+ <!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
+ <PackagePlatform Condition="'$(PackagePlatform)' == ''">$(__BuildArch)</PackagePlatform>
+ <PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform>
+ <MinOSForArch>win7</MinOSForArch>
+ <MinOSForArch Condition="'$(PackagePlatform)' == 'arm'">win8</MinOSForArch>
+ <MinOSForArch Condition="'$(PackagePlatform)' == 'arm64'">win10</MinOSForArch>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/>
+ </ItemGroup>
+
<ItemGroup>
- <ProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/>
- <ProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/>
+ <NonWindowsProjectLockJsonFiles Include="@(CoreRootProjectLockJsonFiles)"/>
+ <NonWindowsProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/>
</ItemGroup>
+ <ItemGroup>
+ <RefProjectLockJsonFiles Include="$(SourceDir)Common\targeting_pack_ref\project.lock.json"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProductProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <CrossGenFiles Include="..\packages\runtime.$(MinOSForArch)-$(PackagePlatform).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen.exe"/>
+ </ItemGroup>
+
+ <PropertyGroup>
+ <ProductDestination>$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)</ProductDestination>
+ <RefDestination>$(ProductDestination)\ref</RefDestination>
+ <CoreOverlay>$(CORE_ROOT)\..\coreoverlay</CoreOverlay>
+ </PropertyGroup>
+
<Target Name="CopyDependecyToCoreRoot"
- Inputs="@(ProjectLockJsonFiles)"
+ Inputs="@(CoreRootProjectLockJsonFiles)"
Outputs="$(CORE_ROOT)\*.*">
<MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/>
@@ -28,7 +60,7 @@
NuGetPackagesDirectory="$(PackagesDir)"
RuntimeIdentifier="$(TestNugetRuntimeId)"
ProjectLanguage="$(Language)"
- ProjectLockFile="%(ProjectLockJsonFiles.Identity)"
+ ProjectLockFile="%(CoreRootProjectLockJsonFiles.Identity)"
TargetMonikers="@(TestTargetFramework)">
<Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
<Output TaskParameter="ResolvedReferences" ItemName="Reference" />
@@ -58,4 +90,147 @@
</Copy>
</Target>
+ <Target Name="CopyNonWindowsDependecyToCoreRoot"
+ Inputs="@(NonWindowsProjectLockJsonFiles)"
+ Outputs="$(CoreOverlay)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/>
+
+ <MSBuild Projects="$(SourceDir)Common\test_dependencies\test_dependencies.csproj"/>
+
+ <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(RuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(NonWindowsProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+ <ItemGroup>
+ <RunTimeDependecyExclude Include="$(CoreOverlay)\**\*.*" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName)%(Extension)')" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).ni%(Extension)')" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).pdb')" />
+ <AllResolvedRuntimeDependencies Include="@(RunTimeCopyLocal -> '%(FileName)%(Extension)')">
+ <File>%(Identity)</File>
+ </AllResolvedRuntimeDependencies>
+ <RunTimeDependecyCopyLocalFile Include="@(AllResolvedRuntimeDependencies)" Exclude="@(RunTimeDependecyExcludeFiles)"/>
+ <RunTimeDependecyCopyLocal Include="@(RunTimeDependecyCopyLocalFile -> '%(File)')" />
+ </ItemGroup>
+
+ <Copy
+ SourceFiles="@(RunTimeDependecyCopyLocal)"
+ DestinationFolder="$(CoreOverlay)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ <ItemGroup>
+ <NonWindowsCrossGenFiles Include="..\packages\runtime.$(RuntimeID).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen"/>
+ </ItemGroup>
+
+ <Copy
+ SourceFiles="@(NonWindowsCrossGenFiles)"
+ DestinationFolder="$(CoreOverlay)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ </Target>
+
+ <Target Name="CopyDependencyToRef"
+ Inputs="@(RefProjectLockJsonFiles)"
+ Outputs="$(RefDestination)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\targeting_pack_ref\targeting_pack_ref.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(TestNugetRuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(RefProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="RefReference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+
+ <Copy
+ SourceFiles="@(RefRunTimeCopyLocal)"
+ DestinationFolder="$(RefDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+ </Target>
+
+ <Target Name="CopyDependencyToProduct"
+ Inputs="@(ProductProjectLockJsonFiles)"
+ Outputs="$(ProductDestination)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(TestNugetRuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(ProductProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="RefReference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+
+ <Copy
+ SourceFiles="@(RefRunTimeCopyLocal)"
+ DestinationFolder="$(ProductDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+ </Target>
+
+ <Target Name="CopyCrossgenToProduct"
+ Outputs="$(ProductDestination)\crossgen.exe;$(CoreOverlay)\crossgen.exe">
+
+ <Copy
+ SourceFiles="@(CrossGenFiles)"
+ DestinationFolder="$(ProductDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ </Target>
+
</Project>
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index ebb038e9eb..2ffd7bc12a 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -31,6 +31,7 @@ set __Sequential=
set __msbuildExtraArgs=
set __LongGCTests=
set __GCSimulatorTests=
+set __AgainstPackages=
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -56,6 +57,7 @@ if /i "%1" == "SkipWrapperGeneration" (set __SkipWrapperGeneration=true&shift&go
if /i "%1" == "Exclude" (set __Exclude=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "Exclude0" (set __Exclude0=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "TestEnv" (set __TestEnv=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "AgainstPackages" (set __AgainstPackages=1&shift&goto Arg_Loop)
if /i "%1" == "sequential" (set __Sequential=1&shift&goto Arg_Loop)
if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop)
if /i "%1" == "longgc" (set __LongGCTests=1&shift&goto Arg_Loop)
@@ -68,7 +70,7 @@ if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&set __SkipWrap
if /i "%1" == "PerfTests" (set __PerfTests=true&set __SkipWrapperGeneration=true&shift&goto Arg_Loop)
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
REM change it to COMPlus_GCStress when we stop using xunit harness
-if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
+if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
:: All the rest of the args will be collected and passed directly to msbuild.
@@ -143,6 +145,10 @@ if not defined __Sequential (
set __msbuildCommonArgs=%__msbuildCommonArgs% /p:ParallelRun=false
)
+if defined __AgainstPackages (
+ set __msbuildCommonArgs=%__msbuildCommonArgs% /p:BuildTestsAgainstPackages=true
+)
+
REM Prepare the Test Drop
REM Cleans any NI from the last run
powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
@@ -361,6 +367,7 @@ echo Set to "" to disable default exclusion file.
echo Exclude- Optional parameter - this will exclude individual tests from running, specified by ExcludeList ItemGroup in an .targets file.
echo TestEnv- Optional parameter - this will run a custom script to set custom test environment settings.
echo VSVersion- Optional parameter - VS2013 or VS2015 ^(default: VS2015^)
+echo AgainstPackages - Optional parameter - this indicates that we are running tests that were built against packages
echo GenerateLayoutOnly - If specified will not run the tests and will only create the Runtime Dependency Layout
echo RunCrossgenTests - Runs ReadytoRun tests
echo jitstress n - Runs the tests with COMPlus_JitStress=n
diff --git a/tests/runtest.proj b/tests/runtest.proj
index e1c07e4101..acc4545d92 100644
--- a/tests/runtest.proj
+++ b/tests/runtest.proj
@@ -323,6 +323,28 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
Properties="Language=C#" />
</Target>
+ <Target Name="CreateNonWindowsTestOverlay">
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyNonWindowsDependecyToCoreRoot"
+ Properties="Language=C#;NonWindowsRuntimeId=$(NonWindowsRuntimeId)" />
+ </Target>
+
+ <Target Name="BinPlaceRef">
+ <!-- Copy mscorlib.dll from TargetingPack to bin/Product/ref, if we're building against packages -->
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyDependencyToRef"
+ Properties="Language=C#"
+ Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
+ </Target>
+
+ <Target Name="BinPlaceProduct">
+ <!-- Copy test dependencies to bin/Product, if we're building against packages -->
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyDependencyToProduct"
+ Properties="Language=C#"
+ Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
+ </Target>
+
<!-- All the test projects need to add dependency to currently built runtime as they require that to run.
In addition the version number of built runtime can change so all project.json needs to be dynamically generated.
Instead the following task creates a project.json with dependencies like Microsoft.netcore.runtime.coreclr ..etc.
diff --git a/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
new file mode 100644
index 0000000000..63c54488f2
--- /dev/null
+++ b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ </PropertyGroup>
+ <ItemGroup>
+ <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>
diff --git a/tests/src/Common/build_against_pkg_dependencies/project.json b/tests/src/Common/build_against_pkg_dependencies/project.json
new file mode 100644
index 0000000000..16c6045923
--- /dev/null
+++ b/tests/src/Common/build_against_pkg_dependencies/project.json
@@ -0,0 +1,32 @@
+{
+ "dependencies": {
+ "Microsoft.NETCore.ILAsm": "1.2.0-beta-24616-02",
+ "Microsoft.NETCore.ILDAsm": "1.2.0-beta-24616-02",
+ "Microsoft.NETCore.Jit": "1.2.0-beta-24616-02",
+ "Microsoft.NETCore.Runtime.CoreCLR": "1.2.0-beta-24616-02",
+ "Microsoft.NETCore.TestHost": "1.2.0-beta-24616-02"
+ },
+ "frameworks": {
+ "netcoreapp1.0": {
+ "imports": [
+ "dnxcore50",
+ "portable-net45+win8"
+ ]
+ }
+ },
+ "runtimes": {
+ "win7-x86": {},
+ "win7-x64": {},
+ "win10-arm64": {},
+ "ubuntu.14.04-x64": {},
+ "ubuntu.16.04-x64": {},
+ "ubuntu.16.10-x64": {},
+ "osx.10.10-x64": {},
+ "centos.7-x64": {},
+ "rhel.7-x64": {},
+ "debian.8-x64": {},
+ "fedora.23-x64": {},
+ "opensuse.13.2-x64": {},
+ "opensuse.42.1-x64": {},
+ }
+}
diff --git a/tests/src/Common/targeting_pack_ref/project.json b/tests/src/Common/targeting_pack_ref/project.json
new file mode 100644
index 0000000000..8ded577626
--- /dev/null
+++ b/tests/src/Common/targeting_pack_ref/project.json
@@ -0,0 +1,22 @@
+{
+ "dependencies": {
+ "Microsoft.TargetingPack.Private.CoreCLR": "1.2.0-beta-24616-02"
+ },
+ "frameworks": {
+ "netcoreapp1.0": {
+ "imports": [
+ "dnxcore50",
+ "portable-net45+win8"
+ ]
+ }
+ },
+ "runtimes": {
+ "win7-x86": {},
+ "win7-x64": {},
+ "ubuntu.14.04-x64": {},
+ "osx.10.10-x64": {},
+ "centos.7-x64": {},
+ "rhel.7-x64": {},
+ "debian.8-x64": {}
+ }
+}
diff --git a/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
new file mode 100644
index 0000000000..65e37c03c3
--- /dev/null
+++ b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>