Repository navigation
Expand file tree
/
Copy pathMicrosoft.NET.TestFramework.MSTest.csproj
More file actions
125 lines (109 loc) · 6.75 KB
/
Copy pathMicrosoft.NET.TestFramework.MSTest.csproj
File metadata and controls
125 lines (109 loc) · 6.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<Project Sdk="MSTest.Sdk">
<!--
MSTest-flavored counterpart of test/Microsoft.NET.TestFramework (which is xUnit-coupled).
The xUnit coupling of the legacy framework is concentrated in ~17 of ~99 files (the
Attributes/* discovery attributes and a couple of IMessageSink-based logger bridges). The
remaining ~82 runner-agnostic files reference the test output sink only through the
unqualified name `ITestOutputHelper`. This project therefore LINK-SHARES those agnostic
sources (zero duplication) and supplies the MSTest-specific pieces locally:
* ITestOutputHelper - our own 4-method interface (replaces Xunit.ITestOutputHelper)
* TestContextOutputHelper - MSTest TestContext-backed implementation
* SdkTest - MSTest base class (TestContext property instead of ctor injection)
* TestLoggerFactory - MSTest logger factory
The namespace is kept as Microsoft.NET.TestFramework so that, once every consumer has
migrated, the legacy project can be deleted and this one renamed with no source churn.
-->
<PropertyGroup>
<!--
This is a shared *test library*, not a runnable test application. Setting
IsTestApplication=false makes MSTest.Sdk bring only the "Core" MSTest.TestFramework
reference (so the framework version stays in sync with the SDK) while skipping the test
adapter, the MSTest runner, Microsoft.Testing.Platform and the testing extensions - those
are gated on IsTestApplication=='true' in MSTest.Sdk's ClassicEngine.targets.
-->
<IsTestApplication>false</IsTestApplication>
<IsTestProject>false</IsTestProject>
<IsPackable>false</IsPackable>
<EnableDefaultItems>false</EnableDefaultItems>
<TargetFrameworks>$(SdkTargetFramework);$(NetFrameworkToolCurrent)</TargetFrameworks>
<RootNamespace>Microsoft.NET.TestFramework</RootNamespace>
</PropertyGroup>
<!-- Directory holding the runner-agnostic sources that are link-shared from the legacy framework. -->
<PropertyGroup>
<SharedTestFrameworkDir>$(MSBuildThisFileDirectory)..\Microsoft.NET.TestFramework\</SharedTestFrameworkDir>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>NewtonsoftJsonPackageVersion</_Parameter1>
<_Parameter2>$(NewtonsoftJsonPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>SystemDataSqlClientPackageVersion</_Parameter1>
<_Parameter2>$(SystemDataSqlClientPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" >
<_Parameter1>MicrosoftAspNetCoreAppRefPackageVersion</_Parameter1>
<_Parameter2>$(MicrosoftAspNetCoreAppRefPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" >
<_Parameter1>AspirePackageVersion</_Parameter1>
<_Parameter2>$(AspirePackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" >
<_Parameter1>MicrosoftExtensionsServiceDiscoveryPackageVersion</_Parameter1>
<_Parameter2>$(MicrosoftExtensionsServiceDiscoveryPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>MicrosoftNETTestSdkPackageVersion</_Parameter1>
<_Parameter2>$(MicrosoftNETTestSdkPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>XUnitPackageVersion</_Parameter1>
<_Parameter2>$(XUnitVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>XUnitRunnerVisualStudioPackageVersion</_Parameter1>
<_Parameter2>$(XUnitRunnerVisualStudioPackageVersion)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<!--
WARNING: Do not add dependencies on MSBuild packages.
Some tests (e.g. dotnet-watch.Tests) need to have total control over the loading of MSBuild assemblies.
-->
<PackageReference Include="DiffPlex" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.IO.Hashing" />
<!-- MSTest.TestFramework is provided by MSTest.Sdk (Core reference, version in sync).
The FluentAssertions global using and the AwesomeAssertions package are provided by
test/Directory.Build.targets when UsingMSTestSdk == true. -->
<Using Include="Microsoft.NET.TestFramework" />
<Using Include="Microsoft.NET.TestFramework.Assertions" />
<Using Include="Microsoft.NET.TestFramework.Commands" />
<Using Include="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Include="Microsoft.NET.TestFramework.Utilities" />
</ItemGroup>
<!-- Packages that are in-box for .NET Core, so we only need to reference them for .NET Framework -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Reflection.Metadata" VersionOverride="$(SystemReflectionMetadataToolsetPackageVersion)" />
<PackageReference Include="System.Reflection.MetadataLoadContext" VersionOverride="$(SystemReflectionMetadataLoadContextToolsetPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" />
<ProjectReference Include="..\..\src\Cli\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj" />
</ItemGroup>
<ItemGroup>
<!-- Link-share the runner-agnostic sources from the legacy xUnit framework (zero duplication).
Excluded files are runner-specific and have MSTest replacements in this project (or are
deferred): the Attributes/* discovery attributes, the IMessageSink-based logger bridges,
and the ctor-injection base classes (SdkTest, AspNetSdkTest). -->
<Compile Include="$(SharedTestFrameworkDir)**\*.cs"
Exclude="$(SharedTestFrameworkDir)Attributes\**\*.cs;$(SharedTestFrameworkDir)SharedTestOutputHelper.cs;$(SharedTestFrameworkDir)TestLoggerFactory.cs;$(SharedTestFrameworkDir)SdkTest.cs;$(SharedTestFrameworkDir)AspNetSdkTest.cs;$(SharedTestFrameworkDir)bin\**\*.cs;$(SharedTestFrameworkDir)obj\**\*.cs"
LinkBase="Shared" />
<!-- This project's own MSTest-specific sources. -->
<Compile Include="*.cs" />
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
</ItemGroup>
</Project>