Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Consume Microsoft.DotNet.CoreFxTesting package
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer committed Nov 12, 2018
1 parent 4914440 commit d4f74ca
Show file tree
Hide file tree
Showing 113 changed files with 301 additions and 433 deletions.
24 changes: 19 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
<!-- CoreFx sepcific paths -->
<TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BinDir)tests/</TestWorkingDir>

<TestArchiveRoot>$(ProjectDir)artifacts/helix/</TestArchiveRoot>
<TestArchiveTestsDir>$(TestArchiveRoot)tests/</TestArchiveTestsDir>
<TestArchiveRuntimeDir>$(TestArchiveRoot)runtime/</TestArchiveRuntimeDir>

<!-- Input Directories -->
<PackagesDir>$(DotNetRestorePackagesPath)</PackagesDir>
<PackagesDir Condition="'$(PackagesDir)'=='' AND '$(NuGetPackageRoot)' != ''">$([MSBuild]::EnsureTrailingSlash('$(NuGetPackageRoot)'))</PackagesDir>
Expand Down Expand Up @@ -90,6 +94,7 @@
<ExcludeDepProjImport>true</ExcludeDepProjImport>
<ExcludeResolveContractImport>true</ExcludeResolveContractImport>
<ExcludePackageResolveImport>true</ExcludePackageResolveImport>
<ExcludeTestsImport>true</ExcludeTestsImport>
</PropertyGroup>

<!-- workaround https://github.com/dotnet/sdk/issues/2288
Expand All @@ -115,7 +120,7 @@
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OfficialBuildId)' == ''">
<!-- Disable F5 and test explorer support for CI builds. -->
<GenerateLaunchSettings>false</GenerateLaunchSettings>
<IncludeVSTestReferences>false</IncludeVSTestReferences>
<EnableVSTestReferences>false</EnableVSTestReferences>
</PropertyGroup>

<!-- list of nuget package sources passed to nuget restore -->
Expand Down Expand Up @@ -254,18 +259,22 @@
-->
<PropertyGroup>
<ImportNetSdkFromRepoToolset>false</ImportNetSdkFromRepoToolset>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>

<!-- TODO: Remove with Arcade update. -->
<PropertyGroup>
<_IsTestProjectBefore>$(IsTestProject)</_IsTestProjectBefore>
<IsPerformanceTestProject Condition="'$(IsPerformanceTestProject)' == '' AND '$(IsTestProject)' == 'true' AND $(MSBuildProjectName.EndsWith('Performance.Tests'))">true</IsPerformanceTestProject>
<_IsPerformanceTestProjectBefore>$(IsPerformanceTestProject)</_IsPerformanceTestProjectBefore>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<!-- Need to reset our definition of IsTestProject after arcade sdk import -->
<!-- Need to reset our definition of IsTestProject after arcade sdk import -->
<!-- TODO: Remove with Arcade update. -->
<PropertyGroup>
<IsTestProject>$(_IsTestProjectBefore)</IsTestProject>
<IsPerformanceTestProject>$(_IsPerformanceTestProjectBefore)</IsPerformanceTestProject>
</PropertyGroup>

<!-- Set the kind of PDB to Portable and turn on SourceLink (fetching source from GitHub) -->
Expand Down Expand Up @@ -386,6 +395,7 @@
<NETCoreAppTestHostFxrPath>$(TestHostRootPath)host/fxr/$(NETCoreAppTestSharedFxVersion)/</NETCoreAppTestHostFxrPath>
<NETCoreAppTestSharedFrameworkPath>$(TestHostRootPath)shared/Microsoft.NETCore.App/$(NETCoreAppTestSharedFxVersion)/</NETCoreAppTestSharedFrameworkPath>
<ILCFXInputFolder>$(TestHostRootPath)ILCInputFolder</ILCFXInputFolder>
<InternalTestILCFolder>$(TestHostRootPath)TestILC</InternalTestILCFolder>

<!-- For UAP, we'll produce the layout and hard-link this into each test's directory -->
<UAPTestSharedFrameworkPath>$(TestHostRootPath)UAPLayout</UAPTestSharedFrameworkPath>
Expand Down Expand Up @@ -434,12 +444,16 @@
<UseCoverageDedicatedRuntime Condition="'$(UseCoverageDedicatedRuntime)' == '' AND '$(CodeCoverageEnabled)' == 'true'">true</UseCoverageDedicatedRuntime>

<!-- F5 and debugging support for netcoreapp and netfx inside VS. -->
<GenerateLaunchSettings Condition="'$(GenerateLaunchSettings)' == ''">true</GenerateLaunchSettings>
<EnableLaunchSettings Condition="'$(EnableLaunchSettings)' == ''">true</EnableLaunchSettings>

