using System;
using System.Threading;
+using System.Reflection;
namespace MonoTests.Helpers {
thr.Join ();
}
}
+
+ public static class OOMHelpers {
+ public static void RunTest (string test)
+ {
+ Assembly asm = Assembly.Load (test);
+
+ try {
+ // Support both (void) and (string[]) signatures
+ if (asm.EntryPoint.GetParameters ().Length == 1)
+ asm.EntryPoint.Invoke (null, new string[] { null });
+ else
+ asm.EntryPoint.Invoke (null, null);
+ } catch (TargetInvocationException e) {
+ if (e.InnerException is OutOfMemoryException)
+ Console.WriteLine ("Catched oom");
+ else
+ throw;
+ }
+ }
+ }
}