Browse Source

Renamed the test suite projects.

pull/547/head
triton 10 years ago
parent
commit
5ef899366c
  1. 2
      tests/Basic/premake4.lua
  2. 2
      tests/CLI/CLI.Tests.cs
  3. 2
      tests/CLI/CLI.cpp
  4. 8
      tests/CLI/CLI.cs
  5. 0
      tests/CLI/CLI.h
  6. 2
      tests/CLI/premake4.lua
  7. 2
      tests/CLITemp/premake4.lua
  8. 0
      tests/CSharp/AnotherUnit.cpp
  9. 0
      tests/CSharp/AnotherUnit.h
  10. 12
      tests/CSharp/CSharp.Tests.cs
  11. 2
      tests/CSharp/CSharp.cpp
  12. 8
      tests/CSharp/CSharp.cs
  13. 0
      tests/CSharp/CSharp.h
  14. 2
      tests/CSharp/premake4.lua
  15. 2
      tests/CSharpTemp/premake4.lua
  16. 0
      tests/Common/AnotherUnit.cpp
  17. 0
      tests/Common/AnotherUnit.h
  18. 20
      tests/Common/Common.Tests.cs
  19. 4
      tests/Common/Common.cpp
  20. 10
      tests/Common/Common.cs
  21. 4
      tests/Common/Common.h
  22. 2
      tests/Common/premake4.lua
  23. 4
      tests/Encodings/Encodings.Tests.cs
  24. 2
      tests/Encodings/Encodings.cpp
  25. 8
      tests/Encodings/Encodings.cs
  26. 0
      tests/Encodings/Encodings.h
  27. 2
      tests/Encodings/premake4.lua
  28. 2
      tests/STL/premake4.lua
  29. 6
      tests/StandardLib/StandardLib.Tests.cs
  30. 2
      tests/StandardLib/StandardLib.cpp
  31. 8
      tests/StandardLib/StandardLib.cs
  32. 0
      tests/StandardLib/StandardLib.h
  33. 2
      tests/StandardLib/premake4.lua
  34. 2
      tests/UTF16/premake4.lua

2
tests/Basic/premake4.lua

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
group "Tests/Basic"
SetupTestProject("Basic", { "AnotherUnit" })

