Browse Source

Updated NUnit to the latest version (3.6) to fix a test failing at AppVeyor.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/767/head
Dimitar Dobrev 9 years ago
parent
commit
e7f9b2975c
  1. 6
      build/InstallNugets.sh
  2. BIN
      deps/NUnit/nunit.framework.dll
  3. 20352
      deps/NUnit/nunit.framework.xml
  4. 3
      src/Generator.Tests/GeneratorTest.cs
  5. 3
      tests/CSharp/CSharp.Tests.cs
  6. 38
      tests/Common/Common.Tests.cs

6
build/InstallNugets.sh

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
wget https://nuget.org/nuget.exe
BUILD_DIR=$(dirname -- $0)
mono nuget.exe install NUnit -Version 2.6.4 -OutputDirectory $BUILD_DIR/../deps
mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory $BUILD_DIR/../deps
cp $BUILD_DIR/../deps/NUnit.2.6.4/lib/nunit.framework.* $BUILD_DIR/../deps/NUnit
mono nuget.exe install NUnit -Version 3.6.0 -OutputDirectory $BUILD_DIR/../deps
mono nuget.exe install NUnit.Runners -Version 3.6.0 -OutputDirectory $BUILD_DIR/../deps
cp $BUILD_DIR/../deps/NUnit.3.6.0/lib/nunit.framework.* $BUILD_DIR/../deps/NUnit

BIN
deps/NUnit/nunit.framework.dll vendored

Binary file not shown.

20352
deps/NUnit/nunit.framework.xml vendored

File diff suppressed because it is too large Load Diff

3
src/Generator.Tests/GeneratorTest.cs

@ -68,7 +68,8 @@ namespace CppSharp.Utils @@ -68,7 +68,8 @@ namespace CppSharp.Utils
#region Helpers
public static string GetTestsDirectory(string name)
{
var directory = Directory.GetParent(Directory.GetCurrentDirectory());
var directory = new DirectoryInfo(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
while (directory != null)
{

3
tests/CSharp/CSharp.Tests.cs

@ -550,8 +550,7 @@ public unsafe class CSharpTests : GeneratorTestFixture @@ -550,8 +550,7 @@ public unsafe class CSharpTests : GeneratorTestFixture
//Assert.That(CSharp.HasFreeConstant.AnotherUnit.STD_STRING_CONSTANT, Is.EqualTo("test"));
}
// HACK: the completion of types is temporarily suspended because of problems with QtWidgets
[Test, Ignore]
[Test, Ignore("The completion of types is temporarily suspended because of problems with QtWidgets.")]
public void TestTemplateInternals()
{
foreach (var internalType in new[]

38
tests/Common/Common.Tests.cs

@ -283,13 +283,20 @@ public class CommonTests : GeneratorTestFixture @@ -283,13 +283,20 @@ public class CommonTests : GeneratorTestFixture
public void TestConversionOperator()
{
var bar = new Bar2 { A = 1, B = 2, C = 3 };
Foo2 foo = bar;
Assert.AreEqual(foo.A, 1);
Assert.AreEqual(foo.B, 2);
Assert.AreEqual(foo.C, 3);
using (Foo2 foo = bar)
{
Assert.That(1, Is.EqualTo(foo.A));
Assert.That(2, Is.EqualTo(foo.B));
Assert.That(3, Is.EqualTo(foo.C));
}
using (var bar2Nested = new Bar2.Nested())
{
int bar2NestedInt = bar2Nested;
Assert.That(bar2NestedInt, Is.EqualTo(300));
}
Assert.AreEqual(300, new Bar2.Nested());
Assert.AreEqual(500, new Bar2());
int bar2Int = new Bar2();
Assert.That(bar2Int, Is.EqualTo(500));
}
[Test]
@ -387,10 +394,18 @@ public class CommonTests : GeneratorTestFixture @@ -387,10 +394,18 @@ public class CommonTests : GeneratorTestFixture
[Test]
public void TestOperators()
{
var @class = new ClassWithOverloadedOperators();
Assert.AreEqual(1, (char) @class);
Assert.AreEqual(2, @class);
Assert.AreEqual(3, (short) @class);
using (var @class = new ClassWithOverloadedOperators())
{
char @char = @class;
Assert.That(@char, Is.EqualTo(1));
short @short = @class;
Assert.That(@short, Is.EqualTo(3));
}
using (var @class = new ClassWithOverloadedOperators())
{
int classInt = @class;
Assert.That(classInt, Is.EqualTo(2));
}
}
[Test]
@ -493,8 +508,7 @@ public class CommonTests : GeneratorTestFixture @@ -493,8 +508,7 @@ public class CommonTests : GeneratorTestFixture
new TestDelegates().MarshalUnattributedDelegate(i => i);
}
// TODO: this test crashes our Windows build, possibly a problem with the NUnit runner there
[Test, Platform(Exclude = "Win")]
[Test, Platform(Exclude = "Win", Reason = "This test crashes our Windows build, possibly a problem with the NUnit runner there.")]
public void TestPassAnonymousDelegate()
{
var testDelegates = new TestDelegates();

Loading…
Cancel
Save