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.
51 lines
1.5 KiB
51 lines
1.5 KiB
using CppSharp.AST; |
|
using CppSharp.Generators; |
|
using CppSharp.Passes; |
|
using CppSharp.Utils; |
|
|
|
namespace CppSharp.Tests |
|
{ |
|
|
|
public class NamespacesDerivedTests : GeneratorTest |
|
{ |
|
public NamespacesDerivedTests(GeneratorKind kind) |
|
: base("NamespacesDerived", kind) |
|
{ |
|
} |
|
|
|
public override void SetupPasses(Driver driver) |
|
{ |
|
driver.Options.GenerateDefaultValuesForArguments = true; |
|
driver.Options.GeneratePropertiesAdvanced = true; |
|
} |
|
|
|
public override void Preprocess(Driver driver, ASTContext ctx) |
|
{ |
|
foreach (TranslationUnit unit in ctx.TranslationUnits) |
|
{ |
|
if (unit.FileName != "NamespacesDerived.h") |
|
{ |
|
unit.GenerationKind = GenerationKind.Link; |
|
} |
|
} |
|
} |
|
|
|
public override void Postprocess(Driver driver, ASTContext ctx) |
|
{ |
|
new CaseRenamePass( |
|
RenameTargets.Function | RenameTargets.Method | RenameTargets.Property | RenameTargets.Delegate | RenameTargets.Variable, |
|
RenameCasePattern.UpperCamelCase).VisitLibrary(driver.ASTContext); |
|
} |
|
} |
|
|
|
public class NamespacesDerived { |
|
|
|
public static void Main(string[] args) |
|
{ |
|
ConsoleDriver.Run(new NamespacesBaseTests(GeneratorKind.CSharp)); |
|
ConsoleDriver.Run(new NamespacesDerivedTests(GeneratorKind.CSharp)); |
|
} |
|
|
|
} |
|
} |
|
|
|
|