Skip to content

Commit 75b26a2

Browse files
authored
Move net451 test assets to net461 (#74766)
* Move net451 test assets to net461 * great rename * PR feedback
1 parent 7d94086 commit 75b26a2

File tree

250 files changed

+2678
-2829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+2678
-2829
lines changed

eng/Directory.Packages.props

-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
<PackageVersion Include="Microsoft.Internal.Performance.CodeMarkers.DesignTime" Version="15.8.27812-alpha" />
183183
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" />
184184
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net461" Version="1.0.3" />
185-
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net451" Version="1.0.3" />
186185
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="1.0.3" />
187186
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3" />
188187
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net20" Version="1.0.3" />

src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4341,7 +4341,7 @@ public void AppConfigBasic()
43414341
</configuration>");
43424342

43434343
var silverlight = Temp.CreateFile().WriteAllBytes(ProprietaryTestResources.silverlight_v5_0_5_0.System_v5_0_5_0_silverlight).Path;
4344-
var net4_0dll = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path;
4344+
var net4_0dll = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path;
43454345

43464346
// Test linking two appconfig dlls with simple src
43474347
var outWriter = new StringWriter(CultureInfo.InvariantCulture);
@@ -6310,7 +6310,7 @@ public class CS1698_a {}
63106310
[ConditionalFact(typeof(ClrOnly), Reason = "https://github.com/dotnet/roslyn/issues/30926")]
63116311
public void BinaryFileErrorTest()
63126312
{
6313-
var binaryPath = Temp.CreateFile().WriteAllBytes(ResourcesNet451.mscorlib).Path;
6313+
var binaryPath = Temp.CreateFile().WriteAllBytes(Net461.Resources.mscorlib).Path;
63146314
var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
63156315
var outWriter = new StringWriter(CultureInfo.InvariantCulture);
63166316
int exitCode = csc.Run(outWriter);

src/Compilers/CSharp/Test/CommandLine/TouchedFileLoggingTests.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.IO;
1111
using System.Linq;
1212
using System.Runtime.InteropServices;
13+
using Basic.Reference.Assemblies;
1314
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
1415
using Microsoft.CodeAnalysis.Test.Resources.Proprietary;
1516
using Microsoft.CodeAnalysis.Test.Utilities;
@@ -78,7 +79,7 @@ public void AppConfigCsc()
7879
</configuration>").Path;
7980

8081
var silverlight = Temp.CreateFile().WriteAllBytes(ProprietaryTestResources.silverlight_v5_0_5_0.System_v5_0_5_0_silverlight).Path;
81-
var net4_0dll = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path;
82+
var net4_0dll = Temp.CreateFile().WriteAllBytes(Net461.Resources.System).Path;
8283

8384
var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8485
var cmd = CreateCSharpCompiler(

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,8 @@ public static void Main()
958958
Run();
959959
}
960960
}";
961-
var reference = CreateCompilationWithMscorlib45(source, references: new MetadataReference[] { SystemRef_v4_0_30319_17929 }).EmitToImageReference();
962-
var comp = CreateCompilationWithMscorlib45("", new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
961+
var reference = CreateCompilationWithMscorlib461(source, references: new MetadataReference[] { SystemRef_v4_0_30319_17929 }).EmitToImageReference();
962+
var comp = CreateCompilationWithMscorlib461("", new[] { reference }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.Internal));
963963
var testClass = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("Test");
964964
var stateMachineClass = (NamedTypeSymbol)testClass.GetMembers().Single(s => s.Name.StartsWith("<Run>", StringComparison.Ordinal));
965965
IEnumerable<IGrouping<TypeSymbol, FieldSymbol>> spillFieldsByType = stateMachineClass.GetMembers().Where(m => m.Kind == SymbolKind.Field && m.Name.StartsWith("<>7__wrap", StringComparison.Ordinal)).Cast<FieldSymbol>().GroupBy(x => x.Type);

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs

+41-41
Large diffs are not rendered by default.

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMethodBuilderOverrideTests.cs

+45-45
Large diffs are not rendered by default.

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ private static CSharpCompilation CreateCompilation(string source, IEnumerable<Me
2323
{
2424
options = options ?? TestOptions.ReleaseExe;
2525

26-
IEnumerable<MetadataReference> asyncRefs = new[] { Net451.System, Net451.SystemCore, Net451.MicrosoftCSharp };
26+
IEnumerable<MetadataReference> asyncRefs = new[] { NetFramework.System, NetFramework.SystemCore, NetFramework.MicrosoftCSharp };
2727
references = (references != null) ? references.Concat(asyncRefs) : asyncRefs;
2828

29-
return CreateCompilationWithMscorlib45(source, options: options, references: references);
29+
return CreateCompilationWithMscorlib461(source, options: options, references: references);
3030
}
3131

3232
private CompilationVerifier CompileAndVerify(string source, string expectedOutput, IEnumerable<MetadataReference> references = null, CSharpCompilationOptions options = null, Verification verify = default)
@@ -54,7 +54,7 @@ public static void Main()
5454
F(123).Wait();
5555
}
5656
}";
57-
var c = CreateCompilationWithMscorlib45(source);
57+
var c = CreateCompilationWithMscorlib461(source);
5858

