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;
+ }
+ }
+ }
}
sgen-bridge3-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE3_TESTS) test-runner.exe
$(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,minor=split,bridge-implementation=tarjan" --timeout 900 $(SGEN_BRIDGE3_TESTS)
+SGEN_OOM_TESTS_SRC = \
+ sgen-oom-cementing-stress.cs \
+ sgen-oom-new-threads-dont-join-stw-2.cs \
+ sgen-oom-bridge-major-fragmentation.cs
+
+SGEN_OOM_TESTS=$(SGEN_OOM_TESTS_SRC:.cs=.exe)
+
+sgen-oom-tests: $(SGEN_OOM_TESTS) test-runner.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw-2.exe sgen-bridge-major-fragmentation.exe
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=max-valloc-size=50M,bridge=Bridge" --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_OOM_TESTS)
+
AOT_CONFIGURATIONS= \
"|regular" \
--- /dev/null
+using MonoTests.Helpers;
+
+public class Program {
+ public static void Main (string[] args)
+ {
+ OOMHelpers.RunTest ("sgen-bridge-major-fragmentation");
+ }
+}
--- /dev/null
+using MonoTests.Helpers;
+
+public class Program {
+ public static void Main (string[] args)
+ {
+ OOMHelpers.RunTest ("sgen-cementing-stress");
+ }
+}
--- /dev/null
+using MonoTests.Helpers;
+
+public class Program {
+ public static void Main (string[] args)
+ {
+ OOMHelpers.RunTest ("sgen-new-threads-dont-join-stw-2");
+ }
+}