From ba2310830a63be5fb1966265589a2acf4d7a180f Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sun, 31 Jan 2021 01:52:22 +0200 Subject: [PATCH] Remove needless generation of using-s in tests Fixes https://github.com/mono/CppSharp/issues/1490. Signed-off-by: Dimitar Dobrev --- .../NamespacesDerived/NamespacesDerived.Gen.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tests/NamespacesDerived/NamespacesDerived.Gen.cs b/tests/NamespacesDerived/NamespacesDerived.Gen.cs index 427a0f7d..3cf6eaaa 100644 --- a/tests/NamespacesDerived/NamespacesDerived.Gen.cs +++ b/tests/NamespacesDerived/NamespacesDerived.Gen.cs @@ -1,5 +1,4 @@ using System.IO; -using CppSharp.AST; using CppSharp.Generators; using CppSharp.Utils; @@ -18,9 +17,8 @@ namespace CppSharp.Tests driver.Options.GenerateDefaultValuesForArguments = true; driver.Options.GenerateClassTemplates = true; driver.Options.CompileCode = true; - driver.Options.DependentNameSpaces.Add("System.Runtime.CompilerServices"); driver.Options.Modules[1].IncludeDirs.Add(GetTestsDirectory("NamespacesDerived")); - var @base = "NamespacesBase"; + const string @base = "NamespacesBase"; var module = driver.Options.AddModule(@base); module.IncludeDirs.Add(Path.GetFullPath(GetTestsDirectory(@base))); module.Headers.Add($"{@base}.h"); @@ -29,21 +27,11 @@ namespace CppSharp.Tests module.Libraries.Add($"{@base}.Native"); driver.Options.Modules[1].Dependencies.Add(module); } - - public override void Postprocess(Driver driver, ASTContext ctx) - { - driver.Generator.OnUnitGenerated += o => - { - Block firstBlock = o.Outputs[0].RootBlock.Blocks[1]; - firstBlock.NewLine(); - firstBlock.WriteLine("[assembly:InternalsVisibleTo(\"NamespacesDerived.CSharp\")]"); - }; - } } - public class NamespacesDerived + public static class NamespacesDerived { - public static void Main(string[] args) + public static void Main() { ConsoleDriver.Run(new NamespacesDerivedTests(GeneratorKind.CSharp)); }