Browse Source

Fixed the tests by adding another option for the advanced property pass.

Long-term, I'd like to see both passes merged...
pull/226/merge
triton 11 years ago
parent
commit
df188d92f8
  1. 7
      src/Generator/Driver.cs
  2. 15
      src/Generator/Options.cs
  3. 2
      tests/CSharpTemp/CSharpTemp.cs

7
src/Generator/Driver.cs

@ -298,10 +298,13 @@ namespace CppSharp @@ -298,10 +298,13 @@ namespace CppSharp
}
if (Options.GenerateVirtualTables)
TranslationUnitPasses.AddPass(new CheckVTableComponentsPass());
TranslationUnitPasses.AddPass(new CheckVTableComponentsPass());
if (Options.GenerateProperties)
TranslationUnitPasses.AddPass(new GetterSetterToPropertyPass());
if (Options.GeneratePropertiesAdvanced)
TranslationUnitPasses.AddPass(new GetterSetterToPropertyAdvancedPass());
}
public void ProcessCode()

15
src/Generator/Options.cs

@ -92,12 +92,25 @@ namespace CppSharp @@ -92,12 +92,25 @@ namespace CppSharp
public bool GenerateVirtualTables;
public bool GenerateAbstractImpls;
public bool GenerateInterfacesForMultipleInheritance;
public bool GenerateProperties;
public bool GenerateInternalImports;
public bool GenerateClassMarshals;
public bool GenerateInlines;
public bool GenerateCopyConstructors;
public bool UseHeaderDirectories;
/// <summary>
/// If set to true the generator will use GetterSetterToPropertyPass to
/// convert matching getter/setter pairs to properties.
/// </summary>
public bool GenerateProperties;
/// <summary>
/// If set to true the generator will use GetterSetterToPropertyAdvancedPass to
/// convert matching getter/setter pairs to properties. This pass has slightly
/// different semantics from GetterSetterToPropertyPass, it will more agressively
/// try to match for matching properties.
/// </summary>
public bool GeneratePropertiesAdvanced;
//List of include directories that are used but not generated
public List<string> NoGenIncludeDirs;

2
tests/CSharpTemp/CSharpTemp.cs

@ -60,7 +60,7 @@ namespace CppSharp.Tests @@ -60,7 +60,7 @@ namespace CppSharp.Tests
public override void SetupPasses(Driver driver)
{
driver.Options.GenerateInterfacesForMultipleInheritance = true;
driver.Options.GenerateProperties = true;
driver.Options.GeneratePropertiesAdvanced = true;
driver.Options.GenerateVirtualTables = true;
driver.Options.GenerateCopyConstructors = true;
driver.TranslationUnitPasses.AddPass(new TestAttributesPass());

Loading…
Cancel
Save