Merge pull request #505 from roji/shutdown_flow
[mono.git] / mono / tests / Makefile.am
index 4854e35f83b4bb74ab983c5c9e3d33d5bb9f813c..455a4b159409ec7d342845a5cc1b01e7fb533627 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = cas assemblyresolve
+SUBDIRS = cas assemblyresolve gc-descriptors
 
 check-local: test
 
@@ -44,6 +44,7 @@ STRESS_TESTS_SRC=     \
 # Disabled until ?mcs is fixed
 #      bug-331958.cs
 BASE_TEST_CS_SRC=              \
+       bug-2907.cs             \
        array-init.cs           \
        arraylist.cs            \
        assemblyresolve_event.cs        \
@@ -359,8 +360,6 @@ BASE_TEST_CS_SRC=           \
        gchandles.cs    \
        interlocked-3.cs        \
        interlocked-4.2.cs      \
-       finalizer-wait.cs       \
-       critical-finalizers.cs  \
        appdomain-thread-abort.cs \
        xdomain-threads.cs      \
        w32message.cs   \
@@ -386,7 +385,10 @@ BASE_TEST_CS_SRC=          \
        bug-3903.cs     \
        async-with-cb-throws.cs \
        appdomain-unload-doesnot-raise-pending-events.cs        \
-       bug-6148.cs
+       bug-6148.cs     \
+       assembly_append_ordering.cs     \
+       bug-10127.cs    \
+       allow-synchronous-major.cs
 
 TEST_CS_SRC_DIST=      \
        $(BASE_TEST_CS_SRC)     \
@@ -444,21 +446,14 @@ PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
 endif
 
-# The two finalizer tests only work under sgen
-# gc-altstack.exe fails under boehm because it has no support for altstack
 # bug-459094.exe creates an extremely deep directory tree
 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
 # reverted.
-# generic_type_definition.2.exe depends on COMPILER_ACCESS which is no longer supported.
 DISABLED_TESTS=                        \
        delegate-async-exception.exe    \
        bug-348522.2.exe        \
-       finalizer-wait.exe      \
-       critical-finalizers.exe \
-       gc-altstack.exe \
        bug-459094.exe \
        delegate-invoke.exe \
-       generic_type_definition.2.exe \
        $(PLATFORM_DISABLED_TESTS)
 
 DISABLED_TESTS_WRENCH= \
@@ -547,7 +542,10 @@ TEST_IL_SRC=                       \
        bug-515884.il   \
        bug-633291.il   \
        delegate-with-null-target.il    \
-       bug-318677.il
+       bug-318677.il   \
+       gsharing-valuetype-layout.il    \
+       invalid_generic_instantiation.il
+
 
 # pre-requisite test sources: files that are not test themselves
 # but that need to be compiled
@@ -635,7 +633,7 @@ endif
 endif
 endif
 
-test: assemblyresolve/test/asm.dll testjit test-type-load test-generic-sharing test_platform test_2_1 test-messages
+test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
 test-wrench: assemblyresolve/test/asm.dll testjit-wrench test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
 
 # Remove empty .stdout and .stderr files for wrench
@@ -653,7 +651,7 @@ test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
        @failed=0; \
        passed=0; \
        for i in $(TESTSI_CS); do       \
-               if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+               if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
@@ -667,7 +665,7 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
        @failed=0; \
        passed=0; \
        for i in $(TESTSI_IL); do       \
-               if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+               if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" 'no-dump' $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
@@ -679,7 +677,7 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
 
 testb: $(TEST_PROG) $(TESTBS)
        for i in $(TESTBS); do  \
-               $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);     \
+               $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS);   \
        done
 
 runtest-wrench: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@@ -689,7 +687,7 @@ runtest-wrench: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(
        for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
                rm -f $${i}.so; \
                if [ x$(AOT) = x1 ]; then if echo $(AOT_DISABLED_TESTS) | grep -v -q $${i}; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; fi; fi; \
-               if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS_WRENCH)' $(RUNTIME_ARGS); \
+               if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS_WRENCH)' 'dump-output' $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
@@ -715,7 +713,7 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
        for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
                rm -f $${i}.so; \
                if [ x$(AOT) = x1 ]; then if echo $(AOT_DISABLED_TESTS) | grep -v -q $${i}; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; fi; fi; \
-               if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+               if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS); \
                then \
                        passed=`expr $${passed} + 1`; \
                else \
@@ -788,33 +786,85 @@ test-type-load: TestDriver.dll
        @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
 
 
-EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs
+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-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)
-       @for fn in $+ ; do      \
-               echo "Testing $$fn ...";        \
-               MONO_GC_PARAMS=major=marksweep-par MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1; \
-               MONO_ENV_OPTIONS="--gc=sgen"                                    $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1; \
-               MONO_GC_PARAMS=major=marksweep-par,minor=split MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;     \
-               MONO_GC_PARAMS=minor=split MONO_ENV_OPTIONS="--gc=sgen"                     $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;     \
-               MONO_GC_PARAMS=major=marksweep,concurrent-sweep MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;    \
-               MONO_GC_PARAMS=minor=split,major=marksweep,concurrent-sweep MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;        \
-               MONO_GC_PARAMS=major=marksweep-par,minor=split,alloc-ratio=95 MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;      \
-               MONO_GC_PARAMS=minor=split,alloc-ratio=95 MONO_ENV_OPTIONS="--gc=sgen"                     $(RUNTIME) $$fn > $$fn.stdout 2> $$fn.stderr || exit 1;      \
-       done
+       @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.exe sgen-bridge-major-fragmentation.exe
-       @echo "Testing sgen-bridge.exe ...";    \
-       MONO_GC_PARAMS=bridge=Bridge MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) sgen-bridge.exe > sgen-bridge.exe.stdout 2> sgen-bridge.exe.stderr || exit 1;      \
-       MONO_GC_PARAMS=bridge=Bridge,minor=split MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) sgen-bridge.exe > sgen-bridge.exe.stdout 2> sgen-bridge.exe.stderr || exit 1;  \
-       echo "Testing sgen-bridge-major-fragmentation.exe ..."; \
-       MONO_GC_PARAMS=bridge=Bridge MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) sgen-bridge-major-fragmentation.exe > sgen-bridge-major-fragmentation.exe.stdout 2> sgen-bridge-major-fragmentation.exe.stderr || exit 1;  \
-       MONO_GC_PARAMS=bridge=Bridge,minor=split MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) sgen-bridge-major-fragmentation.exe > sgen-bridge-major-fragmentation.exe.stdout 2> sgen-bridge-major-fragmentation.exe.stderr || exit 1;
+sgen-tests: sgen-regular-tests sgen-bridge-tests
 
 
 # Generated tests for runtime invoke