提交 3052f6fb 编写于 作者: J Jared Parsons 提交者: Jared Parsons

Switched to using ConditionalFact

There were some issues getting xunit to respect the -notrait option
hence we decided to simplify and use ConditionalFact
上级 ee54148b
......@@ -3775,8 +3775,7 @@ .maxstack 1
/// Reuse existing anonymous types.
/// </summary>
[WorkItem(825903, "DevDiv")]
[Fact]
[Trait("Require32", "true")]
[ConditionalFact(typeof(x86))]
public void AnonymousTypes()
{
var source0 =
......
......@@ -3276,8 +3276,7 @@ End Class
]]>.Value)
End Sub
<Fact()>
<Trait("Require32", "true")>
<ConditionalFact(GetType(x86))>
Public Sub AnonymousTypes()
Dim sources0 = <compilation>
<file name="a.vb"><![CDATA[
......
......@@ -3017,8 +3017,7 @@ End Class
End Sub
<WorkItem(1108007, "DevDiv")>
<Fact()>
<Trait("Require32", "true")>
<ConditionalFact(GetType(x86))>
Public Sub Bug1108007_2()
Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(
<compilation>
......@@ -3320,8 +3319,7 @@ End Class
End Sub
<WorkItem(1108007, "DevDiv")>
<Fact()>
<Trait("Require32", "true")>
<ConditionalFact(GetType(x86))>
Public Sub Bug1108007_8()
Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(
<compilation>
......
......@@ -16,8 +16,7 @@ public class ExtensionOrderingTests
{
private readonly ExportProvider _exportProvider = TestExportProvider.ExportProviderWithCSharpAndVisualBasic;
[Fact]
[Trait("Require32", "true")]
[ConditionalFact(typeof(x86))]
public void TestNoCyclesInFixProviders()
{
// This test will fail if a cycle is detected in the ordering of our code fix providers.
......
......@@ -39,7 +39,7 @@ internal static int Main(string[] args)
? Path.Combine(xunitPath, "xunit.console.exe")
: Path.Combine(xunitPath, "xunit.console.x86.exe");
var testRunner = new TestRunner(xunit, test64);
var testRunner = new TestRunner(xunit);
var start = DateTime.Now;
Console.WriteLine("Running {0} tests", list.Count);
var result = testRunner.RunAll(list).Result;
......
......@@ -31,12 +31,10 @@ internal TestResult(bool succeeded, string assemblyName, TimeSpan elapsed, strin
}
private readonly string _xunitConsolePath;
private readonly bool _use64;
internal TestRunner(string xunitConsolePath, bool use64)
internal TestRunner(string xunitConsolePath)
{
_xunitConsolePath = xunitConsolePath;
_use64 = use64;
}
internal async Task<bool> RunAll(IEnumerable<string> assemblyList)
......@@ -108,14 +106,10 @@ private async Task<TestResult> RunTest(string assemblyPath)
{
var assemblyName = Path.GetFileName(assemblyPath);
var resultsPath = Path.Combine(Path.GetDirectoryName(assemblyPath), Path.ChangeExtension(assemblyName, ".html"));
DeleteFile(resultsPath);
var builder = new StringBuilder();
builder.AppendFormat(@"""{0}""", assemblyPath);
if (_use64)
{
builder.Append(@" -notrait ""Require32=true""");
}
builder.AppendFormat(@" -html ""{0}""", resultsPath);
builder.Append(" -noshadow");
......@@ -163,5 +157,20 @@ private async Task<TestResult> RunTest(string assemblyPath)
return new TestResult(processOutput.ExitCode == 0, assemblyName, span, errorOutput);
}
private static void DeleteFile(string filePath)
{
try
{
if (File.Exists(filePath))
{
File.Delete(filePath);
}
}
catch
{
// Ignore
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册