Skip to content

Commit 0f784ce

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

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: .NET Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
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+
- uses: actions/checkout@v4
23+
with:
24+
repository: KhronosGroup/SPIRV-Cross
25+
path: SPIRV-Cross
26+
- name: Build and install SPIRV-Cross
27+
run: |
28+
mkdir build && cd build
29+
cmake .. -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_CLI=OFF # Build shared library, disable CLI
30+
cmake --build . --config Release
31+
sudo cmake --install .
32+
sudo ln -s /usr/local/lib/libspirv-cross-c-shared.so /usr/lib/libspirv-cross.so
33+
sudo ldconfig
34+
ldconfig -p | grep spirv-cross
35+
LD_DEBUG=libs LD_PRELOAD=libspirv-cross.so true
36+
working-directory: SPIRV-Cross
37+
38+
- name: Check SPIRV-Cross
39+
run: |
40+
sudo find /usr /opt /lib /lib64 -maxdepth 5 -iname "libspirv-cross*"
41+
42+
- name: Restore dependencies
43+
run: dotnet restore
44+
- name: Build
45+
run: dotnet build --no-restore
46+
- name: Run tests
47+
run: 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)