Skip to content

Commit

Permalink
Run tests in CI.
Browse files Browse the repository at this point in the history
* Download glslangvalidator from Khronos GitHub releases.
* Use Fxc which is already available on AppVeyor machines.
* Metal is not compiled in the tests.
  • Loading branch information
mellinoe committed Mar 29, 2018
1 parent 856e36b commit dbeb71d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
build_script:
ci-build.cmd

before_test:
- appveyor DownloadFile https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip -FileName glslangvalidator.zip
- unzip glslangvalidator.zip
- set PATH=%APPVEYOR_BUILD_FOLDER%\bin;%PATH%

test_script:
- ci-test.cmd

artifacts:
- path: bin\Packages\Release\*.nupkg
name: nugetPackages
Expand Down
1 change: 1 addition & 0 deletions ci-test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet test src\ShaderGen.Tests\ShaderGen.Tests.csproj
2 changes: 1 addition & 1 deletion src/ShaderGen/Glsl/GlslBackendBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GlslBackendBase(Compilation compilation) : base(compilation)

protected void WriteStructure(StringBuilder sb, StructureDefinition sd)
{
sb.AppendLine($"struct {CSharpToShaderType(sd.Name)}");
sb.AppendLine($"BAD CODE struct {CSharpToShaderType(sd.Name)}");
sb.AppendLine("{");
StringBuilder fb = new StringBuilder();
foreach (FieldDefinition field in sd.Fields)
Expand Down
2 changes: 1 addition & 1 deletion src/ShaderGen/Hlsl/HlslBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override string CSharpToShaderTypeCore(string fullType)

protected void WriteStructure(StringBuilder sb, StructureDefinition sd)
{
sb.AppendLine($"struct {CSharpToShaderType(sd.Name)}");
sb.AppendLine($"BAD CODE struct {CSharpToShaderType(sd.Name)}");
sb.AppendLine("{");
HlslSemanticTracker tracker = new HlslSemanticTracker();
StringBuilder fb = new StringBuilder();
Expand Down

2 comments on commit dbeb71d

@tgjones
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Are you considering adding a Travis CI build, with a Mac build agent? It doesn't seem too hard to install .NET Core on a Travis CI Mac build agent, although I haven't tried it myself.

@mellinoe
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to set that up sometime soon. It would be really nice to get complete test coverage.

Please sign in to comment.