[tests] Don't run SRE saved assembly in current process
authorAleksey Kliger <aleksey@xamarin.com>
Mon, 19 Jun 2017 15:02:10 +0000 (11:02 -0400)
committerAleksey Kliger <aleksey@xamarin.com>
Mon, 19 Jun 2017 16:35:38 +0000 (12:35 -0400)
Windows doesn't like deleting the file, and the original bug was a problem in
SRE, not in the AssemblyBuilder.Save ()

mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs

index b8162e08a2124146d4bfab99e0ab457fd1bc42f5..5386ae2460c82e2ca2bca8bd4ab7596edc7891e9 100644 (file)
@@ -9739,10 +9739,11 @@ namespace MonoTests.System.Reflection.Emit
 
                                assembly.SetEntryPoint (main);
                 G.CreateType ();
-                P.CreateType ();
+                var PCreated = P.CreateType ();
 
                 assembly.Save ("Instance.exe");
-                               Thread.GetDomain ().ExecuteAssembly(Path.Combine (tempDir, "Instance.exe"));
+
+               PCreated.InvokeMember ("Main", BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, null);
                }
 
                [Test]