[tests] Add stress testing and reduce sgen normal testing time (#4653)
[mono.git] / mono / tests / Makefile.am
index 1ac4b05e278feacf7f4fc3b732636356c3f3333d..47d456c4c3b176fcfdff329483225ae4e2196089 100644 (file)
@@ -1,37 +1,41 @@
 SUBDIRS = gc-descriptors . testing_gac
 
 check-local:
-       $(MAKE) test-jit
-       $(MAKE) test-generic-sharing
-       $(MAKE) test-type-load
-       $(MAKE) test-multi-netmodule
-       $(MAKE) test-cattr-type-load
-       $(MAKE) test-reflection-load-with-context
-       $(MAKE) test-platform
-       $(MAKE) test-console-output
-       $(MAKE) test-env-options
-       $(MAKE) test-unhandled-exception-2
-if !FULL_AOT_TESTS
-       $(MAKE) test-appdomain-unload
-endif
-       $(MAKE) test-process-stress
-       $(MAKE) test-pedump
-       $(MAKE) rm-empty-logs
-       $(MAKE) runtest-gac-loading
+       ok=:; \
+       $(MAKE) test-jit || ok=false; \
+       $(MAKE) test-generic-sharing || ok=false; \
+       $(MAKE) test-type-load || ok=false; \
+       $(MAKE) test-multi-netmodule || ok=false; \
+       $(MAKE) test-cattr-type-load || ok=false; \
+       $(MAKE) test-reflection-load-with-context || ok=false; \
+       $(MAKE) test-platform || ok=false; \
+       $(MAKE) test-console-output || ok=false; \
+       $(MAKE) test-env-options || ok=false; \
+       $(MAKE) test-unhandled-exception-2 || ok=false; \
+       $(MAKE) test-appdomain-unload || ok=false; \
+       $(MAKE) test-process-stress || ok=false; \
+       $(MAKE) test-pedump || ok=false; \
+       $(MAKE) rm-empty-logs || ok=false; \
+       $(MAKE) runtest-gac-loading || ok=false; \
+       $$ok
 
 check-full:
-       $(MAKE) test-sgen
-       $(MAKE) check-local
+       ok=; \
+       $(MAKE) test-sgen || ok=false; \
+       $(MAKE) check-local || ok=false; \
+       $$ok
 
 check-parallel:
-       $(MAKE) compile-tests
-       $(MAKE) check-full
+       ok=; \
+       $(MAKE) compile-tests; \
+       $(MAKE) check-full || ok=false; \
+       $$ok
 
 check-coreclr:
        $(MAKE) -C $(mono_build_root)/acceptance-tests check-coreclr
 
 check-stress:
-       MONO_TESTS_STRESS=1 $(MAKE) test-sgen
+       $(MAKE) test-stress-sgen
 
 # for backwards compatibility on Wrench
 test-wrench: check-parallel
@@ -1391,10 +1395,22 @@ debug-casts: debug-casts.exe
 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 sgen-domain-unload-2.cs sgen-suspend.cs sgen-new-threads-dont-join-stw.cs sgen-new-threads-dont-join-stw-2.cs sgen-new-threads-collect.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs sgen-bridge-gchandle.cs
 
 test-sgen:
-       $(MAKE) test-sgen-regular
-       $(MAKE) test-sgen-toggleref
-       $(MAKE) test-sgen-bridge
-       $(MAKE) test-sgen-bridge2
+       ok=; \
+       $(MAKE) test-sgen-regular || ok=false; \
+       $(MAKE) test-sgen-toggleref || ok=false; \
+       $(MAKE) test-sgen-bridge || ok=false; \
+       $(MAKE) test-sgen-bridge2 || ok=false; \
+       $(MAKE) test-sgen-bridge3 || ok=false; \
+       $$ok
+
+test-stress-sgen:
+       ok=; \
+       $(MAKE) test-stress-sgen-regular || ok=false; \
+       $(MAKE) test-stress-sgen-toggleref || ok=false; \
+       $(MAKE) test-stress-sgen-bridge || ok=false; \
+       $(MAKE) test-stress-sgen-bridge2 || ok=false; \
+       $(MAKE) test-stress-sgen-bridge3 || ok=false; \
+       $$ok
 
 TESTS_SGEN_REGULAR_SRC =       \
        finalizer-wait.cs       \
@@ -1423,15 +1439,23 @@ TESTSAOT_SGEN_REGULAR=$(TESTS_SGEN_REGULAR:.exe=.exe$(PLATFORM_AOT_SUFFIX))
 endif
 
 test-sgen-regular: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR)
