mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
839 B
31 lines
839 B
using System; |
|
using CppSharp.AST; |
|
using CppSharp.Utils; |
|
|
|
namespace CppSharp.Generator.Tests |
|
{ |
|
public class ASTTestFixture |
|
{ |
|
protected Driver Driver; |
|
protected DriverOptions Options; |
|
protected ASTContext AstContext; |
|
|
|
protected void ParseLibrary(params string[] files) |
|
{ |
|
Options = new DriverOptions(); |
|
|
|
var testsPath = GeneratorTest.GetTestsDirectory("Native"); |
|
Options.addIncludeDirs(testsPath); |
|
|
|
Options.Headers.AddRange(files); |
|
|
|
Driver = new Driver(Options, new TextDiagnosticPrinter()); |
|
Driver.SetupIncludes(); |
|
Driver.BuildParseOptions(); |
|
if (!Driver.ParseCode()) |
|
throw new Exception("Error parsing the code"); |
|
|
|
AstContext = Driver.ASTContext; |
|
} |
|
} |
|
}
|
|
|