Update the version of the xUnit Performance Api (#15620)
authorJosé Rivero <jorive@microsoft.com>
Wed, 27 Dec 2017 17:48:34 +0000 (09:48 -0800)
committerGitHub <noreply@github.com>
Wed, 27 Dec 2017 17:48:34 +0000 (09:48 -0800)
- This version fail broken benchmarks, so we can catch bad codegen and bug earlier.
- Changed the harness to exit with non-zero code when an exception is thrown.

dependencies.props
tests/src/Common/PerfHarness/PerfHarness.cs

index 7972543..62f048f 100644 (file)
@@ -37,7 +37,7 @@
     <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>2.1.0-preview1-26026-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
     <XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
     <XunitConsoleNetcorePackageVersion>1.0.2-prerelease-00177</XunitConsoleNetcorePackageVersion>
-    <XunitPerformanceApiPackageVersion>1.0.0-beta-build0012</XunitPerformanceApiPackageVersion>
+    <XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
     <MicrosoftDiagnosticsTracingTraceEventPackageVersion>1.0.3-alpha-experimental</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
     <VCRuntimeVersion>1.2.0</VCRuntimeVersion>
   </PropertyGroup>
index f780225..2ec1dea 100644 (file)
@@ -1,16 +1,21 @@
-using System.IO;
-using System.Reflection;
-using System.Collections.Generic;
+using System;
 using Microsoft.Xunit.Performance.Api;
 
 public class PerfHarness
 {
-    public static void Main(string[] args)
+    public static int Main(string[] args)
     {
-        string assemblyName = args[0];
-        using (XunitPerformanceHarness harness = new XunitPerformanceHarness(args))
+        try
         {
-            harness.RunBenchmarks(assemblyName);
+            using (XunitPerformanceHarness harness = new XunitPerformanceHarness(args))
+                harness.RunBenchmarks(assemblyFileName: args[0]);
+            return 0;
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine("[ERROR] Benchmark execution failed.");
+            Console.WriteLine($"  {ex.ToString()}");
+            return 1;
         }
     }
-}
\ No newline at end of file
+}