+
+EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs finalizer-wait.cs critical-finalizers.cs
+
+
+#those are actually configurations, eg plain_sgen-descriptors.exe
+#DISABLE_SGEN_TESTS =
+
+SGEN_TESTS = \
+ finalizer-wait.exe \
+ critical-finalizers.exe \
+ sgen-descriptors.exe \
+ sgen-gshared-vtype.exe \
+ sgen-domain-unload.exe \
+ sgen-weakref-stress.exe \
+ sgen-cementing-stress.exe \
+ sgen-case-23400.exe
+
+SGEN_CONFIGURATIONS = \
+ "|plain" \
+ "major=marksweep-par|ms-par" \
+ "major=marksweep-conc|ms-conc" \
+ "major=marksweep-conc,minor=split|ms-conc-split" \
+ "minor=split|ms-split" \
+ "minor=split,alloc-ratio=95|ms-split-95"
+
+#FIXME We should move to use SGEN_CONFIGURATIONS once sgen supports trailling commas or its argument list.
+SGEN_BRIDGE_CONFIGURATIONS = \
+ "|plain" \
+ ",major=marksweep-conc|ms-conc" \
+ ",minor=split|ms-split"
+
+sgen-regular-tests: $(SGEN_TESTS)
+ @failed=0; \
+ passed=0; \
+ failed_tests="";\
+ for test in $+; do \
+ echo "...$$test"; \
+ for conf in $(SGEN_CONFIGURATIONS); do \
+ name=`echo $$conf | cut -d\| -f 2`; \
+ params=`echo $$conf | cut -d\| -f 1`; \
+ test_name="$${test}|$${name}"; \
+ if MONO_GC_PARAMS="$$params" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" 'dump-output' $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$test_name"; \
+ fi \
+ done \
+ done; \
+ echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
+ if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
+ for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
+
+sgen-bridge-tests: sgen-bridge.exe sgen-bridge-major-fragmentation.exe
+ @failed=0; \
+ passed=0; \
+ failed_tests="";\
+ for test in $+; do \
+ echo "...$$test"; \
+ for conf in $(SGEN_BRIDGE_CONFIGURATIONS); do \
+ name=`echo $$conf | cut -d\| -f 2`; \
+ params=`echo $$conf | cut -d\| -f 1`; \
+ test_name="$${test}|$${name}"; \
+ if MONO_GC_PARAMS="bridge=Bridge$${params}" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" 'dump-output' $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$test_name"; \
+ fi \
+ done \
+ done; \
+ echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
+ if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
+ for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
+
+sgen-tests: sgen-regular-tests sgen-bridge-tests
+
+