From e1114ccda8db2bf1cabf2c5a540be84c3b8c3ef7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 4 Jul 2016 15:02:59 -0400 Subject: [PATCH] Fix up nunit tests + travis --- .gitignore | 1 + .travis.yml | 7 +++++-- TrueCraft.API/TrueCraft.API.csproj | 2 +- TrueCraft.API/packages.config | 2 +- TrueCraft.Client/TrueCraft.Client.csproj | 6 +++--- TrueCraft.Client/packages.config | 2 +- TrueCraft.Core.Test/TrueCraft.Core.Test.csproj | 13 +++++++------ TrueCraft.Core.Test/World/ChunkTest.cs | 5 ++++- TrueCraft.Core.Test/World/RegionTest.cs | 6 +++++- TrueCraft.Core.Test/World/WorldTest.cs | 5 ++++- TrueCraft.Core.Test/packages.config | 5 +++-- TrueCraft.Core/TrueCraft.Core.csproj | 2 +- TrueCraft.Core/packages.config | 2 +- TrueCraft.Launcher/TrueCraft.Launcher.csproj | 4 ++-- TrueCraft.Launcher/packages.config | 2 +- TrueCraft/TrueCraft.csproj | 2 +- TrueCraft/packages.config | 2 +- 17 files changed, 42 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 79e3756..ea21801 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ config.yaml packets.log world/manifest.nbt +TestResult.xml diff --git a/.travis.yml b/.travis.yml index 216e3f9..f84852c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,10 @@ before_install: - git submodule update --init --recursive install: - nuget restore TrueCraft.sln - - nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner + - nuget install NUnit.Runners -Version 3.2.1 -OutputDirectory testrunner script: - xbuild TrueCraft.sln - - mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./TrueCraft.Core.Test/bin/Debug/TrueCraft.Core.Test.dll + - | + mono \ + ./testrunner/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe \ + ./TrueCraft.Core.Test/TrueCraft.Core.Test.csproj diff --git a/TrueCraft.API/TrueCraft.API.csproj b/TrueCraft.API/TrueCraft.API.csproj index 1e1f137..926f818 100644 --- a/TrueCraft.API/TrueCraft.API.csproj +++ b/TrueCraft.API/TrueCraft.API.csproj @@ -40,7 +40,7 @@ - ..\packages\YamlDotNet.3.8.0\lib\net35\YamlDotNet.dll + ..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll False diff --git a/TrueCraft.API/packages.config b/TrueCraft.API/packages.config index 83349ab..f61df4d 100644 --- a/TrueCraft.API/packages.config +++ b/TrueCraft.API/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TrueCraft.Client/TrueCraft.Client.csproj b/TrueCraft.Client/TrueCraft.Client.csproj index 6510758..f24c6f0 100644 --- a/TrueCraft.Client/TrueCraft.Client.csproj +++ b/TrueCraft.Client/TrueCraft.Client.csproj @@ -75,13 +75,13 @@ - ..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\MonoGame.Framework.dll + ..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\MonoGame.Framework.dll - ..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\NVorbis.dll + ..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\NVorbis.dll - ..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\OpenTK.dll + ..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\OpenTK.dll diff --git a/TrueCraft.Client/packages.config b/TrueCraft.Client/packages.config index a6ffc98..a21946d 100644 --- a/TrueCraft.Client/packages.config +++ b/TrueCraft.Client/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/TrueCraft.Core.Test/TrueCraft.Core.Test.csproj b/TrueCraft.Core.Test/TrueCraft.Core.Test.csproj index 338b572..b516541 100644 --- a/TrueCraft.Core.Test/TrueCraft.Core.Test.csproj +++ b/TrueCraft.Core.Test/TrueCraft.Core.Test.csproj @@ -34,13 +34,14 @@ - - ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - False - - ..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll - False + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + + + ..\packages\Moq.4.5.10\lib\net45\Moq.dll diff --git a/TrueCraft.Core.Test/World/ChunkTest.cs b/TrueCraft.Core.Test/World/ChunkTest.cs index 1db2522..7c4b5a9 100644 --- a/TrueCraft.Core.Test/World/ChunkTest.cs +++ b/TrueCraft.Core.Test/World/ChunkTest.cs @@ -4,6 +4,8 @@ using TrueCraft.Core.World; using TrueCraft.API; using fNbt; using TrueCraft.Core.Logic.Blocks; +using System.IO; +using System.Reflection; namespace TrueCraft.Core.Test.World { @@ -15,7 +17,8 @@ namespace TrueCraft.Core.Test.World [TestFixtureSetUp] public void SetUp() { - var file = new NbtFile("Files/TestChunk.nbt"); + var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var file = new NbtFile(Path.Combine(assemblyDir, "Files", "TestChunk.nbt")); Chunk = Chunk.FromNbt(file); } diff --git a/TrueCraft.Core.Test/World/RegionTest.cs b/TrueCraft.Core.Test/World/RegionTest.cs index 5ff2d23..6e4a266 100644 --- a/TrueCraft.Core.Test/World/RegionTest.cs +++ b/TrueCraft.Core.Test/World/RegionTest.cs @@ -2,6 +2,8 @@ using NUnit.Framework; using TrueCraft.Core.World; using TrueCraft.API; +using System.IO; +using System.Reflection; namespace TrueCraft.Core.Test.World { @@ -14,7 +16,9 @@ namespace TrueCraft.Core.Test.World public void SetUp() { var world = new TrueCraft.Core.World.World(); - Region = new Region(Coordinates2D.Zero, world, "Files/r.0.0.mca"); + var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + Region = new Region(Coordinates2D.Zero, world, + Path.Combine(assemblyDir, "Files", "r.0.0.mca")); } [Test] diff --git a/TrueCraft.Core.Test/World/WorldTest.cs b/TrueCraft.Core.Test/World/WorldTest.cs index fde6984..7459116 100644 --- a/TrueCraft.Core.Test/World/WorldTest.cs +++ b/TrueCraft.Core.Test/World/WorldTest.cs @@ -4,6 +4,8 @@ using NUnit.Framework; using TrueCraft.API; using TrueCraft.Core.TerrainGen; using TrueCraft.API.World; +using System.IO; +using System.Reflection; namespace TrueCraft.Core.Test.World { @@ -15,7 +17,8 @@ namespace TrueCraft.Core.Test.World [TestFixtureSetUp] public void SetUp() { - World = TrueCraft.Core.World.World.LoadWorld("Files"); + var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + World = TrueCraft.Core.World.World.LoadWorld(Path.Combine(assemblyDir, "Files")); } [Test] diff --git a/TrueCraft.Core.Test/packages.config b/TrueCraft.Core.Test/packages.config index 1c35356..c7f51e9 100644 --- a/TrueCraft.Core.Test/packages.config +++ b/TrueCraft.Core.Test/packages.config @@ -1,5 +1,6 @@  - - + + + \ No newline at end of file diff --git a/TrueCraft.Core/TrueCraft.Core.csproj b/TrueCraft.Core/TrueCraft.Core.csproj index bd3b124..7624b1b 100644 --- a/TrueCraft.Core/TrueCraft.Core.csproj +++ b/TrueCraft.Core/TrueCraft.Core.csproj @@ -41,7 +41,7 @@ ..\lib\Ionic.Zip.Reduced.dll - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/TrueCraft.Core/packages.config b/TrueCraft.Core/packages.config index 583acbd..e1fae9c 100644 --- a/TrueCraft.Core/packages.config +++ b/TrueCraft.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TrueCraft.Launcher/TrueCraft.Launcher.csproj b/TrueCraft.Launcher/TrueCraft.Launcher.csproj index eab8820..72ec1dc 100644 --- a/TrueCraft.Launcher/TrueCraft.Launcher.csproj +++ b/TrueCraft.Launcher/TrueCraft.Launcher.csproj @@ -38,7 +38,7 @@ ..\lib\Ionic.Zip.Reduced.dll - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll @@ -94,7 +94,6 @@ PreserveNewest - Xwt.Gtk3.dll PreserveNewest @@ -111,6 +110,7 @@ Xwt.WPF.dll PreserveNewest + diff --git a/TrueCraft.Launcher/packages.config b/TrueCraft.Launcher/packages.config index 583acbd..e1fae9c 100644 --- a/TrueCraft.Launcher/packages.config +++ b/TrueCraft.Launcher/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TrueCraft/TrueCraft.csproj b/TrueCraft/TrueCraft.csproj index e7a5667..ec209eb 100644 --- a/TrueCraft/TrueCraft.csproj +++ b/TrueCraft/TrueCraft.csproj @@ -38,7 +38,7 @@ ..\lib\Ionic.Zip.Reduced.dll - ..\packages\YamlDotNet.3.8.0\lib\net35\YamlDotNet.dll + ..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll diff --git a/TrueCraft/packages.config b/TrueCraft/packages.config index 83349ab..f61df4d 100644 --- a/TrueCraft/packages.config +++ b/TrueCraft/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file