Fix up nunit tests + travis

This commit is contained in:
Drew DeVault 2016-07-04 15:02:59 -04:00
parent 9ca7bcabca
commit e1114ccda8
17 changed files with 42 additions and 26 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ config.yaml
packets.log
world/manifest.nbt
TestResult.xml

View File

@ -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

View File

@ -40,7 +40,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="YamlDotNet">
<HintPath>..\packages\YamlDotNet.3.8.0\lib\net35\YamlDotNet.dll</HintPath>
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="YamlDotNet" version="3.8.0" targetFramework="net45" />
<package id="YamlDotNet" version="3.9.0" targetFramework="net45" />
</packages>

View File

@ -75,13 +75,13 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="MonoGame.Framework">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\MonoGame.Framework.dll</HintPath>
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="NVorbis">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\NVorbis.dll</HintPath>
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\NVorbis.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.0.1678\lib\net40\OpenTK.dll</HintPath>
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\OpenTK.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MonoGame.Framework.DesktopGL" version="3.5.0.1678" targetFramework="net45" />
<package id="MonoGame.Framework.DesktopGL" version="3.5.1.1679" targetFramework="net45" />
<package id="NVorbis" version="0.8.4.0" targetFramework="net45" />
</packages>

View File

@ -34,13 +34,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll</HintPath>
<Private>False</Private>
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.5.10\lib\net45\Moq.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

View File

@ -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);
}

View File

@ -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]

View File

@ -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]

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
<package id="NUnit" version="3.2.1" targetFramework="net45" />
<package id="Castle.Core" version="3.3.3" targetFramework="net45" />
<package id="Moq" version="4.5.10" targetFramework="net45" />
<package id="NUnit" version="3.4.1" targetFramework="net45" />
</packages>

View File

@ -41,7 +41,7 @@
<HintPath>..\lib\Ionic.Zip.Reduced.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
</packages>

View File

@ -38,7 +38,7 @@
<HintPath>..\lib\Ionic.Zip.Reduced.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -94,7 +94,6 @@
<None Include="truecraft">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="..\lib\Xwt.Gtk3.dll">
<Link>Xwt.Gtk3.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -111,6 +110,7 @@
<Link>Xwt.WPF.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Content\truecraft-logo.png" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
</packages>

View File

@ -38,7 +38,7 @@
<HintPath>..\lib\Ionic.Zip.Reduced.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet">
<HintPath>..\packages\YamlDotNet.3.8.0\lib\net35\YamlDotNet.dll</HintPath>
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="YamlDotNet" version="3.8.0" targetFramework="net45" />
<package id="YamlDotNet" version="3.9.0" targetFramework="net45" />
</packages>