Skip to content

Commit

Permalink
Merge pull request #1968 from OmniSharp/feature/move-test-to-3.1
Browse files Browse the repository at this point in the history
moved most test projects to .NET Core 3.1
  • Loading branch information
JoeRobich authored Oct 1, 2020
2 parents 2841647 + 293aa57 commit 2383c7c
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"ProjectWithDisabledAnalyzers",
"ProjectWithDisabledAnalyzers2",
"ProjectWithAnalyzers",
"NetCore31Project",
"NetCore21Project",
"Net50Project",
"ProjectWithAnalyzersAndEditorConfig",
"ProjectWithParentEditorConfig"
Expand Down
2 changes: 1 addition & 1 deletion test-assets/test-projects/AllowUnsafe/AllowUnsafe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="ExternAlias.Lib">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>ExternAlias.App</RootNamespace>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion test-assets/test-projects/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netstandard1.5</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;netstandard1.5</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<OutputType>exe</OutputType>
<DefineConstants>NETCOREAPP;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.NETCore.App" />
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.NETCore.App" />
<PackageReference Include="Newtonsoft.Json">
<Version>7.0.1</Version>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
<CodeAnalysisRuleSet>default.ruleset</CodeAnalysisRuleSet>
<RestorePackagesPath>./nugets/</RestorePackagesPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Analyzer\Analyzer.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RestorePackagesPath>./nugets/</RestorePackagesPath>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RestorePackagesPath>./nugets/</RestorePackagesPath>
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RestorePackagesPath>./nugets/</RestorePackagesPath>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>test_wildcard</RootNamespace>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release1|AnyCPU'">
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug1|AnyCPU'">
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
18 changes: 9 additions & 9 deletions tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public async Task HelloWorld_has_correct_property_values()
Assert.NotNull(projectFileInfo);
Assert.Equal(projectFilePath, projectFileInfo.FilePath);
var targetFramework = Assert.Single(projectFileInfo.TargetFrameworks);
Assert.Equal("netcoreapp2.1", targetFramework);
Assert.Equal("bin/Debug/netcoreapp2.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp2.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal("netcoreapp3.1", targetFramework);
Assert.Equal("bin/Debug/netcoreapp3.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp3.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs
Assert.Equal(LanguageVersion.CSharp7_1, projectFileInfo.LanguageVersion);
Assert.True(projectFileInfo.TreatWarningsAsErrors);
Expand All @@ -83,9 +83,9 @@ public async Task HelloWorldSlim_has_correct_property_values()
Assert.NotNull(projectFileInfo);
Assert.Equal(projectFilePath, projectFileInfo.FilePath);
var targetFramework = Assert.Single(projectFileInfo.TargetFrameworks);
Assert.Equal("netcoreapp2.1", targetFramework);
Assert.Equal("bin/Debug/netcoreapp2.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp2.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal("netcoreapp3.1", targetFramework);
Assert.Equal("bin/Debug/netcoreapp3.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp3.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs
Assert.Equal("Debug", projectFileInfo.Configuration);
Assert.Equal("AnyCPU", projectFileInfo.Platform);
Expand All @@ -109,10 +109,10 @@ public async Task NetStandardAndNetCoreApp_has_correct_property_values()
Assert.NotNull(projectFileInfo);
Assert.Equal(projectFilePath, projectFileInfo.FilePath);
Assert.Equal(2, projectFileInfo.TargetFrameworks.Length);
Assert.Equal("netcoreapp2.1", projectFileInfo.TargetFrameworks[0]);
Assert.Equal("netcoreapp3.1", projectFileInfo.TargetFrameworks[0]);
Assert.Equal("netstandard1.5", projectFileInfo.TargetFrameworks[1]);
Assert.Equal("bin/Debug/netcoreapp2.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp2.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal("bin/Debug/netcoreapp3.1/", projectFileInfo.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp3.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs
Assert.Equal("Debug", projectFileInfo.Configuration);
Assert.Equal("AnyCPU", projectFileInfo.Platform);
Expand Down
8 changes: 4 additions & 4 deletions tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void GetTargetFramework_NoTFM_ReturnsEmpty()
public async Task The_target_framework_is_emitted()
{
// Arrange
var expectedTFM = "netcoreapp2.1";
var expectedTFM = "netcoreapp3.1";
var emitter = new ProjectLoadTestEventEmitter();

using var testProject = await TestAssets.Instance.GetTestProjectAsync("HelloWorld");
Expand Down Expand Up @@ -170,7 +170,7 @@ public async Task The_output_kind_is_emitted()
// Arrange
var emitter = new ProjectLoadTestEventEmitter();

using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal((int)OutputKind.ConsoleApplication, emitter.ReceivedMessages[0].OutputKind);
Expand All @@ -182,7 +182,7 @@ public async Task The_correct_project_capablities_is_emitted()
// Arrange
var emitter = new ProjectLoadTestEventEmitter();

using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal("GenerateDocumentationFile CSharp Managed ReferencesFolder LanguageService RelativePathDerivedDefaultNamespace AssemblyReferences COMReferences ProjectReferences SharedProjectReferences OutputGroups AllTargetOutputGroups VisualStudioWellKnownOutputGroups SingleFileGenerators DeclaredSourceItems UserSourceItems BuildWindowsDesktopTarget CrossPlatformExecutable Pack", string.Join(" ", emitter.ReceivedMessages[0].ProjectCapabilities));
Expand All @@ -194,7 +194,7 @@ public async Task The_correct_sdk_version_is_emitted()
// Arrange
var emitter = new ProjectLoadTestEventEmitter();

using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("3.1.402"), emitter.ReceivedMessages[0].SdkVersion);
Expand Down
Loading

0 comments on commit 2383c7c

Please sign in to comment.