Merge pull request #906 from dotnet/merges/main-to-dev17.0

Merge main to dev17.0
This commit is contained in:
dotnet bot 2021-09-30 16:30:54 -07:00 коммит произвёл GitHub
Родитель 0c20c1e197 ad55815172
Коммит be02db3806
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 186 добавлений и 1 удалений

Просмотреть файл

@ -253,6 +253,12 @@ static Microsoft.CodeAnalysis.Testing.IVerifierExtensions.EqualOrDiff(this Micro
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Default.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net50.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60Android.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60MacCatalyst.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60MacOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60TvOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60Windows.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net60iOS.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp10.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp11.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies
static Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.NetCore.NetCoreApp20.get -> Microsoft.CodeAnalysis.Testing.ReferenceAssemblies

Просмотреть файл

@ -878,13 +878,61 @@ namespace Microsoft.CodeAnalysis.Testing
"net6.0",
new PackageIdentity(
"Microsoft.NETCore.App.Ref",
"6.0.0-preview.6.21352.12"),
"6.0.0-rc.1.21451.13"),
Path.Combine("ref", "net6.0"));
});
private static readonly Lazy<ReferenceAssemblies> _lazyNet60Windows =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.WindowsDesktop.App.Ref", "6.0.0-rc.1.21451.3"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60Android =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.Android.Ref", "31.0.100-rc.1.12"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60iOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.iOS.Ref", "15.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60MacOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.macOS.Ref", "12.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60MacCatalyst =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.MacCatalyst.Ref", "15.0.100-rc.1.1534"))));
private static readonly Lazy<ReferenceAssemblies> _lazyNet60TvOS =
new Lazy<ReferenceAssemblies>(() =>
Net60.AddPackages(
ImmutableArray.Create(
new PackageIdentity("Microsoft.tvOS.Ref", "15.0.100-rc.1.1534"))));
public static ReferenceAssemblies Net50 => _lazyNet50.Value;
public static ReferenceAssemblies Net60 => _lazyNet60.Value;
public static ReferenceAssemblies Net60Windows => _lazyNet60Windows.Value;
public static ReferenceAssemblies Net60Android => _lazyNet60Android.Value;
public static ReferenceAssemblies Net60iOS => _lazyNet60iOS.Value;
public static ReferenceAssemblies Net60MacOS => _lazyNet60MacOS.Value;
public static ReferenceAssemblies Net60MacCatalyst => _lazyNet60MacCatalyst.Value;
public static ReferenceAssemblies Net60TvOS => _lazyNet60TvOS.Value;
}
public static class NetStandard

Просмотреть файл

@ -430,6 +430,125 @@ namespace Microsoft.CodeAnalysis.Testing
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60Windows()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60Windows);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60Windows;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60Android()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60Android);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60Android;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60iOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60iOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60iOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60MacOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60MacOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60MacOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60MacCatalyst()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60MacCatalyst);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60MacCatalyst;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60TvOS()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60TvOS);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60TvOS;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Fact]
public async Task ResolveReferenceAssemblies_Net60()
{
#if NETCOREAPP1_1 || NET46
Assert.False(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
Assert.ThrowsAny<NotSupportedException>(() => ReferenceAssemblies.Net.Net60);
// Avoid a warning for 'async' operator
await Task.Yield();
#else
Assert.True(ReferenceAssemblies.TestAccessor.IsPackageBased("net6.0"));
var referenceAssemblies = ReferenceAssemblies.Net.Net60;
var resolved = await referenceAssemblies.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
Assert.NotEmpty(resolved);
#endif
}
[Theory]
[InlineData("net40")]
[InlineData("net45")]
@ -451,6 +570,12 @@ namespace Microsoft.CodeAnalysis.Testing
#if !(NETCOREAPP1_1 || NET46)
[InlineData("net5.0")]
[InlineData("net6.0")]
[InlineData("net6.0-windows")]
[InlineData("net6.0-android")]
[InlineData("net6.0-ios")]
[InlineData("net6.0-macos")]
[InlineData("net6.0-maccatalyst")]
[InlineData("net6.0-tvos")]
#endif
[InlineData("netstandard1.0")]
[InlineData("netstandard1.1")]
@ -502,6 +627,12 @@ class TestClass {
"netcoreapp3.1" => ReferenceAssemblies.NetCore.NetCoreApp31,
"net5.0" => ReferenceAssemblies.Net.Net50,
"net6.0" => ReferenceAssemblies.Net.Net60,
"net6.0-windows" => ReferenceAssemblies.Net.Net60Windows,
"net6.0-android" => ReferenceAssemblies.Net.Net60Android,
"net6.0-ios" => ReferenceAssemblies.Net.Net60iOS,
"net6.0-macos" => ReferenceAssemblies.Net.Net60MacOS,
"net6.0-maccatalyst" => ReferenceAssemblies.Net.Net60MacCatalyst,
"net6.0-tvos" => ReferenceAssemblies.Net.Net60TvOS,
"netstandard1.0" => ReferenceAssemblies.NetStandard.NetStandard10,
"netstandard1.1" => ReferenceAssemblies.NetStandard.NetStandard11,
"netstandard1.2" => ReferenceAssemblies.NetStandard.NetStandard12,