-       $(MAKE) test-sgen-regular-ms
-       $(MAKE) test-sgen-regular-ms-conc
-       $(MAKE) test-sgen-regular-ms-conc-par
-       $(MAKE) test-sgen-regular-ms-conc-split
-       $(MAKE) test-sgen-regular-ms-split
-       $(MAKE) test-sgen-regular-ms-conc-split-95
-       $(MAKE) test-sgen-regular-ms-clear-at-gc
-       $(MAKE) test-sgen-regular-ms-conc-clear-at-gc
-       $(MAKE) test-sgen-regular-ms-conc-split-clear-at-gc
+       ok=; \
+       $(MAKE) test-sgen-regular-ms || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc || ok=false; \
+       $$ok
+
+test-stress-sgen-regular: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR)
+       ok=; \
+       $(MAKE) test-sgen-regular-ms MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc-par MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc-split-95 MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-regular-ms-conc-split-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $$ok
 
 test-sgen-regular-ms: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
@@ -1466,14 +1490,22 @@ TESTSAOT_SGEN_TOGGLEREF=$(TESTS_SGEN_TOGGLEREF:.exe=.exe$(PLATFORM_AOT_SUFFIX))
 endif
 
 test-sgen-toggleref: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF)
-       $(MAKE) test-sgen-toggleref-ms
-       $(MAKE) test-sgen-toggleref-ms-conc
-       $(MAKE) test-sgen-toggleref-ms-conc-split
-       $(MAKE) test-sgen-toggleref-ms-split
-       $(MAKE) test-sgen-toggleref-ms-split-95
-       $(MAKE) test-sgen-toggleref-ms-clear-at-gc
-       $(MAKE) test-sgen-toggleref-ms-conc-clear-at-gc
-       $(MAKE) test-sgen-toggleref-ms-split-clear-at-gc
+       ok=; \
+       $(MAKE) test-sgen-toggleref-ms || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-conc || ok=false; \
+       $$ok
+
+test-stress-sgen-toggleref: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF)
+       ok=; \
+       $(MAKE) test-sgen-toggleref-ms MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-conc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-conc-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-split-95 MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-conc-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-toggleref-ms-split-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
+       $$ok
 
 test-sgen-toggleref-ms: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
@@ -1507,14 +1539,22 @@ TESTSAOT_SGEN_BRIDGE=$(TESTS_SGEN_BRIDGE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
 endif
 
 test-sgen-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE)
-       $(MAKE) test-sgen-bridge-ms
-       $(MAKE) test-sgen-bridge-ms-conc
-       $(MAKE) test-sgen-bridge-ms-split
-       $(MAKE) test-sgen-bridge-ms-new-bridge
-       $(MAKE) test-sgen-bridge-ms-conc-new-bridge
-       $(MAKE) test-sgen-bridge-ms-split-new-bridge
-       $(MAKE) test-sgen-bridge-ms-tarjan-bridge
-       $(MAKE) test-sgen-bridge-ms-split-tarjan-bridge
+       ok=; \
+       $(MAKE) test-sgen-bridge-ms || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-conc || ok=false; \
+       $$ok
+
+test-stress-sgen-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE)
+       ok=; \
+       $(MAKE) test-sgen-bridge-ms MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-conc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-conc-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-split-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge-ms-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $$ok
 
 test-sgen-bridge-ms: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
@@ -1547,14 +1587,22 @@ TESTSAOT_SGEN_BRIDGE2=$(TESTS_SGEN_BRIDGE2:.exe=.exe$(PLATFORM_AOT_SUFFIX))
 endif
 
 test-sgen-bridge2: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2)
