From baa2c75cbbbfb857c5b85772b024db7c6df00dee Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 6 Sep 2023 21:03:10 +0200 Subject: [PATCH] Use dotnet run for ComputeSharp.Tests.GlobalStatements --- .github/workflows/dotnet.yml | 2 +- .../ComputeSharp.Tests.GlobalStatements.csproj | 4 ---- tests/ComputeSharp.Tests.GlobalStatements/Program.cs | 10 +++++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c85bcfe1..b8884251 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -89,7 +89,7 @@ jobs: - name: Run ComputeSharp.Tests.DisableDynamicCompilation run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release -f ${{matrix.framework}} /p:Platform=x64 -v n -l "console;verbosity=detailed" - name: Run ComputeSharp.Tests.GlobalStatements - run: dotnet test tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release -f ${{matrix.framework}} /p:Platform=x64 -v n -l "console;verbosity=detailed" + run: dotnet run --project tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release -f ${{matrix.framework}} /p:Platform=x64 -v n -l "console;verbosity=detailed" - name: Run ComputeSharp.Tests.Internals run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release -f ${{matrix.framework}} /p:Platform=x64 -v n -l "console;verbosity=detailed" diff --git a/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj index 07054e96..9362935f 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj +++ b/tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj @@ -5,10 +5,6 @@ AnyCPU;x64;ARM64 enable - - - - diff --git a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs index b4cdd3ac..9991f2ec 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs +++ b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs @@ -1,5 +1,4 @@ using ComputeSharp; -using Microsoft.VisualStudio.TestTools.UnitTesting; float[] numbers = Enumerable.Range(0, 128).Select(i => (float)i).ToArray(); @@ -15,11 +14,12 @@ foreach (ref float number in numbers.AsSpan()) float[] result = buffer.ToArray(); -CollectionAssert.AreEqual( - expected: numbers, - actual: result); +if (!numbers.SequenceEqual(result)) +{ + throw new Exception("The processed buffer does not match the expected results."); +} -Console.WriteLine("Test passed successfully"); +Console.WriteLine("Test passed successfully!"); // See https://github.com/Sergio0694/ComputeSharp/issues/374 [ShaderMethod]