Browse Source

Moved the Hello test to /tests.

pull/1/head
triton 12 years ago
parent
commit
b31762963c
  1. 11
      examples/Hello/Hello.h
  2. 7
      examples/Hello/premake4.lua
  3. 0
      tests/Hello/Hello.Tests.cs
  4. 0
      tests/Hello/Hello.cpp
  5. 108
      tests/Hello/Hello.cs
  6. 14
      tests/Hello/Hello.h
  7. 0
      tests/Hello/Interop.h
  8. 6
      tests/Hello/premake4.lua

11
examples/Hello/Hello.h

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
#include <iostream>
#include <fstream>
class Hello
{
public:
Hello ();
void PrintHello(const char* s);
bool test1(int i, float f);
};

7
examples/Hello/premake4.lua

@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
SetupTestGeneratorProject("Hello", "Hello.cs")
SetupTestNativeProject("Hello.Native", { "Hello.cpp", "Hello.h" })
SetupTestProject("Hello.Tests", { "Hello.Tests.cs"}, "Hello")

0
examples/Hello/Hello.Tests.cs → tests/Hello/Hello.Tests.cs

0
examples/Hello/Hello.cpp → tests/Hello/Hello.cpp

108
examples/Hello/Hello.cs → tests/Hello/Hello.cs

@ -1,54 +1,54 @@ @@ -1,54 +1,54 @@
using Cxxi.Generators;
using Cxxi.Passes;
namespace Cxxi.Tests
{
class Hello : ILibrary
{
private LanguageGeneratorKind kind;
public Hello(LanguageGeneratorKind kind)
{
this.kind = kind;
}
public void Setup(DriverOptions options)
{
options.LibraryName = "Hello";
options.GeneratorKind = kind;
options.OutputDir = kind == LanguageGeneratorKind.CPlusPlusCLI ?
"cli" : "cs";
options.Headers.Add("Hello.h");
options.IncludeDirs.Add("../../../examples/Hello");
}
public void Preprocess(Library lib)
{
}
public void Postprocess(Library lib)
{
}
public void SetupPasses(Driver driver, PassBuilder p)
{
}
public void GenerateStart(TextTemplate template)
{
}
public void GenerateAfterNamespaces(TextTemplate template)
{
}
static class Program
{
public static void Main(string[] args)
{
Driver.Run(new Hello(LanguageGeneratorKind.CPlusPlusCLI));
Driver.Run(new Hello(LanguageGeneratorKind.CSharp));
}
}
}
}
using Cxxi.Generators;
using Cxxi.Passes;
namespace Cxxi.Tests
{
class Hello : ILibrary
{
private readonly LanguageGeneratorKind kind;
public Hello(LanguageGeneratorKind kind)
{
this.kind = kind;
}
public void Setup(DriverOptions options)
{
options.LibraryName = "Hello";
options.GeneratorKind = kind;
options.OutputDir = kind == LanguageGeneratorKind.CPlusPlusCLI ?
"cli" : "cs";
options.Headers.Add("Hello.h");
options.IncludeDirs.Add("../../../examples/Hello");
}
public void Preprocess(Library lib)
{
}
public void Postprocess(Library lib)
{
}
public void SetupPasses(Driver driver, PassBuilder p)
{
}
public void GenerateStart(TextTemplate template)
{
}
public void GenerateAfterNamespaces(TextTemplate template)
{
}
static class Program
{
public static void Main(string[] args)
{
Driver.Run(new Hello(LanguageGeneratorKind.CPlusPlusCLI));
Driver.Run(new Hello(LanguageGeneratorKind.CSharp));
}
}
}
}

14
tests/Hello/Hello.h

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#if defined(_MSC_VER)
#define CXXI_API __declspec(dllexport)
#else
#define CXXI_API
#endif
class CXXI_API Hello
{
public:
Hello ();
void PrintHello(const char* s);
bool test1(int i, float f);
};

0
examples/Hello/Interop.h → tests/Hello/Interop.h

6
tests/Hello/premake4.lua

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
group "Hello"
SetupTestGeneratorProject("Hello", "Hello.cs")
SetupTestNativeProject("Hello.Native", { "Hello.cpp", "Hello.h" })
SetupTestProjects("Hello", { "Hello.Tests.cs"})
Loading…
Cancel
Save