5959
CompilationOptions options;
6060

@@ -3703,7 +3703,7 @@ public void AsyncTasklikeMissingBuilderType()
37033703
{
37043704
// Builder
37053705
var libB = @"public class B { }";
3706-
var cB = CreateCompilationWithMscorlib45(libB);
3706+
var cB = CreateCompilationWithMscorlib461(libB);
37073707
var rB = cB.EmitToImageReference();
37083708

37093709
// Tasklike
@@ -3714,7 +3714,7 @@ public void AsyncTasklikeMissingBuilderType()
37143714
37153715
namespace System.Runtime.CompilerServices { class AsyncMethodBuilderAttribute : System.Attribute { public AsyncMethodBuilderAttribute(System.Type t) { } } }
37163716
";
3717-
var cT = CreateCompilationWithMscorlib45(libT, references: new[] { rB });
3717+
var cT = CreateCompilationWithMscorlib461(libT, references: new[] { rB });
37183718
var rT = cT.EmitToImageReference();
37193719

37203720
// Consumer, fails to reference builder
@@ -3726,7 +3726,7 @@ static void Main() { }
37263726
async T f() => await Task.Delay(1);
37273727
}
37283728
";
3729-
var c = CreateCompilationWithMscorlib45(source, references: new[] { rT });
3729+
var c = CreateCompilationWithMscorlib461(source, references: new[] { rT });
37303730
c.VerifyEmitDiagnostics(
37313731
// (6,17): error CS1983: The return type of an async method must be void, Task or Task<T>
37323732
// async T f() => await Task.Delay(1);
@@ -4023,7 +4023,7 @@ class Mismatch2MethodBuilder<T>
40234023
}
40244024
namespace System.Runtime.CompilerServices { class AsyncMethodBuilderAttribute : System.Attribute { public AsyncMethodBuilderAttribute(System.Type t) { } } }
40254025
";
4026-
var comp = CreateCompilationWithMscorlib45(source);
4026+
var comp = CreateCompilationWithMscorlib461(source);
40274027
comp.VerifyEmitDiagnostics(
40284028
// (5,30): error CS8940: A generic task-like return type was expected, but the type 'Mismatch1MethodBuilder' found in 'AsyncMethodBuilder' attribute was not suitable. It must be an unbound generic type of arity one, and its containing type (if any) must be non-generic.
40294029
// async Mismatch1<int> f() { await (Task)null; return 1; }
@@ -4501,7 +4501,7 @@ public void AwaitInScriptExpression()
45014501
{
45024502
var source =
45034503
@"System.Console.WriteLine(await System.Threading.Tasks.Task.FromResult(1));";
4504-
var compilation = CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
4504+
var compilation = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
45054505
compilation.VerifyDiagnostics();
45064506
}
45074507

@@ -4510,7 +4510,7 @@ public void AwaitInScriptGlobalStatement()
45104510
{
45114511
var source =
45124512
@"await System.Threading.Tasks.Task.FromResult(4);";
4513-
var compilation = CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
4513+
var compilation = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
45144514
compilation.VerifyDiagnostics();
45154515
}
45164516

@@ -4520,7 +4520,7 @@ public void AwaitInScriptDeclaration()
45204520
var source =
45214521
@"int x = await System.Threading.Tasks.Task.Run(() => 2);
45224522
System.Console.WriteLine(x);";
4523-
var compilation = CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
4523+
var compilation = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
45244524
compilation.VerifyDiagnostics();
45254525
}
45264526

@@ -4564,7 +4564,7 @@ public void AwaitInScriptStaticInitializer()
45644564
await System.Threading.Tasks.Task.FromResult(1);
45654565
int y = x +
45664566
await System.Threading.Tasks.Task.FromResult(2);";
4567-
var compilation = CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
4567+
var compilation = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Script, options: TestOptions.DebugExe);
45684568
compilation.VerifyDiagnostics(
45694569
// (2,5): error CS8100: The 'await' operator cannot be used in a static script variable initializer.
45704570
// await System.Threading.Tasks.Task.FromResult(1);

src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConversionTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ public interface IAaa
10671067
10681068
";
10691069

1070-
var compilation = CreateCompilationWithMscorlib45AndCSharp(source, options: TestOptions.ReleaseExe.WithAllowUnsafe(true));
1070+
var compilation = CreateCompilationWithMscorlib461AndCSharp(source, options: TestOptions.ReleaseExe.WithAllowUnsafe(true));
10711071
CompileAndVerify(compilation);
10721072
}
10731073

0 commit comments

Comments
 (0)