if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {Op3VectorType}<{Op3BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" secondOp: ({string.Join(", ", secondOp)})");
- Console.WriteLine($" thirdOp: ({string.Join(", ", thirdOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {Op3VectorType}<{Op3BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" secondOp: ({string.Join(", ", secondOp)})");
+ TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
{
Succeeded = false;
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
{
Succeeded = false;
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
{
Succeeded = false;
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
{
Succeeded = false;
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
- Console.WriteLine($" value: ({string.Join(", ", value)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" value: ({string.Join(", ", value)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>.{Imm}, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>.{Imm}, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>.{Imm}): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>.{Imm}): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}><9>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>.{Imm}): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>.{Imm}): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
// See the LICENSE file in the project root for more information.
using System;
-using System.Linq;
using System.Collections.Generic;
+using System.Linq;
namespace JIT.HardwareIntrinsics.X86
{
foreach (string testToRun in GetTestsToRun(args))
{
- Console.WriteLine($"Running {testToRun} test...");
+ TestLibrary.TestFramework.BeginTestCase(testToRun);
try
{
}
catch (Exception e)
{
- Console.WriteLine($"Error: {e.Message}");
+ TestLibrary.TestFramework.LogError(e.GetType().ToString(), e.Message);
+ TestLibrary.TestFramework.LogVerbose(e.StackTrace);
isPassing = false;
}
+
+ TestLibrary.TestFramework.EndTestCase();
}
return isPassing ? PASS : FAIL;
private static void PrintUsage()
{
- Console.WriteLine($@"Usage:
+ TestLibrary.TestFramework.LogInformation($@"Usage:
{Environment.GetCommandLineArgs()[0]} [testName]
[testName]: The name of the function to test.
Available Test Names:");
foreach (string testName in TestList.Keys)
{
- Console.WriteLine($" {testName}");
+ TestLibrary.TestFramework.LogInformation($" {testName}");
}
Environment.Exit(FAIL);
if (isUnexpectedResult)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1BaseType}, {Op2BaseType}): {Method} failed:");
- Console.WriteLine($" left: {left}");
- Console.WriteLine($" right: {right}");
- Console.WriteLine($" result: {result}");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1BaseType}, {Op2BaseType}): {Method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: {left}");
+ TestLibrary.TestFramework.LogInformation($" right: {right}");
+ TestLibrary.TestFramework.LogInformation($" result: {result}");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (isUnexpectedResult)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1BaseType}): {Method} failed:");
- Console.WriteLine($" data: {data}");
- Console.WriteLine($" result: {result}");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1BaseType}): {Method} failed:");
+ TestLibrary.TestFramework.LogInformation($" data: {data}");
+ TestLibrary.TestFramework.LogInformation($" result: {result}");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: result");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: result");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
- Console.WriteLine($" left: ({string.Join(", ", left)})");
- Console.WriteLine($" right: ({string.Join(", ", right)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
+ TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {Op3VectorType}<{Op3BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" secondOp: ({string.Join(", ", secondOp)})");
- Console.WriteLine($" thirdOp: ({string.Join(", ", thirdOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {Op3VectorType}<{Op3BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" secondOp: ({string.Join(", ", secondOp)})");
+ TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}
if (!Succeeded)
{
- Console.WriteLine($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
- Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
- Console.WriteLine($" result: ({string.Join(", ", result)})");
- Console.WriteLine();
+ TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>): {method} failed:");
+ TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
+ TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
+ TestLibrary.TestFramework.LogInformation(string.Empty);
}
}
}