Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name: GdUnit4 Tests
on:
push: &project_change_filter
branches:
- main
paths:
- 'Template/**/*.cs'
- 'Template/**/*.gd'
Expand Down Expand Up @@ -32,7 +34,7 @@ jobs:
project_dir: './Template'
paths: |
res://Framework/Testing
res://Framework/Netcode/Testing
res://Framework/Netcode/Testing/Tests
console-verbosity: 'normal'
publish-report: false
upload-report: true
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
**/*.godot/*
**/export.cfg
**/export_presets.cfg
**/*.translation

# Mono-specific
**/.mono/
Expand Down
1 change: 0 additions & 1 deletion Template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.godot/*
export.cfg
export_presets.cfg
**/*.translation

# Mono-specific
.mono/
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Template/Framework/Netcode/Testing/Net/ENetTestHarness.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using __TEMPLATE__;
using __TEMPLATE__.Netcode;
using __TEMPLATE__.Netcode.Client;
using System;
Expand All @@ -18,6 +19,7 @@ public sealed class ENetTestHarness<TPacket> : IAsyncDisposable
public TestServer<TPacket> Server { get; }
public TestClient Client { get; }
public Task ConnectTask { get; private set; } = null!;
private readonly Logger _loggerService;

private static int _enetRefCount;

Expand All @@ -26,6 +28,9 @@ public ENetTestHarness(Action<TPacket, uint> onPacket)
AddEnetRef();
Server = new TestServer<TPacket>(onPacket);
Client = new TestClient();
_loggerService = new Logger();
Server.ConfigureLoggerService(_loggerService);
Client.ConfigureLoggerService(_loggerService);
}

public async Task<bool> ConnectAsync(TimeSpan timeout, ENetOptions? options = null)
Expand Down Expand Up @@ -79,6 +84,7 @@ public async ValueTask DisposeAsync()

await WaitForStoppedAsync("client", () => Client.IsRunning, _shutdownTimeout);
await WaitForStoppedAsync("server", () => Server.IsRunning, _shutdownTimeout);
_loggerService.Dispose();
ReleaseEnetRef();
}

Expand Down
6 changes: 6 additions & 0 deletions Template/Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<NoWarn>NU1605;CS0108;IDE0290</NoWarn>
</PropertyGroup>

<!-- gdUnit4 analyzer currently crashes on GitHub Actions with net10 builds. -->
<PropertyGroup Condition="'$(CI)' == 'true'">
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<RunAnalyzersDuringCompilation>false</RunAnalyzersDuringCompilation>
</PropertyGroup>

<ItemGroup>
<!-- Package References -->
<!-- Condition="!Exists('ENet-CSharp.dll')" is required for other platforms -->
Expand Down
Loading