Browse Source

Reworked Generator tests project.

pull/86/head
triton 12 years ago
parent
commit
b1f64ed06d
  1. 20
      src/Generator.Tests/HeaderTestFixture.cs
  2. 5
      src/Generator.Tests/Passes/TestPasses.cs
  3. 3
      src/Generator.Tests/QueryHelpers.cs
  4. 2
      src/Generator.Tests/TestCLITypePrinter.cs

20
src/Generator.Tests/HeaderTestFixture.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
using System;
using System.IO;
using CppSharp;
using CppSharp.AST;
using CppSharp.Utils;
namespace Generator.Tests
namespace CppSharp.Generator.Tests
{
public class HeaderTestFixture
{
@ -11,24 +11,12 @@ namespace Generator.Tests @@ -11,24 +11,12 @@ namespace Generator.Tests
protected DriverOptions Options;
protected ASTContext AstContext;
private const string TestsDirectory = @"..\..\..\tests\Native";
public HeaderTestFixture()
{
}
protected void ParseLibrary(string file)
{
ParseLibrary(TestsDirectory, file);
}
protected void ParseLibrary(string dir, string file)
{
Options = new DriverOptions();
var path = Path.Combine(Directory.GetCurrentDirectory(), dir);
Options.IncludeDirs.Add(Path.GetFullPath(path));
var testsPath = LibraryTest.GetTestsDirectory("Native");
Options.IncludeDirs.Add(testsPath);
Options.Headers.Add(file);
Driver = new Driver(Options, new TextDiagnosticPrinter());

5
src/Generator.Tests/Passes/TestPasses.cs

@ -1,8 +1,7 @@ @@ -1,8 +1,7 @@
using CppSharp;
using CppSharp.Passes;
using CppSharp.Passes;
using NUnit.Framework;
namespace Generator.Tests.Passes
namespace CppSharp.Generator.Tests.Passes
{
[TestFixture]
public class TestPasses : HeaderTestFixture

3
src/Generator.Tests/QueryHelpers.cs

@ -1,8 +1,7 @@ @@ -1,8 +1,7 @@
using System.Linq;
using CppSharp;
using CppSharp.AST;
namespace Generator.Tests
namespace CppSharp.Generator.Tests
{
public static class LibraryQueryExtensions
{

2
src/Generator.Tests/TestCLITypePrinter.cs

@ -3,7 +3,7 @@ using CppSharp.Generators.CLI; @@ -3,7 +3,7 @@ using CppSharp.Generators.CLI;
using CppSharp.Types;
using NUnit.Framework;
namespace Generator.Tests
namespace CppSharp.Generator.Tests
{
[TypeMap("FnPtr3")]
public class CLITypePrinterTypeMap : TypeMap

Loading…
Cancel
Save