See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.
* Manual removal of C# Main args
* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -public] Make test entrypoints accessible
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Manual fixes for xUnit1013 - internal methods, disable for region
* Add merged group
*/
using System;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
{
const int minDepth = 4;
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = 0;
- if (args.Length > 0) n = Int32.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Test(int? arg)
+ {
+ int n = arg ?? 0;
int check = Bench(n, true);
int expected = 4398;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
+ <!-- Needed for GCStressIncompatible -->
+ <RequiresProcessIsolation>true</RequiresProcessIsolation>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
+using Xunit;
namespace BenchmarksGame
{
{
public const int MinDepth = 4;
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- var n = args.Length == 0 ? 0 : int.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Test(int? arg)
+ {
+ var n = arg ?? 0;
int check = Bench(n, true);
int expected = 4398;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
+ <!-- Needed for GCStressIncompatible -->
+ <RequiresProcessIsolation>true</RequiresProcessIsolation>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
+using Xunit;
//using BenchmarkDotNet.Attributes;
//using MicroBenchmarks;
// 21 is used in official numbers; about 7.8s
const int N = 18;
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- var n = args.Length == 0 ? 0 : int.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Test(int? arg)
+ {
+ var n = arg ?? 0;
int check = Bench(n, true);
const int expected = 4398;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
+ <!-- Needed for GCStressIncompatible -->
+ <RequiresProcessIsolation>true</RequiresProcessIsolation>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
*/
using System;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
} while (true);
}
- static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = (args.Length > 0) ? Int32.Parse(args[0]) : 7;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 7;
var fr2 = new FannkuchRedux_2();
var pf = fr2.fannkuch(n);
Console.Write("{0}\nPfannkuchen({1}) = {2}\n", pf[0], n, pf[1]);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Threading;
using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
maxFlips[taskId] = maxflips;
}
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = args.Length > 0 ? int.Parse(args[0]) : 7;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 7;
int sum = Bench(n, true);
int expected = 16;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
+using Xunit;
//using BenchmarkDotNet.Attributes;
//using MicroBenchmarks;
//[BenchmarkCategory(Categories.Runtime, Categories.BenchmarksGame, Categories.JIT)]
public unsafe class FannkuchRedux_9
{
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = args.Length > 0 ? int.Parse(args[0]) : 7;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 7;
int sum = Bench(n, true);
int expected = 228;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Xunit;
namespace BenchmarksGame
{
const int IC = 29573;
static int seed = 42;
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = args.Length > 0 ? Int32.Parse(args[0]) : 1000;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 1000;
Bench(n, true);
return 100;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.IO;
+using System.Runtime.CompilerServices;
using System.Text;
+using Xunit;
namespace BenchmarksGame
{
public class Fasta_2
{
- static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = args.Length > 0 ? Int32.Parse(args[0]) : 1000;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 1000;
Bench(n, true);
return 100;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.IO;
using System.Collections.Generic;
using System.Text;
+using Xunit;
namespace BenchmarksGame
{
public class KNucleotide_1
{
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
return string.Concat(n.ToString(), "\t", fragment);
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
bool ok = Bench(helpers, true);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.IO;
+using System.Runtime.CompilerServices;
using System.Security.Cryptography;
+using Xunit;
namespace BenchmarksGame
{
public class Mandelbrot_2
{
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int width = 80;
- if (args.Length > 0)
- width = Int32.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int width = arg ?? 80;
int lineLen = (width - 1) / 8 + 1;
var bytes = new byte[width * lineLen];
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Threading.Tasks;
+using Xunit;
namespace BenchmarksGame
{
return (byte)(res ^ -1);
}
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- var size = (args.Length > 0) ? int.Parse(args[0]) : 80;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int size = arg ?? 80;
var lineLength = size >> 3;
var data = DoBench(size, lineLength);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
*/
using System;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
public class NBody_3
{
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = args.Length > 0 ? Int32.Parse(args[0]) : 10000;
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 10000;
bool success = Bench(n, true);
return (success ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
*/
using System;
using System.Numerics;
+using System.Runtime.CompilerServices;
using System.Text;
+using Xunit;
namespace BenchmarksGame
{
}
}
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = (args.Length > 0 ? Int32.Parse(args[0]) : 10);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 10;
string result = Bench(n, true).ToString();
if (result != "3141592653\t:10")
{
return m.lastBuf;
}
}
-}
\ No newline at end of file
+}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.IO;
using System.Text.RegularExpressions;
+using Xunit;
namespace BenchmarksGame
{
public class RegexRedux_1
{
- static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.IO;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
+using Xunit;
namespace BenchmarksGame
{
return r + " " + c;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.IO;
using System.Collections.Generic;
using System.Security.Cryptography;
+using Xunit;
namespace BenchmarksGame
{
const byte Gt = (byte)'>';
const byte Lf = (byte)'\n';
- static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
var outBytes = new byte[helpers.FileLength];
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Collections.Concurrent;
using System.Security.Cryptography;
using System.Threading;
+using Xunit;
namespace BenchmarksGame
{
}
}
- static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var helpers = new TestHarnessHelpers(bigInput: false);
var outBytes = new byte[helpers.FileLength];
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarksGame
{
public class SpectralNorm_1
{
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = 100;
- if (args.Length > 0) n = Int32.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 100;
double norm = new SpectralNorm_1().Bench(n);
Console.WriteLine("{0:f9}", norm);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
+using Xunit;
namespace BenchmarksGame
{
public class SpectralNorm_3
{
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = 100;
- if (args.Length > 0) n = Int32.Parse(args[0]);
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int Test(int? arg)
+ {
+ int n = arg ?? 100;
double norm = Bench(n);
Console.WriteLine("{0:f9}", norm);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
using System.Diagnostics;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- [MethodImpl(MethodImplOptions.NoOptimization)]
- public static int Main(string[] argv)
+ [Fact]
+ public static int TestEntryPoint()
{
- if (argv.Length > 0)
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
+ private static int Test(int? arg)
+ {
+ if (arg.HasValue)
{
- Iterations = Int32.Parse(argv[0]);
+ Iterations = (int)arg;
}
Stopwatch sw = Stopwatch.StartNew();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return true;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return true;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return true;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench(Iterations);
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = (new LLoops()).Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return (x * y - (8.0 * z) / 3.0);
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return (-(x));
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
iflag = 2;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return (System.Math.Exp((-(x)) * (x)));
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return (System.Math.Exp((-(x)) * 2));
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
return ((-2) * (x) * (F(x)));
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchF
{
e1[s_l] = e1[s_j];
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = Bench(Iterations);
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return (s_position == 91);
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = Bench();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.BenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchF
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchF
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchF
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var lloops = new MDLLoops();
bool result = lloops.TestBase();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchF
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchF
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return Bench(Iterations, s, d);
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = Test() && Test2();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = TestBase();
return (result ? 100 : -1);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Benchstone.MDBenchI
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using System.Diagnostics;
+using Xunit;
public class BilinearTest
{
//ref values
double[] A, B, input, output;
- public void Setup()
+ internal void Setup()
{
A = new double[lengthA];
B = new double[lengthB];
return true;
}
- public void RunTests()
+ internal void RunTests()
{
Setup();
}
}
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
BilinearTest test = new BilinearTest();
test.RunTests();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
+using Xunit;
public class Burgers
{
return un;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
if (!Vector.IsHardwareAccelerated)
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.IO;
+using System.Runtime.CompilerServices;
+using Xunit;
internal class global
{
private static double[] s_bindex;
private static HarnessTest[] s_tests;
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
ByteMark app = new ByteMark();
- int result = app.ExecuteCore(args);
+ int result = app.ExecuteCore(Array.Empty<string>());
return result;
}
global.align = 8;
global.write_to_file = false;
}
-}
\ No newline at end of file
+}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
+ <!-- Needed for GCStressIncompatible, UnloadabilityIncompatible -->
+ <RequiresProcessIsolation>true</RequiresProcessIsolation>
<GCStressIncompatible>true</GCStressIncompatible>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<!-- This test takes a very long time when run with runincontext -->
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
+using Xunit;
// Performance tests for optimizations related to EqualityComparer<T>.Default
BLUE = 2
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var valueTupleFixture = new EqualityComparerFixture<ValueTuple<byte, E, int>>();
var v0 = new ValueTuple<byte, E, int>(3, E.RED, 11);
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
<ItemGroup>
<Compile Include="DefaultEqualityComparerPerf.cs" />
</ItemGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace FractalPerf
{
return result;
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
bool result = TestBase();
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
using System.Collections.Concurrent;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
+using Xunit;
-class Program
+public class Program
{
#if DEBUG
_freeBuffers = new ObjectPool<int[]>(() => new int[_width * 3 * _height]); // Each pixel has 3 fields (RGB)
}
- static unsafe int Main()
+ [Fact]
+ public static unsafe int TestEntryPoint()
{
if (Avx2.IsSupported)
{
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Inlining
{
return (result == 22);
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool withFormat = WithFormatBase();
bool withoutFormat = WithoutFormatBase();
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
<ItemGroup>
<Compile Include="InlineGCStruct.cs" />
</ItemGroup>
using System;
using System.Runtime.CompilerServices;
+using Xunit;
namespace Inlining
{
return a.Length + b.Length + c.Length + d.Length;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
return (Bench("a", "bc", "def", "ghij") == 10) ? 100 : -1;
}
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
<ItemGroup>
<Compile Include="NoThrowInline.cs" />
</ItemGroup>
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using Xunit;
// Test code taken directly from https://github.com/dotnet/runtime/issues/7474
// Laying the loop's early return path in-line can cost 30% on this micro-benchmark.
{
public unsafe class SearchLoops
{
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
// Make sure equal strings compare as such
if (!LoopReturn("hello", "hello") || !LoopGoto("goodbye", "goodbye"))
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
using System.Runtime.CompilerServices;
using System.Collections.Generic;
using System.Linq;
+using Xunit;
public class Product
{
}
#endregion
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var tests = new LinqBenchmarks();
bool result = tests.Bench();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace Functions
{
["tanhsingle"] = MathTests.TanhSingleTest
};
- private static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
+ {
+ return Test(Array.Empty<string>());
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int Test(string[] args)
{
var isPassing = true; var iterations = defaultIterations;
ICollection<string> testsToRun = new HashSet<string>();
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
<ItemGroup>
<Compile Include="Functions.cs" />
<Compile Include="MathTests.cs" />
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
+using Xunit;
public static class CscBench
{
public static bool DataflowBench()
{
var text = @"
-class C {
+public class C {
public void F(int x)
{
int a;
return result;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
bool result = true;
if (!FindMscorlib())
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
+ <!-- Needed for GCStressIncompatible, NativeAotIncompatible -->
+ <RequiresProcessIsolation>true</RequiresProcessIsolation>
<GCStressIncompatible>true</GCStressIncompatible>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<MonoAotIncompatible>true</MonoAotIncompatible>
using System;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace SIMD
{
Console.WriteLine("In benchmark mode, a larger set is computed but nothing is dumped.");
}
- private static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
+ {
+ return Test(Array.Empty<string>());
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int Test(string[] args)
{
try
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Concurrent;
+using Xunit;
namespace SIMD
{
return true;
}
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
var r = new RayTracerBench();
bool result = r.Run();
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
+using Xunit;
public static class SeekUnroll
{
// Set of indices to pass to Test(int)
static int[] IndicesToTest = new int[] { 1, 3, 11, 19, 27 };
+ [Fact]
+ public static int TestEntryPoint()
+ {
+ return TestEntry(null);
+ }
+
// Main method entrypoint runs the manual timer loop
- public static int Main(string[] args)
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int TestEntry(int? arg)
{
int failures = 0;
}
int manualLoopCount = 1;
- if (args == null || args.Length == 0)
+ if (arg == null)
{
Console.WriteLine("Warning: no iteration count specified; defaulting to 1 iteration per case");
Console.WriteLine("To use multiple iterations per case, pass the desired number of iterations as the first command-line argument to this test");
}
else
{
- manualLoopCount = int.Parse(args[0]);
+ manualLoopCount = (int)arg;
}
foreach(int index in IndicesToTest)
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
using System;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace SciMark2
{
public class CommandLine
{
+ [Fact]
+ public static int TestEntryPoint()
+ {
+ return Test(Array.Empty<string>());
+ }
+
/// <summary>
/// Benchmark 5 kernels with individual Mflops.
/// "results[0]" has the average Mflop rate.
/// </summary>
- public static int Main(System.String[] args)
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Test(System.String[] args)
{
#if DEBUG
double min_time = Constants.RESOLUTION_TINY;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
using System.Runtime.Serialization.Json;
using System.Text;
using Newtonsoft.Json.Bson;
+using Xunit;
namespace Serialization
{
}
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
var tests = new JsonBenchmarks();
bool result = tests.Deserialize();
return result ? 100 : -1;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using Newtonsoft.Json.Bson;
+using Xunit;
namespace Serialization
{
}
}
- public static int Main() {
+ [Fact]
+ public static int TestEntryPoint() {
var tests = new JsonBenchmarks();
bool result = tests.Serialize();
return result ? 100 : -1;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+using Xunit;
namespace Span
{
Console.WriteLine();
}
- public static int Main(string[] args)
+ [Fact]
+ public static int TestEntryPoint()
+ {
+ return Test(Array.Empty<string>());
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Test(string[] args)
{
if (args.Length > 0)
{
<Project Sdk="Microsoft.NET.Sdk">
<!-- Always try to use latest Roslyn compiler -->
<PropertyGroup>
- <OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
+using Xunit;
+
+#pragma warning disable xUnit1013
namespace Span
{
#endregion // TestSpanAPIs
- public static int Main()
+ [Fact]
+ public static int TestEntryPoint()
{
// Now simulate xunit-perf's benchmark discovery so we know what tests to invoke
TypeInfo t = typeof(SpanBench).GetTypeInfo();
}
}
}
+
+#pragma warning restore xUnit1013
<Project Sdk="Microsoft.NET.Sdk">
<!-- Always try to use latest Roslyn compiler -->
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace V8.Crypto
{
{
private const string INPUT = "The quick brown fox jumped over the extremely lazy frogs!";
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = 1;
-
- if (args.Length > 0)
- {
- n = Int32.Parse(args[0]);
- }
-
- bool verbose = false;
+ return Test(null, false);
+ }
- if (args.Length > 1)
- {
- switch (args[1])
- {
- case "verbose":
- verbose = true;
- break;
- default:
- Console.WriteLine("Bad arg: '{0}'.\n", args[1]);
- return -1;
- }
- }
+ // Main method entrypoint runs the manual timer loop
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int Test(int? iters, bool verbose)
+ {
+ int n = iters ?? 1;
Measure(n, verbose);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
#define INTF_FOR_TASK
using System;
+using System.Runtime.CompilerServices;
+using Xunit;
namespace V8.Richards
{
public const int DATA_SIZE = 4;
- public static int Main(String[] args)
+ [Fact]
+ public static int TestEntryPoint()
{
- int n = 1;
- if (args.Length > 0)
- {
- n = Int32.Parse(args[0]);
- }
+ return Test(null);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int Test(int? arg)
+ {
+ int n = arg ?? 1;
bool result = Measure(n);
return (result ? 100 : -1);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
- <PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+ <Import Project="..\..\Directory.Merged.props" />
+ <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
+
+ <PropertyGroup>
+ <RunAnalyzers>true</RunAnalyzers>
+ <EnableNETAnalyzers>false</EnableNETAnalyzers>
+ </PropertyGroup>
+</Project>
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <ItemGroup>
+ <MergedWrapperProjectReference Include="*/**/*.??proj" />
+ </ItemGroup>
+
+ <Import Project="$(TestSourceDir)MergedTestRunner.targets" />
+</Project>