2
tests/CLITemp/CLITemp.Tests.cs → tests/CLI/CLI.Tests.cs

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
using CppSharp.Utils;
using NUnit.Framework;
using CLITemp;
using CLI;
public class CLITests : GeneratorTestFixture
{

2
tests/CLITemp/CLITemp.cpp → tests/CLI/CLI.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "CLITemp.h"
#include "CLI.h"
int Types::AttributedSum(int A, int B)
{

8
tests/CLITemp/CLITemp.cs → tests/CLI/CLI.cs

@ -4,10 +4,10 @@ using CppSharp.Utils; @@ -4,10 +4,10 @@ using CppSharp.Utils;
namespace CppSharp.Tests
{
public class CLITemp : GeneratorTest
public class CLITestsGenerator : GeneratorTest
{
public CLITemp(GeneratorKind kind)
: base("CLITemp", kind)
public CLITestsGenerator(GeneratorKind kind)
: base("CLI", kind)
{
}
@ -24,7 +24,7 @@ namespace CppSharp.Tests @@ -24,7 +24,7 @@ namespace CppSharp.Tests
public static void Main(string[] args)
{
ConsoleDriver.Run(new CLITemp(GeneratorKind.CLI));
ConsoleDriver.Run(new CLITestsGenerator(GeneratorKind.CLI));
}
}
}

0
tests/CLITemp/CLITemp.h → tests/CLI/CLI.h

2
tests/CLI/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/CLI"
SetupTestCLI("CLI")

2
tests/CLITemp/premake4.lua

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
group "Tests/CLITemp"
SetupTestCLI("CLITemp")

0
tests/CSharpTemp/AnotherUnit.cpp → tests/CSharp/AnotherUnit.cpp

0
tests/CSharpTemp/AnotherUnit.h → tests/CSharp/AnotherUnit.h

12
tests/CSharpTemp/CSharpTemp.Tests.cs → tests/CSharp/CSharp.Tests.cs

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
using System;
using System.Reflection;
using CppSharp.Utils;
using CSharpTemp;
using CSharp;
using NUnit.Framework;
public class CSharpTempTests : GeneratorTestFixture
public class CSharpTests : GeneratorTestFixture
{
public class ExtendsWrapper : TestOverrideFromSecondaryBase
{
@ -127,13 +127,13 @@ public class CSharpTempTests : GeneratorTestFixture @@ -127,13 +127,13 @@ public class CSharpTempTests : GeneratorTestFixture
[Test]
public void TestDestructors()
{
CSharpTemp.TestDestructors.InitMarker();
Assert.AreEqual(0, CSharpTemp.TestDestructors.Marker);
CSharp.TestDestructors.InitMarker();
Assert.AreEqual(0, CSharp.TestDestructors.Marker);
var dtors = new TestDestructors();
Assert.AreEqual(0xf00d, CSharpTemp.TestDestructors.Marker);
Assert.AreEqual(0xf00d, CSharp.TestDestructors.Marker);
dtors.Dispose();
Assert.AreEqual(0xcafe, CSharpTemp.TestDestructors.Marker);
Assert.AreEqual(0xcafe, CSharp.TestDestructors.Marker);
}
[Test]

2
tests/CSharpTemp/CSharpTemp.cpp → tests/CSharp/CSharp.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "CSharpTemp.h"
#include "CSharp.h"
Foo::Foo()
{

8
tests/CSharpTemp/CSharpTemp.cs → tests/CSharp/CSharp.cs

@ -117,10 +117,10 @@ namespace CppSharp.Tests @@ -117,10 +117,10 @@ namespace CppSharp.Tests
}
}
public class CSharpTempTests : GeneratorTest
public class CSharpTestsGenerator : GeneratorTest
{
public CSharpTempTests(GeneratorKind kind)
: base("CSharpTemp", kind)
public CSharpTestsGenerator(GeneratorKind kind)
: base("CSharp", kind)
{
}
@ -160,7 +160,7 @@ namespace CppSharp.Tests @@ -160,7 +160,7 @@ namespace CppSharp.Tests
public static void Main(string[] args)
{
ConsoleDriver.Run(new CSharpTempTests(GeneratorKind.CSharp));
ConsoleDriver.Run(new CSharpTestsGenerator(GeneratorKind.CSharp));
}
}
}

0
tests/CSharpTemp/CSharpTemp.h → tests/CSharp/CSharp.h

2
tests/CSharp/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/CSharp"
SetupTestCSharp("CSharp")

2
tests/CSharpTemp/premake4.lua

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
group "Tests/CSharpTemp"
SetupTestCSharp("CSharpTemp")

0
tests/Basic/AnotherUnit.cpp → tests/Common/AnotherUnit.cpp

0
tests/Basic/AnotherUnit.h → tests/Common/AnotherUnit.h

20
tests/Basic/Basic.Tests.cs → tests/Common/Common.Tests.cs

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
using System;
using BasicTest;
using CppSharp.Utils;
using NUnit.Framework;
using BasicTest;
using Enum = BasicTest.Enum;
[TestFixture]
public class BasicTests : GeneratorTestFixture
public class CommonTests : GeneratorTestFixture
{
[Test]
public void TestUncompilableCode()
@ -235,7 +235,7 @@ public class BasicTests : GeneratorTestFixture @@ -235,7 +235,7 @@ public class BasicTests : GeneratorTestFixture
[Test]
public void TestMoveFunctionToClass()
{
Assert.That(basic.test(new basic()), Is.EqualTo(5));
Assert.That(common.test(new common()), Is.EqualTo(5));
}
[Test]
@ -358,7 +358,7 @@ public class BasicTests : GeneratorTestFixture @@ -358,7 +358,7 @@ public class BasicTests : GeneratorTestFixture
[Test]
public void TestFunctions()
{
var ret = BasicTest.basic.Function();
var ret = BasicTest.common.Function();
Assert.That(ret, Is.EqualTo(5));
}
@ -424,14 +424,14 @@ public class BasicTests : GeneratorTestFixture @@ -424,14 +424,14 @@ public class BasicTests : GeneratorTestFixture
[Test]
public unsafe void TestDecltype()
{
var ret = basic.TestDecltype();
var ret = common.TestDecltype();
Assert.AreEqual(0, ret);
}
[Test]
public unsafe void TestNullPtrType()
{
var ret = basic.TestNullPtrTypeRet();
var ret = common.TestNullPtrTypeRet();
Assert.AreEqual(IntPtr.Zero, new IntPtr(ret));
}
@ -527,12 +527,12 @@ public class BasicTests : GeneratorTestFixture @@ -527,12 +527,12 @@ public class BasicTests : GeneratorTestFixture
public void TestOutTypeClassesPassTry()
{
RefTypeClassPassTry refTypeClassPassTry;
basic.funcTryRefTypeOut(out refTypeClassPassTry);
basic.funcTryRefTypePtrOut(out refTypeClassPassTry);
common.funcTryRefTypeOut(out refTypeClassPassTry);
common.funcTryRefTypePtrOut(out refTypeClassPassTry);
ValueTypeClassPassTry valueTypeClassPassTry;
basic.funcTryValTypeOut(out valueTypeClassPassTry);
basic.funcTryValTypePtrOut(out valueTypeClassPassTry);
common.funcTryValTypeOut(out valueTypeClassPassTry);
common.funcTryValTypePtrOut(out valueTypeClassPassTry);
}
}

4
tests/Basic/Basic.cpp → tests/Common/Common.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "Basic.h"
#include "Common.h"
#include <string.h>
Foo::Foo()
@ -335,7 +335,7 @@ void DefaultParameters::Bar() @@ -335,7 +335,7 @@ void DefaultParameters::Bar()
{
}
int test(basic& s)
int test(common& s)
{
return 5;
}

10
tests/Basic/Basic.cs → tests/Common/Common.cs

@ -6,10 +6,10 @@ using CppSharp.Utils; @@ -6,10 +6,10 @@ using CppSharp.Utils;
namespace CppSharp.Tests
{
public class Basic : GeneratorTest
public class CommonTestsGenerator : GeneratorTest
{
public Basic(GeneratorKind kind)
: base("Basic", kind)
public CommonTestsGenerator(GeneratorKind kind)
: base("Common", kind)
{
}
@ -43,8 +43,8 @@ namespace CppSharp.Tests @@ -43,8 +43,8 @@ namespace CppSharp.Tests
public static void Main(string[] args)
{
ConsoleDriver.Run(new Basic(GeneratorKind.CLI));
ConsoleDriver.Run(new Basic(GeneratorKind.CSharp));
ConsoleDriver.Run(new CommonTestsGenerator(GeneratorKind.CLI));
ConsoleDriver.Run(new CommonTestsGenerator(GeneratorKind.CSharp));
}
}
}

4
tests/Basic/Basic.h → tests/Common/Common.h

@ -257,12 +257,12 @@ class Derived : public Base<Derived> @@ -257,12 +257,12 @@ class Derived : public Base<Derived>
};
// Tests the MoveFunctionToClassPass
class DLL_API basic
class DLL_API common
{
};
DLL_API int test(basic& s);
DLL_API int test(common& s);
// Tests the MoveOperatorToClassPass
struct DLL_API TestMoveOperatorToClass

2
tests/Common/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/Common"
SetupTestProject("Common", { "AnotherUnit" })

4
tests/UTF16/UTF16.Tests.cs → tests/Encodings/Encodings.Tests.cs

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
using CppSharp.Utils;
using NUnit.Framework;
using Foo = UTF16.Foo;
using Foo = Encodings.Foo;
public class UTF16Tests : GeneratorTestFixture
public class EncodingsTests : GeneratorTestFixture
{
[Test]
public void TestFoo()

2
tests/UTF16/UTF16.cpp → tests/Encodings/Encodings.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "UTF16.h"
#include "Encodings.h"
// TODO: move this, it has nothing to do with Unicode, it's here only not to break the CLI branch
int Foo::operator[](int i) const

8
tests/UTF16/UTF16.cs → tests/Encodings/Encodings.cs

@ -5,10 +5,10 @@ using CppSharp.Utils; @@ -5,10 +5,10 @@ using CppSharp.Utils;
namespace CppSharp.Tests
{
public class UTF16Tests : GeneratorTest
public class EncodingsTestsGenerator : GeneratorTest
{
public UTF16Tests(GeneratorKind kind)
: base("UTF16", kind)
public EncodingsTestsGenerator(GeneratorKind kind)
: base("Encodings", kind)
{
}
@ -24,7 +24,7 @@ namespace CppSharp.Tests @@ -24,7 +24,7 @@ namespace CppSharp.Tests
public static void Main(string[] args)
{
ConsoleDriver.Run(new UTF16Tests(GeneratorKind.CSharp));
ConsoleDriver.Run(new EncodingsTestsGenerator(GeneratorKind.CSharp));
}
}
}

0
tests/UTF16/UTF16.h → tests/Encodings/Encodings.h

2
tests/Encodings/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/Encodings"
SetupTestCSharp("Encodings")

2
tests/STL/premake4.lua

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
group "Tests/STL"
SetupTestCLI("STL")

6
tests/STL/STL.Tests.cs → tests/StandardLib/StandardLib.Tests.cs

@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
using CppSharp.Utils;
using NUnit.Framework;
using STL;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using StandardLib;
public class STLTests : GeneratorTestFixture
public class StandardLibTests : GeneratorTestFixture
{
[Test]
public void TestVectors()
{
var vectors = new STL.TestVectors();
var vectors = new StandardLib.TestVectors();
var sum = vectors.SumIntVector(new List<int> { 1, 2, 3 });
Assert.AreEqual(sum, 6);

2
tests/STL/STL.cpp → tests/StandardLib/StandardLib.cpp

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "STL.h"
#include "StandardLib.h"
TestVectors::TestVectors()
{

8
tests/STL/STL.cs → tests/StandardLib/StandardLib.cs

@ -4,10 +4,10 @@ using CppSharp.Utils; @@ -4,10 +4,10 @@ using CppSharp.Utils;
namespace CppSharp.Tests
{
public class STL : GeneratorTest
public class StandardLibTestsGenerator : GeneratorTest
{
public STL(GeneratorKind kind)
: base("STL", kind)
public StandardLibTestsGenerator(GeneratorKind kind)
: base("StandardLib", kind)
{
}
@ -18,7 +18,7 @@ namespace CppSharp.Tests @@ -18,7 +18,7 @@ namespace CppSharp.Tests
public static void Main(string[] args)
{
ConsoleDriver.Run(new STL(GeneratorKind.CLI));
ConsoleDriver.Run(new StandardLibTestsGenerator(GeneratorKind.CLI));
}
}
}

0
tests/STL/STL.h → tests/StandardLib/StandardLib.h

2
tests/StandardLib/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/StandardLib"
SetupTestCLI("StandardLib")

2
tests/UTF16/premake4.lua

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
group "Tests/UTF16"
SetupTestCSharp("UTF16")
Loading…
Cancel
Save