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

Move tests to target .NET 7 #6364

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<DefineConstants>$(DefineConstants),NET_ANALYZERS_TEST</DefineConstants>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<NoWarn>$(NoWarn);xUnit1000;CA1812</NoWarn>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Test.Utilities/Test.Utilities.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<NonShipping>true</NonShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<NonShipping>true</NonShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAcc

var operation = Expression.Variable(typeof(IOperation));

return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, WrappedType)), operation).Compile();
return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
}

private IFunctionPointerInvocationOperationWrapper(IOperation operation)
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Compiler/Lightup/LightupHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? typ
? parameter
: Expression.Convert(parameter, type);

Expression result = Expression.Call(instance, property.GetMethod);
Expression result = Expression.Call(instance, property.GetMethod!);
if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo()))
{
result = Expression.Convert(result, typeof(TProperty));
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/Compiler/RulesetToEditorconfigConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static XElement GetTopLevelRulesetNode(string rulesetFilePath)
var ruleSetDocument = XDocument.Load(xmlReader);

// Find the top level rule set node
var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).FirstOrDefault();
var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).First();
Debug.Assert(rulesetNode.Name == RuleSetNodeName);
return rulesetNode;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ static void PopulateRuleIdToComments(string rulesetFilePath, Dictionary<string,
if (node is XElement ruleNode &&
ruleNode.Name == RuleNodeName)
{
XAttribute ruleId = ruleNode.Attribute(RuleIdAttributeName);
XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
if (ruleId != null)
{
foreach (var comment in ruleNode.Nodes().OfType<XComment>())
Expand Down