Skip to content

Commit ad126b6

Browse files
committed
Added automated unit tests
1 parent 4f670f0 commit ad126b6

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: .NET Tests
2+
3+
on:
4+
push:
5+
branches: [ master, ci-test ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: true
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '9.0.x'
21+
22+
- name: Install OpenGL deps
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y \
26+
xvfb \
27+
libgl1-mesa-dev \
28+
libglu1-mesa-dev \
29+
mesa-utils
30+
31+
- uses: actions/checkout@v4
32+
with:
33+
repository: KhronosGroup/SPIRV-Cross
34+
path: SPIRV-Cross
35+
- name: Build and install SPIRV-Cross
36+
run: |
37+
mkdir build && cd build
38+
cmake .. -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF # Build shared library, disable CLI
39+
cmake --build . --config Release
40+
sudo cmake --install .
41+
sudo ln -s /usr/local/lib/libspirv-cross-c-shared.so /usr/lib/libspirv-cross.so
42+
sudo ldconfig
43+
working-directory: SPIRV-Cross
44+
45+
- name: Restore dependencies
46+
run: dotnet restore
47+
- name: Build
48+
run: dotnet build --no-restore
49+
- name: Test123
50+
run: |
51+
xvfb-run -s "-screen 0 1280x720x24" env | grep DISPLAY || true
52+
xvfb-run -s "-screen 0 1280x720x24" glxinfo -B || true
53+
- name: Run tests
54+
run: xvfb-run -s "-screen 0 1280x720x24" dotnet test --no-build --verbosity normal

src/Stride.Shaders.Tests/ParsingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static IEnumerable<object[]> GetShaderFilePaths()
1919
}
2020
}
2121

22-
[Theory]
22+
[Theory(Explicit = true)]
2323
[MemberData(nameof(GetShaderFilePaths))]
2424
public void ParseFile(string path)
2525
{

src/Stride.Shaders.Tests/Stride.Shaders.Parsing.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
1717
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
1818
<PackageReference Include="xunit.v3" Version="3.1.0" />
19+
1920
</ItemGroup>
2021

2122
<ItemGroup>

0 commit comments

Comments
 (0)