Skip to content

Commit 252d5ce

Browse files
committed
Minimal example of tests.
1 parent fcfed98 commit 252d5ce

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@ jobs:
2020
run: dotnet build -c Release
2121

2222
- name: Run tests on CPU
23-
run: dotnet test
23+
run: dotnet test --filter Category=CPU_Tests
2424

2525

2626
- name: Setup POCL and clinfo
27-
if: runner.os == 'Linux'
27+
if: runner.os == 'Linux'
2828
run: |
2929
sudo apt-get update
3030
sudo apt-get install -y pocl-opencl-icd clinfo
3131
3232
- name: Check OpenCL
33-
if: runner.os == 'Linux'
33+
if: runner.os == 'Linux'
3434
run: clinfo
35+
36+
- name: Run tests on GPU (with POCL)
37+
if: runner.os == 'Linux'
38+
run: dotnet test --filter Category=GPU_Tests

ImageProcessing.sln

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ImageProcessing", "src\Imag
99
EndProject
1010
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MatrixMultiplication", "src\MatrixMultiplication\MatrixMultiplication.fsproj", "{2EB0E864-6847-4FC3-8C64-FDBE8C54B956}"
1111
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0246572D-F011-4077-B69A-D453ABFAD48B}"
13+
EndProject
14+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ImageProcessing.Tests", "tests\ImageProcessing.Tests\ImageProcessing.Tests.fsproj", "{DE51E49C-29B8-484D-AB7F-5F1A18485149}"
15+
EndProject
1216
Global
1317
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1418
Debug|Any CPU = Debug|Any CPU
@@ -46,9 +50,22 @@ Global
4650
{2EB0E864-6847-4FC3-8C64-FDBE8C54B956}.Release|x64.Build.0 = Release|Any CPU
4751
{2EB0E864-6847-4FC3-8C64-FDBE8C54B956}.Release|x86.ActiveCfg = Release|Any CPU
4852
{2EB0E864-6847-4FC3-8C64-FDBE8C54B956}.Release|x86.Build.0 = Release|Any CPU
53+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|x64.ActiveCfg = Debug|Any CPU
56+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|x64.Build.0 = Debug|Any CPU
57+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|x86.ActiveCfg = Debug|Any CPU
58+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Debug|x86.Build.0 = Debug|Any CPU
59+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|Any CPU.Build.0 = Release|Any CPU
61+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|x64.ActiveCfg = Release|Any CPU
62+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|x64.Build.0 = Release|Any CPU
63+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|x86.ActiveCfg = Release|Any CPU
64+
{DE51E49C-29B8-484D-AB7F-5F1A18485149}.Release|x86.Build.0 = Release|Any CPU
4965
EndGlobalSection
5066
GlobalSection(NestedProjects) = preSolution
5167
{5D30E174-2538-47AC-8443-318C8C5DC2C9} = {C397A34C-84F1-49E7-AEBC-2F9F2B196216}
5268
{2EB0E864-6847-4FC3-8C64-FDBE8C54B956} = {C397A34C-84F1-49E7-AEBC-2F9F2B196216}
69+
{DE51E49C-29B8-484D-AB7F-5F1A18485149} = {0246572D-F011-4077-B69A-D453ABFAD48B}
5370
EndGlobalSection
5471
EndGlobal
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
4+
<PropertyGroup>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Compile Include="Tests.fs" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="coverlet.collector" Version="6.0.4" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
16+
<PackageReference Include="xunit" Version="2.9.3" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<ProjectReference Include="..\..\src\ImageProcessing\ImageProcessing.fsproj" />
22+
</ItemGroup>
23+
24+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Tests
2+
3+
open System
4+
open Xunit
5+
6+
7+
[<Fact>]
8+
[<Trait("Category", "CPU_Tests")>]
9+
let ``Dummy fact for CPU`` () =
10+
Assert.True(true)
11+
12+
13+
[<Fact>]
14+
[<Trait("Category", "GPU_Tests")>]
15+
let ``Dummy fact for GPU`` () =
16+
Assert.True(true)

0 commit comments

Comments
 (0)