<!-- Disable VS Test SDK references if the .NET Native toolchain is used. -->
<IncludeVSTestReferences Condition="'$(UseDotNetNativeToolchain)' == 'true'">false</IncludeVSTestReferences>
<EnableVSTestReferences Condition="'$(UseDotNetNativeToolchain)' == 'true'">false</EnableVSTestReferences>
<EnableVSTestReferences Condition="'$(EnableVSTestReferences)' == ''">true</EnableVSTestReferences>
</PropertyGroup>

<!-- TODO: Fix VB test project reference to Test SDK. -->
<Import Condition="'$(IsTestProject)' == 'true' AND '$(IsTestSupportProject)' != 'true' AND '$(EnableVSTestReferences)' == 'true' AND '$(Language)' != 'VB'" Project="$(RuntimePath)Microsoft.Net.Test.Sdk.props" />

<!-- Import it at the end of the props file to override the OutputPath for reference assemblies and use common directory props -->
<Import Project="$(MSBuildThisFileDirectory)eng\ReferenceAssemblies.props" />

Expand Down
9 changes: 0 additions & 9 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,6 @@
<SuppressPackageTargetFrameworkCompatibility Include="$(UAPvNextTFM)" />
</ItemGroup>

<!--
Import Test SDK props and targets.
This needs to happen here as the IsInvokableTestProject prop is required
which isn't available before Directory.Build.targets.
TODO: Fix VB test project reference to Test SDK.
-->
<Import Condition="'$(IncludeVSTestReferences)' == 'true' AND Exists('$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\buildMultiTargeting\Microsoft.Net.Test.Sdk.props') AND '$(Language)' != 'VB'" Project="$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\buildMultiTargeting\Microsoft.Net.Test.Sdk.props" />
<Import Condition="'$(IncludeVSTestReferences)' == 'true' AND Exists('$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\build\netcoreapp1.0\Microsoft.Net.Test.Sdk.targets') AND ('$(BuildingNETCoreAppVertical)' == 'true' OR '$(BuildingNETFxVertical)' == 'true') AND '$(Language)' != 'VB'" Project="$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\build\netcoreapp1.0\Microsoft.Net.Test.Sdk.targets" />

<Target Name="ProducesPackageId"
Returns="@(PackageIds)">
<ItemGroup>
Expand Down
66 changes: 9 additions & 57 deletions eng/Resources.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.csproj'">.cs</ResourcesSourceFileExtension>
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.vbproj'">.vb</ResourcesSourceFileExtension>

<StringResourcesPath Condition="'$(StringResourcesPath)'=='' And Exists('$(MSBuildProjectDirectory)/Resources/Strings.resx')">$(MSBuildProjectDirectory)/Resources/Strings.resx</StringResourcesPath>
<StringResourcesPath Condition="'$(StringResourcesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/Resources/Strings.resx')">$(MSBuildProjectDirectory)/Resources/Strings.resx</StringResourcesPath>
<StringResourcesNamespace Condition="'$(StringResourcesNamespace)' == ''">System</StringResourcesNamespace>
<StringResourcesClassName Condition="'$(StringResourcesClassName)' == ''">SR</StringResourcesClassName>
<StringResourcesName Condition="'$(StringResourcesName)' == ''">FxResources.$(AssemblyName).$(StringResourcesClassName)</StringResourcesName>
Expand All @@ -16,7 +16,7 @@
</PropertyGroup>

<!-- Include files under StringResourcesPath by convention unless OmitResources is set. -->
<ItemGroup Condition="'$(StringResourcesPath)'!='' AND '$(OmitResources)'!='true'">
<ItemGroup Condition="'$(StringResourcesPath)' != '' AND '$(OmitResources)' != 'true'">
<EmbeddedResource Include="$(StringResourcesPath)">
<Visible>true</Visible>
<ManifestResourceName>$(StringResourcesName)</ManifestResourceName>
Expand All @@ -25,59 +25,11 @@
</EmbeddedResource>
</ItemGroup>

<Choose>
<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. -->
<When Condition="Exists('$(StringResourcesPath)') AND '$(OmitResources)'!='true' AND '$(SkipCommonResourcesIncludes)'==''">
<ItemGroup>
<Compile Include="$(CommonPath)/System/SR$(ResourcesSourceFileExtension)">
<Visible>true</Visible>
<Link>Resources/Common/SR$(ResourcesSourceFileExtension)</Link>
</Compile>
</ItemGroup>
</When>
</Choose>

