Run tests from dotnet/sdk
This commit is contained in:
parent
c78e42dd57
commit
970fd933df
2 changed files with 122 additions and 0 deletions
|
@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkResolver", "src\SdkResol
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Dotnet.Sdk.Internal", "src\Microsoft.Dotnet.Sdk.Internal\Microsoft.Dotnet.Sdk.Internal.csproj", "{73F07908-981B-41BB-B9BD-F3420274A6F7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkTests", "test\SdkTests\SdkTests.csproj", "{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -49,6 +51,10 @@ Global
|
|||
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -59,6 +65,7 @@ Global
|
|||
{53AF2D01-B69F-4CD0-86A7-8FD95967D23C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||
{78E15EC1-7732-41E3-8591-934E9F583254} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5}
|
||||
|
|
115
test/SdkTests/SdkTests.csproj
Normal file
115
test/SdkTests/SdkTests.csproj
Normal file
|
@ -0,0 +1,115 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
|
||||
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
|
||||
<OutputType>Library</OutputType>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ResolvePackageDependenciesForBuild>false</ResolvePackageDependenciesForBuild>
|
||||
<NonShipping>true</NonShipping>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<ProducesNoOutput>true</ProducesNoOutput>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<PropertyGroup>
|
||||
<LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<DeterministicSourcePaths>false</DeterministicSourcePaths>
|
||||
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RedistLayoutPath>$(ArtifactsBinDir)redist\$(Configuration)\dotnet\</RedistLayoutPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SdkTest Include="Build" />
|
||||
<SdkTest Include="Clean" />
|
||||
<SdkTest Include="Pack" />
|
||||
<SdkTest Include="Publish" />
|
||||
<SdkTest Include="Rebuild" />
|
||||
<SdkTest Include="Restore" />
|
||||
<SdkTest Include="ToolPack" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="RunSdkTests">
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
Targets="RunTestsAsTool"
|
||||
Properties="ToolCommandName=testSdk%(SdkTest.Identity);TestProjectName=Microsoft.NET.%(SdkTest.Identity).Tests"
|
||||
BuildInParallel="true"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="RunTestsAsTool">
|
||||
<PropertyGroup>
|
||||
<TestLocalToolFolder>$(ArtifactsTmpDir)$(ToolCommandName)\</TestLocalToolFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<RemoveDir Directories="$(TestLocalToolFolder)" />
|
||||
<MakeDir Directories="$(TestLocalToolFolder)" />
|
||||
|
||||
<MakeDir Directories="$(ArtifactsTestResultsDir)" />
|
||||
|
||||
<Exec Command="dotnet new tool-manifest"
|
||||
WorkingDirectory="$(TestLocalToolFolder)"/>
|
||||
|
||||
<Exec Command="dotnet tool install --local $(ToolCommandName) --version $(MicrosoftNETSdkPackageVersion) --add-source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"
|
||||
WorkingDirectory="$(TestLocalToolFolder)"/>
|
||||
|
||||
<Exec Command="dotnet tool restore"
|
||||
WorkingDirectory="$(TestLocalToolFolder)"/>
|
||||
|
||||
<PropertyGroup>
|
||||
<ResultsXmlPath>$(ArtifactsTestResultsDir)$(TestProjectName).xml</ResultsXmlPath>
|
||||
<ResultsHtmlPath>$(ArtifactsTestResultsDir)$(TestProjectName).html</ResultsHtmlPath>
|
||||
<ResultsStdOutPath>$(ArtifactsLogDir)$(TestProjectName).log</ResultsStdOutPath>
|
||||
|
||||
<TestArgs>-noautoreporters -noRepoInference</TestArgs>
|
||||
<TestArgs>$(TestArgs) -dotnetPath $(RedistLayoutPath)\dotnet</TestArgs>
|
||||
<TestArgs>$(TestArgs) -xml "$(ResultsXmlPath)"</TestArgs>
|
||||
<TestArgs>$(TestArgs) -html "$(ResultsHtmlPath)" $(TestRunnerAdditionalArguments)</TestArgs>
|
||||
<TestArgs>$(TestArgs) > $(ResultsStdOutPath)</TestArgs>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="dotnet tool run $(ToolCommandName) -- $(TestArgs)"
|
||||
WorkingDirectory="$(TestLocalToolFolder)"
|
||||
IgnoreStandardErrorWarningFormat="true" />
|
||||
</Target>
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<!-- Remove items which light up build logic which could generate warnings / errors -->
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="@(EmbeddedResource)" />
|
||||
<Reference Remove="@(Reference)" />
|
||||
<PackageReference Remove="@(PackageReference)" />
|
||||
<ProjectReference Remove="@(ProjectReference)" />
|
||||
<SwrFile Remove="@(SwrFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetPath></TargetPath>
|
||||
<!-- Prevent projects referencing this from trying to pass us to the compiler -->
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CoreCompile" />
|
||||
<!-- Prevent Csc from being called -->
|
||||
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
|
||||
<!-- Don't generate TFM attribute -->
|
||||
<Target Name="RuntimeImplementationProjectOutputGroup" />
|
||||
<!-- Group always attempts resolve runtime, regardless of <CopyNuGetImplementations>-->
|
||||
<Target Name="GetReferenceAssemblyPaths" />
|
||||
<!-- Don't go looking for framewoek reference assemblies-->
|
||||
<Target Name="GetFrameworkPaths" />
|
||||
<!-- ^ -->
|
||||
|
||||
<Target Name="GetBuildVersion" />
|
||||
<!-- For Packages projects, which use GetNuGetPackageVersionEx which depends on GetBuildVersion -->
|
||||
<Target Name="Pack" />
|
||||
|
||||
<Target Name="Test" DependsOnTargets="RunSdkTests" />
|
||||
</Project>
|
Loading…
Add table
Reference in a new issue