Tools and libraries to glue C/C++ APIs to high-level languages
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

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;
}
}
}