提交 a92324d4 编写于 作者: J Jared Parsons

Remove CSharpTestBaseBase

上级 04838e47
......@@ -3117,7 +3117,7 @@ class C
}
";
var comp = CSharpTestBaseBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
var comp = CSharpTestBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
// CONSIDER: It would be nice if we didn't squiggle the whole method body, but this is a corner case.
comp.VerifyEmitDiagnostics(
......@@ -3147,7 +3147,7 @@ class C
{
async Task M() {}
}";
var comp = CSharpTestBaseBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
var comp = CSharpTestBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
comp.VerifyEmitDiagnostics(
// (4,16): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
// async Task M() {}
......@@ -3178,7 +3178,7 @@ class C
{
async Task<int> F() => 3;
}";
var comp = CSharpTestBaseBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
var comp = CSharpTestBase.CreateCompilation(source, new[] { MscorlibRef }, TestOptions.ReleaseDll); // NOTE: 4.0, not 4.5, so it's missing the async helpers.
comp.VerifyEmitDiagnostics(
// (4,21): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
// async Task<int> F() => 3;
......
......@@ -2612,7 +2612,7 @@ void M()
tree.GetDiagnostics(root).Verify(
// (7,36): error CS1003: Syntax error, 'when' expected
// catch (System.Exception e) if (true) { }
CSharpTestBaseBase.Diagnostic(ErrorCode.ERR_SyntaxError, "if").WithArguments("when", "if").WithLocation(7, 36));
CSharpTestBase.Diagnostic(ErrorCode.ERR_SyntaxError, "if").WithArguments("when", "if").WithLocation(7, 36));
var filterClause = root.DescendantNodes().OfType<CatchFilterClauseSyntax>().Single();
Assert.Equal(SyntaxKind.WhenKeyword, filterClause.WhenKeyword.Kind());
......
......@@ -28,7 +28,7 @@
namespace Microsoft.CodeAnalysis.CSharp.Test.Utilities
{
public abstract class CSharpTestBase : CSharpTestBaseBase
public abstract class CSharpTestBase : CommonTestBase
{
protected CSharpCompilation GetCSharpCompilationForEmit(
IEnumerable<string> source,
......@@ -36,7 +36,7 @@ public abstract class CSharpTestBase : CSharpTestBaseBase
CompilationOptions options,
ParseOptions parseOptions)
{
return (CSharpCompilation)base.GetCompilationForEmit(source, additionalRefs, options, parseOptions);
return (CSharpCompilation)GetCompilationForEmit(source, additionalRefs, options, parseOptions);
}
private Action<IModuleSymbol> Translate2(Action<ModuleSymbol> action)
......@@ -252,10 +252,6 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
verify: verify);
}
}
public abstract class CSharpTestBaseBase : CommonTestBase
{
public static CSharpCompilation CreateWinRtCompilation(string text, MetadataReference[] additionalRefs = null)
{
return CSharpTestBase.CreateCompilation(text,
......
......@@ -29,13 +29,13 @@ public CSharpResultProviderTestBase() : this(new CSharpFormatter())
public static Assembly GetAssembly(string source)
{
var comp = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source);
var comp = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source);
return ReflectionUtilities.Load(comp.EmitToArray());
}
public static Assembly GetUnsafeAssembly(string source)
{
var comp = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, options: TestOptions.UnsafeReleaseDll);
var comp = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, options: TestOptions.UnsafeReleaseDll);
return ReflectionUtilities.Load(comp.EmitToArray());
}
......
......@@ -191,7 +191,7 @@ class C
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateStandardCompilation(source, references: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateStandardCompilation(source, references: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -227,7 +227,7 @@ public void LongTuple_NoNames()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateStandardCompilation(source, references: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateStandardCompilation(source, references: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -447,7 +447,7 @@ public void Dynamic()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -484,7 +484,7 @@ public void Names_LongTuple()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -516,7 +516,7 @@ public void PartialNames()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -568,7 +568,7 @@ class C
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -597,7 +597,7 @@ public void NamesAndDynamic()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -643,7 +643,7 @@ class C
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -683,7 +683,7 @@ class C
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -751,7 +751,7 @@ class B
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -842,7 +842,7 @@ class C
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -917,7 +917,7 @@ object Nine
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -1063,7 +1063,7 @@ public void RawView()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateStandardCompilation(source, references: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateStandardCompilation(source, references: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -1115,7 +1115,7 @@ class async
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateStandardCompilation(source, references: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateStandardCompilation(source, references: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -1208,7 +1208,7 @@ class B
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateStandardCompilation(source, references: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateStandardCompilation(source, references: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -1250,7 +1250,7 @@ public void Exception()
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
DkmClrRuntimeInstance runtime = null;
runtime = new DkmClrRuntimeInstance(
......@@ -1293,7 +1293,7 @@ class E : System.Exception
}";
var assembly0 = GenerateTupleAssembly();
var reference0 = AssemblyMetadata.CreateFromImage(assembly0).GetReference();
var compilation1 = CSharpTestBaseBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var compilation1 = CSharpTestBase.CreateCompilationWithMscorlib45AndCSruntime(source, additionalRefs: new[] { reference0 });
var assembly1 = compilation1.EmitToArray();
var runtime = new DkmClrRuntimeInstance(ReflectionUtilities.GetMscorlib(ReflectionUtilities.Load(assembly0), ReflectionUtilities.Load(assembly1)));
using (runtime.Load())
......@@ -1454,7 +1454,7 @@ public TupleElementNamesAttribute(string[] names)
}
}
}";
var comp = CSharpTestBaseBase.CreateStandardCompilation(source, assemblyName: "Tuples");
var comp = CSharpTestBase.CreateStandardCompilation(source, assemblyName: "Tuples");
comp.VerifyDiagnostics();
return comp.EmitToArray();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册