From 3052f6fb9bf0c5e17f6033684339cfddb209de5b Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Thu, 12 Feb 2015 15:41:08 -0800 Subject: [PATCH] Switched to using ConditionalFact There were some issues getting xunit to respect the -notrait option hence we decided to simplify and use ConditionalFact --- .../EditAndContinue/EditAndContinueTests.cs | 3 +-- .../Test/Emit/Emit/EditAndContinueTests.vb | 3 +-- .../Binding/Binder_Expressions_Tests.vb | 6 ++--- .../Test/CodeFixes/ExtensionOrderingTests.cs | 3 +-- src/Tools/Source/RunTests/Program.cs | 2 +- src/Tools/Source/RunTests/TestRunner.cs | 27 ++++++++++++------- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs index e1a7c836bc5..d5a72da0257 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs @@ -3775,8 +3775,7 @@ .maxstack 1 /// Reuse existing anonymous types. /// [WorkItem(825903, "DevDiv")] - [Fact] - [Trait("Require32", "true")] + [ConditionalFact(typeof(x86))] public void AnonymousTypes() { var source0 = diff --git a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueTests.vb b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueTests.vb index b47a19fef91..e6b98fb376f 100644 --- a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinueTests.vb @@ -3276,8 +3276,7 @@ End Class ]]>.Value) End Sub - - + Public Sub AnonymousTypes() Dim sources0 = - - + Public Sub Bug1108007_2() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( @@ -3320,8 +3319,7 @@ End Class End Sub - - + Public Sub Bug1108007_8() Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime( diff --git a/src/EditorFeatures/Test/CodeFixes/ExtensionOrderingTests.cs b/src/EditorFeatures/Test/CodeFixes/ExtensionOrderingTests.cs index 9e681f1b03d..a592656b6d4 100644 --- a/src/EditorFeatures/Test/CodeFixes/ExtensionOrderingTests.cs +++ b/src/EditorFeatures/Test/CodeFixes/ExtensionOrderingTests.cs @@ -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. diff --git a/src/Tools/Source/RunTests/Program.cs b/src/Tools/Source/RunTests/Program.cs index 19301153385..a6a0f9f7fef 100644 --- a/src/Tools/Source/RunTests/Program.cs +++ b/src/Tools/Source/RunTests/Program.cs @@ -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; diff --git a/src/Tools/Source/RunTests/TestRunner.cs b/src/Tools/Source/RunTests/TestRunner.cs index c28cc37bbb0..19e511c29b4 100644 --- a/src/Tools/Source/RunTests/TestRunner.cs +++ b/src/Tools/Source/RunTests/TestRunner.cs @@ -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 RunAll(IEnumerable assemblyList) @@ -108,14 +106,10 @@ private async Task 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 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 + } + } } } -- GitLab