-       $(MAKE) test-sgen-bridge2-ms
-       $(MAKE) test-sgen-bridge2-ms-conc
-       $(MAKE) test-sgen-bridge2-ms-split
-       $(MAKE) test-sgen-bridge2-ms-new-bridge
-       $(MAKE) test-sgen-bridge2-ms-conc-new-bridge
-       $(MAKE) test-sgen-bridge2-ms-split-new-bridge
-       $(MAKE) test-sgen-bridge2-ms-tarjan-bridge
-       $(MAKE) test-sgen-bridge2-ms-split-tarjan-bridge
+       ok=; \
+       $(MAKE) test-sgen-bridge2-ms || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-conc || ok=false; \
+       $$ok
+
+test-stress-sgen-bridge2: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2)
+       ok=; \
+       $(MAKE) test-sgen-bridge2-ms MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-conc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-conc-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-split-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge2-ms-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $$ok
 
 test-sgen-bridge2-ms: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
@@ -1587,14 +1635,22 @@ TESTSAOT_SGEN_BRIDGE3=$(TESTS_SGEN_BRIDGE3:.exe=.exe$(PLATFORM_AOT_SUFFIX))
 endif
 
 test-sgen-bridge3: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3)
-       $(MAKE) test-sgen-bridge3-ms
-       $(MAKE) test-sgen-bridge3-ms-conc
-       $(MAKE) test-sgen-bridge3-ms-split
-       $(MAKE) test-sgen-bridge3-ms-new-bridge
-       $(MAKE) test-sgen-bridge3-ms-conc-new-bridge
-       $(MAKE) test-sgen-bridge3-ms-split-new-bridge
-       $(MAKE) test-sgen-bridge3-ms-tarjan-bridge
-       $(MAKE) test-sgen-bridge3-ms-split-tarjan-bridge
+       ok=; \
+       $(MAKE) test-sgen-bridge3-ms || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-conc || ok=false; \
+       $$ok
+
+test-stress-sgen-bridge3: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3)
+       ok=; \
+       $(MAKE) test-sgen-bridge3-ms MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-conc MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-split MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-conc-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-split-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $(MAKE) test-sgen-bridge3-ms-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
+       $$ok
 
 test-sgen-bridge3-ms: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
@@ -1934,10 +1990,12 @@ TESTSAOT_UNHANDLED_EXCEPTION_255=$(TESTS_UNHANDLED_EXCEPTION_255:.exe=.exe$(PLAT
 endif
 
 test-unhandled-exception-2: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_255)
-       $(MAKE) test-unhandled-exception-2-1-with-managed-handler
-       $(MAKE) test-unhandled-exception-2-1-without-managed-handler
-       $(MAKE) test-unhandled-exception-2-255-with-managed-handler
-       $(MAKE) test-unhandled-exception-2-255-without-managed-handler
+       ok=; \
+       $(MAKE) test-unhandled-exception-2-1-with-managed-handler || ok=false; \
+       $(MAKE) test-unhandled-exception-2-1-without-managed-handler || ok=false; \
+       $(MAKE) test-unhandled-exception-2-255-with-managed-handler || ok=false; \
+       $(MAKE) test-unhandled-exception-2-255-without-managed-handler || ok=false; \
+       $$ok
 
 test-unhandled-exception-2-1-with-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_1) test-runner.exe
        $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(TESTS_UNHANDLED_EXCEPTION_1)
@@ -1950,6 +2008,9 @@ test-unhandled-exception-2-255-without-managed-handler: $(TESTS_UNHANDLED_EXCEPT
 
 EXTRA_DIST += appdomain-loader.cs appdomain-tester.cs
 
+if FULL_AOT_TESTS
+test-appdomain-unload:
+else
 appdomain-loader.exe: appdomain-tester.exe
 
 test-appdomain-unload: appdomain-loader.exe appdomain-tester.exe
@@ -1957,6 +2018,7 @@ test-appdomain-unload: appdomain-loader.exe appdomain-tester.exe
        $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.2.stdout || exit 1;
        MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.3.stdout || exit 1;
        MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.4.stdout || exit 1;
+endif
 
 EXTRA_DIST += console-output.cs console-output.exe.stderr.expected console-output.exe.stdout.expected
 test-console-output: console-output.exe