Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Microsoft.CodeAnalysis.Workspaces.UnitTests to target netcoreapp3.1 #45813

Merged
merged 8 commits into from
Sep 23, 2020
13 changes: 13 additions & 0 deletions eng/config/test/Core/InstallTraceListener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// <auto-generated/>

using System.Runtime.CompilerServices;
using Roslyn.Test.Utilities;

internal sealed class InitializeTestModule
{
[ModuleInitializer]
internal static void Initializer()
{
RuntimeHelpers.RunModuleConstructor(typeof(TestBase).Module.ModuleHandle);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand All @@ -25,18 +25,4 @@
<ProjectReference Include="..\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj" />
<ProjectReference Include="..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xunit.Combinatorial" Version="$(XunitCombinatorialVersion)" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
</Project>
4 changes: 0 additions & 4 deletions src/Workspaces/CoreTest/BatchFixAllProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)

if (_nested)
{
#if NETCOREAPP2_0 || NET472
fixes = new List<CodeAction> { CodeAction.Create("Container", fixes.ToImmutableArray(), isInlinable: false) };
#else
throw new NotSupportedException("Nested code actions are not supported on this framework.");
#endif
}

foreach (var fix in fixes)
Expand Down
126 changes: 66 additions & 60 deletions src/Workspaces/CoreTest/CodeCleanup/ReduceTokenTests.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<UseWpf>true</UseWpf>
<RootNamespace>Microsoft.CodeAnalysis.UnitTests</RootNamespace>
</PropertyGroup>
Expand All @@ -30,7 +30,6 @@
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="$(SystemThreadingTasksDataflowVersion)" />
<PackageReference Include="Xunit.Combinatorial" Version="$(XunitCombinatorialVersion)" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void ExpiredValueNotEqualToNull()
{
var strongNull = ReferenceHolder<object?>.Strong(null);
var weakNull = ReferenceHolder<object?>.Weak(null);
var expired = ReferenceHolder<object?>.TestAccessor.ReleasedWeak(hashCode: EqualityComparer<object?>.Default.GetHashCode(null));
var expired = ReferenceHolder<object?>.TestAccessor.ReleasedWeak(hashCode: EqualityComparer<object?>.Default.GetHashCode(null!));

Assert.Equal(strongNull.GetHashCode(), expired.GetHashCode());
VerifyNotEqual(strongNull, expired);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<OptionStrict>Off</OptionStrict>
<VBRuntime>Default</VBRuntime>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
Expand All @@ -27,20 +26,8 @@
<ProjectReference Include="..\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.Workspaces.csproj" />
<ProjectReference Include="..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Folder Include="My Project\" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
</Project>