diff --git a/Barotrauma/BarotraumaTest/ClientServer/ClientServerTests.cs b/Barotrauma/BarotraumaTest/ClientServer/ClientServerTests.cs index 7f70ecd39..57cafa4ea 100644 --- a/Barotrauma/BarotraumaTest/ClientServer/ClientServerTests.cs +++ b/Barotrauma/BarotraumaTest/ClientServer/ClientServerTests.cs @@ -1,6 +1,7 @@ extern alias Client; extern alias Server; using System; +using System.IO; using System.Linq; using System.Net; using System.Threading; @@ -22,7 +23,7 @@ public class ClientServerTests : IDisposable { private readonly ITestOutputHelper testOutputHelper; - private readonly GameMain serverGame; + private readonly GameMain? serverGame; private GameServer? currentServer; private readonly string generatedPassword; @@ -32,6 +33,10 @@ public class ClientServerTests : IDisposable { this.testOutputHelper = testOutputHelper; + if (!File.Exists(ContentPackageManager.VanillaFileList)) + { + return; + } serverGame = new GameMain(Array.Empty()); serverGame.Init(); var random = new Random(); @@ -41,6 +46,12 @@ public class ClientServerTests : IDisposable [Fact] public void TestLidgren() { + if (serverGame == null) + { + testOutputHelper.WriteLine("VanillaFileList not found, skipping test"); + return; + } + var server = CreateServer(); var client = CreateClient(server); Prop.ForAll(data => @@ -120,7 +131,7 @@ public class ClientServerTests : IDisposable } private void OnTestsFinished() - => serverGame.CloseServer(); + => serverGame?.CloseServer(); public void Dispose() {