Skip to content

Commit

Permalink
Use dotnet run for ComputeSharp.Tests.GlobalStatements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Sep 6, 2023
1 parent 9bb2c67 commit baa2c75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<Platforms>AnyCPU;x64;ARM64</Platforms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\ComputeSharp.Core\ComputeSharp.Core.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions tests/ComputeSharp.Tests.GlobalStatements/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ComputeSharp;
using Microsoft.VisualStudio.TestTools.UnitTesting;

float[] numbers = Enumerable.Range(0, 128).Select(i => (float)i).ToArray();

Expand All @@ -15,11 +14,12 @@

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]
Expand Down

0 comments on commit baa2c75

Please sign in to comment.