<PropertyGroup Condition="'$(BuildingUAPVertical)' == 'true'">
<CompileDependsOn>
CopyResxFilesToReswFiles;
$(CompileDependsOn);
</CompileDependsOn>
</PropertyGroup>

<Target Name="CalculateResourcesFileNames" Condition="'$(BuildingUAPVertical)' == 'true'">
<ItemGroup>
<_AllResxFiles Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(Extension)' == '.resx'">
<ReswName Condition="'%(EmbeddedResource.ReswName)' == ''">%(EmbeddedResource.ManifestResourceName)</ReswName>
</_AllResxFiles>
</ItemGroup>

<PropertyGroup>
<ProjectHasResources Condition="'@(_AllResxFiles)' != ''">true</ProjectHasResources>
<TestProjectNeedsModifiedPriFile Condition="'$(IsTestProject)' == 'true' AND '$(ProjectHasResources)' == 'true'">true</TestProjectNeedsModifiedPriFile>
<TestResourcesFolderPath Condition="'$(TestProjectNeedsModifiedPriFile)' == 'true'">$(RuntimePath)$(AssemblyName).Resw</TestResourcesFolderPath>
<_ResWDestinationPath Condition="'$(TestResourcesFolderPath)' != ''">$(TestResourcesFolderPath)</_ResWDestinationPath>
<_ResWDestinationPath Condition="'$(TestResourcesFolderPath)' == ''">$(ResourcesFolderPath)</_ResWDestinationPath>
</PropertyGroup>

<ItemGroup>
<_ReswOutputFiles Include="@(_AllResxFiles->'$(_ResWDestinationPath)/%(ReswName).resw')" />
</ItemGroup>

</Target>

<Target Name="CopyResxFilesToReswFiles"
Condition="'$(BuildingUAPVertical)' == 'true'"
DependsOnTargets="CalculateResourcesFileNames"
Inputs="@(_AllResxFiles)"
Outputs="@(_ReswOutputFiles)" >

<Copy SourceFiles="@(_AllResxFiles)"
DestinationFiles="@(_ReswOutputFiles)"
SkipUnchangedFiles="true">
<Output TaskParameter="CopiedFiles" ItemName="FilesCreated" />
</Copy>

<!-- We need to touch the copied files so that the target that uses them can track the inputs and outputs with the copied timestamp -->
<Touch Files="@(FilesCreated)" />
</Target>
<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. -->
<ItemGroup Condition="Exists('$(StringResourcesPath)') AND '$(OmitResources)' != 'true' AND '$(SkipCommonResourcesIncludes)' == ''">
<Compile Include="$(CommonPath)/System/SR$(ResourcesSourceFileExtension)">
<Visible>true</Visible>
<Link>Resources/Common/SR$(ResourcesSourceFileExtension)</Link>
</Compile>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions eng/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<RuntimeNativeSystemDataSqlClientSniPackageVersion>4.4.0</RuntimeNativeSystemDataSqlClientSniPackageVersion>

<!-- xunit test dependency version -->
<MicrosoftDotNetTestSdkVersion>15.8.0</MicrosoftDotNetTestSdkVersion>
<MicrosoftNetTestSdkPackageVersion>15.8.0</MicrosoftNetTestSdkPackageVersion>
<XUnitPackageVersion>2.4.1-pre.build.4059</XUnitPackageVersion>
<XUnitPerformancePackageVersion>1.0.0-beta-build0020</XUnitPerformancePackageVersion>
<TraceEventPackageVersion>2.0.5</TraceEventPackageVersion>
Expand Down Expand Up @@ -241,7 +241,7 @@
</StaticDependency>

<StaticDependency Include="Microsoft.NET.Test.Sdk">
<Version>$(MicrosoftDotNetTestSdkVersion)</Version>
<Version>$(MicrosoftNetTestSdkPackageVersion)</Version>
</StaticDependency>

<PerformancePackDependency Include="xunit.performance.core" />
Expand Down
2 changes: 1 addition & 1 deletion external/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<ContainsPackageReferences>true</ContainsPackageReferences>
<IncludeVSTestReferences Condition="'$(IncludeVSTestReferences)' == ''">true</IncludeVSTestReferences>
<EnableVSTestReferences Condition="'$(EnableVSTestReferences)' == ''">true</EnableVSTestReferences>
<!-- We need configuration-specific assets files. -->
<RestoreOutputPath>$(IntermediateOutputPath)</RestoreOutputPath>
<ProjectAssetsFile>$(RestoreOutputPath)/project.assets.json</ProjectAssetsFile>
Expand Down
Loading

0 comments on commit d4f74ca

Please sign in to comment.