1 SUBDIRS = cas assemblyresolve gc-descriptors
5 aotcheck: testaot gshared-aot
7 TEST_PROG = ../interpreter/mint
9 JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
11 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
12 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
14 RUNTIME_ARGS=--config tests-config --optimize=all --debug
16 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_4_5
18 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
21 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
22 $(RUNTIME) $(mcs_topdir)/class/lib/net_4_5/mkbundle.exe
24 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
25 -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
26 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
28 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/net_4_5/ilasm.exe
30 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
43 assembly-load-stress.cs
45 # Disabled until ?mcs is fixed
51 assemblyresolve_event.cs \
52 assemblyresolve_event3.cs \
85 typeload-unaligned.cs \
87 valuetype-gettype.cs \
89 static-constructor.cs \
99 invoke-string-ctors.cs \
107 assignable-tests.cs \
109 array-subtype-attr.cs \
115 newobj-valuetype.cs \
129 reflection-const-field.cs \
158 appdomain-client.cs \
159 appdomain-unload.cs \
160 appdomain-async-invoke.cs \
197 marshal-valuetypes.cs \
198 test-byval-in-struct.cs \
203 thread-static-init.cs \
214 threadpool-exceptions1.cs \
215 threadpool-exceptions2.cs \
216 threadpool-exceptions3.cs \
217 threadpool-exceptions4.cs \
218 threadpool-exceptions5.cs \
219 threadpool-exceptions6.cs \
220 threadpool-exceptions7.cs \
234 bug-Xamarin-5278.cs \
238 delegate-async-exit.cs \
239 delegate-delegate-exit.cs \
242 finalizer-exception.cs \
244 finalizer-thread.cs \
246 main-returns-abort-resetabort.cs \
247 main-returns-background-abort-resetabort.cs \
248 main-returns-background-resetabort.cs \
249 main-returns-background.cs \
250 main-returns-background-change.cs \
257 transparentproxy.cs \
260 soft-float-tests.cs \
263 assemblyresolve_event2.2.cs \
268 catch-generics.2.cs \
271 stackframes-async.2.cs \
272 module-cctor-loader.2.cs \
273 generics-invoke-byref.2.cs \
274 generic-signature-compare.2.cs \
275 generics-sharing.2.cs \
276 shared-generic-methods.2.cs \
277 shared-generic-synchronized.2.cs \
278 generic-inlining.2.cs \
279 generic-initobj.2.cs \
280 generic-delegate.2.cs \
281 generic-sizeof.2.cs \
282 generic-virtual.2.cs \
283 generic-interface-methods.2.cs \
284 generic-array-type.2.cs \
285 generic-method-patching.2.cs \
286 generic-static-methods.2.cs \
287 generic-null-call.2.cs \
288 generic-special.2.cs \
289 generic-exceptions.2.cs \
290 generic-virtual2.2.cs \
291 generic-valuetype-interface.2.cs \
292 generic-getgenericarguments.2.cs \
293 generic-type-builder.2.cs \
294 generic-synchronized.2.cs \
295 generic-delegate-ctor.2.cs \
296 generic-array-iface-set.2.cs \
297 generic-typedef.2.cs \
298 generic-marshalbyref.2.cs \
299 generic-xdomain.2.cs \
302 generic-virtual-invoke.2.cs \
304 generic-sealed-virtual.2.cs \
305 generic-system-arrays.2.cs \
306 generic-stack-traces.2.cs \
307 generic-stack-traces2.2.cs \
309 recursive-generics.2.cs \
315 dynamic-method-access.2.cs \
316 dynamic-method-finalize.2.cs \
319 ienumerator-interfaces.2.cs \
320 array-enumerator-ifaces.2.cs \
321 generic_type_definition_encoding.2.cs \
322 generic_type_definition.2.cs \
326 bug-322722_patch_bx.2.cs \
329 bug-322722_dyn_method_throw.2.cs \
335 nullable_boxing.2.cs \
336 valuetype-equals.cs \
337 custom-modifiers.2.cs \
339 test-inline-call-stack.cs \
348 bug-389886-sre-generic-interface-instances.cs \
355 generic-unloading.2.cs \
356 generic-unloading-sub.2.cs \
358 appdomain-unload-callback.cs \
364 appdomain-thread-abort.cs \
376 dynamic-method-resurrection.cs \
387 async-with-cb-throws.cs \
388 appdomain-unload-doesnot-raise-pending-events.cs \
390 assembly_append_ordering.cs \
392 allow-synchronous-major.cs \
393 unload-appdomain-on-shutdown.cs \
394 block_guard_restore_aligment_on_exit.cs \
395 finally_block_ending_in_dead_bb.cs \
396 thread_static_gc_layout.cs
399 $(BASE_TEST_CS_SRC) \
400 async-exc-compilation.cs \
405 runtime-invoke.gen.cs \
406 imt_big_iface_test.cs
409 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN) async-exc-compilation.cs finally_guard.cs
411 PLATFORM_DISABLED_TESTS = finally_guard.exe
414 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN) async-exc-compilation.cs finally_guard.cs
416 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN)
421 TEST_CS_SRC+=async-exc-compilation.cs filter-stack.cs
423 PLATFORM_DISABLED_TESTS=exception17.exe
424 PLATFORM_DISABLED_TESTS+=winx64structs.exe
430 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe
437 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
441 PLATFORM_DISABLED_TESTS=filter-stack.exe
445 # monitor.exe is racy
446 PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
450 PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
451 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
455 # Tests that use Thread.Abort()
456 PLATFORM_DISABLED_TESTS= abort-stress-1.exe \
459 appdomain-thread-abort.exe \
460 async-exc-compilation.exe \
463 finalizer-abort.exe \
465 main-returns-abort-resetabort.exe \
466 main-returns-background-abort-resetabort.exe \
468 threadpool-exceptions5.exe \
469 threadpool-exceptions6.exe
471 # Tests that rely on AppDomain.Unload
472 PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
474 appdomain-unload-callback.exe \
475 appdomain-unload.exe \
477 generic-unloading.2.exe \
480 threadpool-exceptions7.exe \
483 # pinvoke2 attaches a thread to the runtime, but
484 # doesn't 'unattach' it and it hangs in GC on exit
485 PLATFORM_DISABLED_TESTS+= pinvoke2.exe
487 # Tests that currently hang waiting for non-main threads
488 # to exit in NaCl, need to investigate. Most are AppDomain
489 # creation and Delegate tests.
490 PLATFORM_DISABLED_TESTS+= appdomain1.exe \
492 marshal-valuetypes.exe \
494 stackframes-async.2.exe \
495 generic-marshalbyref.2.exe \
496 generic-xdomain.2.exe \
499 # Tests that fail trying to write files (appdomain create mostly)
500 PLATFORM_DISABLED_TESTS+= bug-335131.2.exe \
505 # FIXME: don't know why delegate2.exe fails, it shouldn't
506 PLATFORM_DISABLED_TESTS+= delegate2.exe
508 # These tests newly fail with the latest revision. pinvoke3 fails because
509 # of a thread attach, the others have not been investigated. TODO revisit.
510 PLATFORM_DISABLED_TESTS+= pinvoke3.exe \
512 async-with-cb-throws.exe \
513 appdomain-unload-doesnot-raise-pending-events.exe \
514 gsharing-valuetype-layout.exe
517 # FIXME: There are problems with async callbacks and results on NaCl 32-bit
518 PLATFORM_DISABLED_TESTS+= delegate1.exe \
524 threadpool-exceptions3.exe \
529 # FIXME: These tests hang/fail for unknown reasons, deal with exiting
530 PLATFORM_DISABLED_TESTS+= main-returns-background-resetabort.exe \
531 main-returns-background.exe \
532 main-returns-background-change.exe
537 # The two finalizer tests only work under sgen
538 # gc-altstack.exe fails under boehm because it has no support for altstack
539 # bug-459094.exe creates an extremely deep directory tree
540 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
543 delegate-async-exception.exe \
546 delegate-invoke.exe \
547 $(PLATFORM_DISABLED_TESTS)
549 DISABLED_TESTS_WRENCH= \
551 $(PLATFORM_DISABLED_TESTS_WRENCH) \
552 main-returns-background-resetabort.exe \
553 main-returns-background-abort-resetabort.exe \
555 assemblyresolve_event3.exe \
559 AOT_DISABLED_TESTS=constraints-load.exe
561 # These only compile with MS CSC
580 static-fields-nonconst.il \
581 reload-at-bb-end.il \
582 test-enum-indstoreil.il \
589 call_missing_method.il \
590 call_missing_class.il \
591 ldfld_missing_field.il \
592 ldfld_missing_class.il \
599 ldtoken_with_byref_typespec.2.il \
600 resolve_method_bug.2.il \
601 resolve_field_bug.2.il \
602 resolve_type_bug.2.il \
603 generics-sharing-other-exc.2.il \
605 generic-mkrefany.2.il \
606 generic-refanyval.2.il \
607 generic-ldtoken.2.il \
608 generic-ldtoken-method.2.il \
609 generic-ldtoken-field.2.il \
610 generic-tailcall.2.il \
611 generic-tailcall2.2.il \
612 generic-array-exc.2.il \
613 generic-valuetype-newobj2.2.il \
614 generic-valuetype-newobj.2.il \
615 generic-constrained.2.il \
616 generic-type-load-exception.2.il \
623 constraints-load.il \
624 array_load_exception.il \
626 interface-with-static-method.il \
629 delegate-with-null-target.il \
631 gsharing-valuetype-layout.il \
632 invalid_generic_instantiation.il
635 # pre-requisite test sources: files that are not test themselves
636 # but that need to be compiled
637 PREREQ_IL_SRC=event-il.il module-cctor.il
639 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
642 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
643 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
644 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
645 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
646 TESTBS=$(BENCHSRC:.cs=.exe)
647 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
649 EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
650 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
655 %.exe: %.cs TestDriver.dll
656 $(MCS) -r:TestDriver.dll -out:$@ $<
658 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
662 # Can't use mkbundle on win32 since there is no static build there
663 # Can't run test-unhandled-exception on Windows because of all the debug popups...
667 # mkbundle uses the installed mono-2.pc so it won't work if there is no system mono
668 #test_platform: testbundle test-iomap-regression
669 test_platform: test-iomap-regression
676 test_platform: test-eglib-remap
680 # Target to precompile the test executables
681 tests: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS) $(GSHARED_TESTS)
684 # Test that no symbols are missed in eglib-remap.h
686 OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file'
691 @echo "Testing eglib remap..."
692 @if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -v $(OK_G_SYMBOLS) | grep 't g_'; then exit 1; else exit 0; fi; fi
696 # Tests that the internals in mono/io-layer/messages.c are ok by triggering the
697 # code that checks that the table is properly sorted
702 test-messages: w32message.exe
704 $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe >& w32message.allout && cmp test_messages.zero w32message.allout
708 test-sgen : sgen-tests
714 test-sgen : sgen-tests
718 test-sgen : sgen-tests
721 test-sgen : sgen-regular-tests
727 # Precompile the test assemblies in parallel
729 $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
731 test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test-process-exit test-messages rm-empty-logs
732 test-wrench: compile-tests assemblyresolve/test/asm.dll testjit-wrench test-generic-sharing test-type-load test_platform test-process-exit test-sgen test-messages rm-empty-logs
734 # Remove empty .stdout and .stderr files for wrench
736 @echo "Removing empty logs..."
737 @find . '(' -name "*.stdout" -o -name "*.stderr" ')' -empty -exec rm {} \;
739 assemblyresolve/test/asm.dll:
740 $(MAKE) -C assemblyresolve prereq
743 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
745 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
748 for i in $(TESTSI_CS); do \
749 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS); \
751 passed=`expr $${passed} + 1`; \
753 if [ $$? = 2 ]; then break; fi; \
754 failed=`expr $${failed} + 1`; \
757 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
759 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
762 for i in $(TESTSI_IL); do \
763 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" 'no-dump' $(RUNTIME_ARGS); \
765 passed=`expr $${passed} + 1`; \
767 if [ $$? = 2 ]; then break; fi; \
768 failed=`expr $${failed} + 1`; \
771 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
773 testb: $(TEST_PROG) $(TESTBS)
774 for i in $(TESTBS); do \
775 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS); \
778 runtest-wrench: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
782 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
784 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; \
785 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS_WRENCH)' 'dump-output' $(RUNTIME_ARGS); \
787 passed=`expr $${passed} + 1`; \
789 if [ $$? = 2 ]; then break; fi; \
790 failed=`expr $${failed} + 1`; \
791 failed_tests="$${failed_tests} $$i"; \
794 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
795 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
796 for i in $${failed_tests}; do echo $${i}; cat $${i}.stdout; cat $${i}.stderr; done; exit 1; fi
798 runtest-managed-wrench: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
799 @$(RUNTIME) ./test-runner.exe -j a --disabled '$(DISABLED_TESTS_WRENCH)' $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
802 @if test x$(M) != x; then $(MAKE) runtest-managed-wrench; else $(MAKE) runtest-wrench; fi
804 runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
808 rm -f testlist testlist.sorted; \
809 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do echo $${i} >> testlist; sort testlist > testlist.sorted; done; \
810 for i in `cat testlist.sorted`; do \
812 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; \
813 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' 'no-dump' $(RUNTIME_ARGS); \
815 passed=`expr $${passed} + 1`; \
817 if [ $$? = 2 ]; then break; fi; \
818 failed=`expr $${failed} + 1`; \
819 failed_tests="$${failed_tests} $$i"; \
822 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
823 rm -f testlist testlist.sorted; \
824 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
825 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
827 runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
828 @$(RUNTIME) ./test-runner.exe -j a --disabled '$(DISABLED_TESTS)' $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
831 @if test x$(M) != x; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
834 @$(MAKE) AOT=1 runtest
837 @$(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" runtest
840 @$(MAKE) JITTEST_PROG_RUN="$(TEST_PROG_RUN)" runtest
842 testjitspeed: $(JITTEST_PROG) $(TESTBS)
843 for i in $(TESTBS); do \
845 time $(JITTEST_PROG) $$i; \
848 test-iomap-regression: exists.cs
849 @$(MCS) $(srcdir)/exists.cs -out:exists.exe
850 @echo "Testing exists.exe..."
851 @MONO_IOMAP=all $(RUNTIME) exists.exe
853 stresstest: $(STRESS_TESTS)
857 for i in $(STRESS_TESTS); do \
858 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
860 passed=`expr $${passed} + 1`; \
862 if [ $$? = 2 ]; then break; fi; \
863 failed=`expr $${failed} + 1`; \
864 failed_tests="$${failed_tests} $$i"; \
867 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
868 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
869 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
871 testbundle: console.exe
872 @echo "Testing mkbundle..."
873 @$(MKBUNDLE) --static console.exe > mkbundle.stdout
874 @$(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out >> mkbundle.stdout
877 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
878 test-type-load: TestDriver.dll
879 @$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il > /dev/null
880 @$(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
881 @$(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
882 @$(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
883 @echo "Testing load-exception.exe..."
884 @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
886 EXTRA_DIST += debug-casts.cs
887 # This depends on TLS, so its not ran by default
889 @$(MCS) -r:TestDriver.dll $(srcdir)/debug-casts.cs
890 @$(RUNTIME) --debug=casts debug-casts.exe
892 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-bridge-xref.cs
895 #those are actually configurations, eg plain_sgen-descriptors.exe
896 #DISABLE_SGEN_TESTS =
900 critical-finalizers.exe \
901 sgen-descriptors.exe \
902 sgen-gshared-vtype.exe \
903 sgen-domain-unload.exe \
904 sgen-weakref-stress.exe \
905 sgen-cementing-stress.exe \
906 sgen-case-23400.exe \
907 sgen-new-threads-dont-join-stw.exe
909 SGEN_CONFIGURATIONS = \
911 "major=marksweep-par|ms-par" \
912 "major=marksweep-conc|ms-conc" \
913 "major=marksweep-conc,minor=split|ms-conc-split" \
914 "minor=split|ms-split" \
915 "minor=split,alloc-ratio=95|ms-split-95"
917 #FIXME We should move to use SGEN_CONFIGURATIONS once sgen supports trailling commas or its argument list.
918 SGEN_BRIDGE_CONFIGURATIONS = \
920 ",major=marksweep-conc|ms-conc" \
921 ",minor=split|ms-split"
923 sgen-regular-tests: $(SGEN_TESTS)
929 for conf in $(SGEN_CONFIGURATIONS); do \
930 name=`echo $$conf | cut -d\| -f 2`; \
931 params=`echo $$conf | cut -d\| -f 1`; \
932 test_name="$${test}|$${name}"; \
933 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); \
935 passed=`expr $${passed} + 1`; \
937 if [ $$? = 2 ]; then break; fi; \
938 failed=`expr $${failed} + 1`; \
939 failed_tests="$${failed_tests} $$test_name"; \
943 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
944 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
945 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
947 sgen-bridge-tests1: sgen-bridge.exe sgen-bridge-major-fragmentation.exe
953 for conf in $(SGEN_BRIDGE_CONFIGURATIONS); do \
954 name=`echo $$conf | cut -d\| -f 2`; \
955 params=`echo $$conf | cut -d\| -f 1`; \
956 test_name="$${test}|$${name}"; \
957 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); \
959 passed=`expr $${passed} + 1`; \
961 if [ $$? = 2 ]; then break; fi; \
962 failed=`expr $${failed} + 1`; \
963 failed_tests="$${failed_tests} $$test_name"; \
967 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
968 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
969 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
971 sgen-bridge-tests2: sgen-bridge-xref.exe
977 for conf in $(SGEN_BRIDGE_CONFIGURATIONS); do \
978 name=`echo $$conf | cut -d\| -f 2`; \
979 params=`echo $$conf | cut -d\| -f 1`; \
980 test_name="$${test}|$${name}"; \
981 if MONO_GC_PARAMS="bridge=2Bridge$${params}" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" 'dump-output' $(RUNTIME_ARGS); \
983 passed=`expr $${passed} + 1`; \
985 if [ $$? = 2 ]; then break; fi; \
986 failed=`expr $${failed} + 1`; \
987 failed_tests="$${failed_tests} $$test_name"; \
991 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
992 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
993 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
996 sgen-bridge-tests: sgen-bridge-tests1 sgen-bridge-tests2
998 sgen-tests: sgen-regular-tests sgen-bridge-tests
1000 AOT_CONFIGURATIONS= \
1004 #LLVM crashes, got to fix it first.
1006 # "--llvm --gc=boehm|llvm+boehm"
1014 tmpfile=`mktemp -t mono_aot_output` || exit 1; \
1015 rm -f test-aot-$${name}.stdout test-aot-$${name}.stderr; \
1016 for assembly in $(mcs_topdir)/class/lib/$$profile/*.dll ; do \
1017 asm_name=`basename $$assembly`; \
1018 echo "... $$asm_name"; \
1019 for conf in $(AOT_CONFIGURATIONS); do \
1020 name=`echo $$conf | cut -d\| -f 2`; \
1021 params=`echo $$conf | cut -d\| -f 1`; \
1022 test_name="$${asm_name}|$${name}"; \
1023 echo " $$test_name"; \
1024 if MONO_PATH=$(mcs_topdir)/class/lib/$$profile $(JITTEST_PROG_RUN) $$params --aot=outfile=$$tmpfile $$assembly >> test-aot-$${name}.stdout 2>> test-aot-$${name}.stderr; \
1026 passed=`expr $${passed} + 1`; \
1028 failed=`expr $${failed} + 1`; \
1029 failed_tests="$${failed_tests} $$test_name"; \
1034 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1035 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1036 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1039 # Generated tests for runtime invoke
1040 EXTRA_DIST += gen-runtime-invoke.cs
1041 runtime-invoke.gen.exe: TestDriver.dll gen-runtime-invoke.exe
1042 $(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
1043 $(MCS) -out:runtime-invoke.gen.exe -r:TestDriver.dll runtime-invoke.gen.cs
1045 EXTRA_DIST += make-imt-test.cs
1046 imt_big_iface_test.exe: TestDriver.dll make-imt-test.exe
1047 $(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
1048 $(MCS) -out:imt_big_iface_test.exe -r:TestDriver.dll imt_big_iface_test.cs
1050 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
1051 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
1052 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
1053 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
1054 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
1056 EXTRA_DIST += unhandled-exception-base-configuration.config
1057 EXTRA_DIST += unhandled-exception-legacy-configuration.config
1058 EXTRA_DIST += appdomain-unload.exe.config
1059 EXTRA_DIST += unhandled-exception-test-case.2.cs
1060 EXTRA_DIST += unhandled-exception-test-runner.2.cs
1061 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
1062 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
1063 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
1064 cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
1065 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
1066 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
1067 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
1068 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
1069 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
1070 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
1071 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
1072 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
1073 $(MCS) /debug unhandled-exception-test-case.1.cs
1074 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
1075 $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
1076 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
1077 $(MCS) /debug unhandled-exception-test-case.2.cs
1078 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
1079 $(MCS) /debug unhandled-exception-test-case-legacy.2.cs
1080 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
1081 $(MCS) /debug unhandled-exception-test-runner.2.cs
1083 test-unhandled-exception: unhandled-exception-test-runner.2.exe unhandled-exception-config_files unhandled-exception-test-case.1.exe unhandled-exception-test-case-legacy.1.exe unhandled-exception-test-case.2.exe unhandled-exception-test-case-legacy.2.exe
1084 $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
1086 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
1087 bug-80307.exe: $(srcdir)/bug-80307.cs
1088 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
1089 cd $(top_builddir)/runtime && $(MAKE) test-support-files
1091 EXTRA_DIST += bug-81673-interface.cs
1092 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
1093 $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1094 $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
1095 $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1097 EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
1098 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
1099 $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
1100 $(MCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
1101 $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
1102 rm -f bug-81691-a.dll
1103 bug-81691.exe: bug-81691-b.dll
1105 EXTRA_DIST += bug-81466-lib.il
1106 bug-81466-lib.dll: bug-81466-lib.il
1107 $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
1108 bug-81466.exe: bug-81466.il bug-81466-lib.dll
1109 $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
1111 EXTRA_DIST += bug-324535-il.il
1112 bug-324535-il.dll : bug-324535-il.il
1113 $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
1114 bug-324535.exe : bug-324535.cs bug-324535-il.dll
1115 $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
1117 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
1118 custom-modifiers-lib.dll: custom-modifiers-lib.il
1119 $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
1120 custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
1121 $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
1123 EXTRA_DIST += bug-382986-lib.cs
1124 bug-382986-lib.dll: bug-382986-lib.cs
1125 $(MCS) -target:library -out:$@ $(srcdir)/bug-382986-lib.cs
1126 bug-382986.exe: bug-382986.cs bug-382986-lib.dll
1127 $(MCS) -out:$@ -r:bug-382986-lib.dll $(srcdir)/bug-382986.cs
1129 EXTRA_DIST += coreclr-security.cs
1131 coreclr-security.exe : coreclr-security.cs
1132 $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
1134 test-coreclr-security : coreclr-security.exe
1135 @echo "Testing coreclr-security.exe..."
1136 @$(RUNTIME_MOONLIGHT) --security=core-clr-test coreclr-security.exe
1138 EXTRA_DIST += generic-unboxing.2.il
1139 generic-unboxing.2.dll : generic-unboxing.2.il
1140 $(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
1142 EXTRA_DIST += generic-boxing.2.il
1143 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
1144 $(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
1146 EXTRA_DIST += generic-unbox.2.cs
1147 generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
1148 $(MCS) -r:generic-unboxing.2.dll -out:$@ $(srcdir)/generic-unbox.2.cs
1150 EXTRA_DIST += generic-box.2.cs
1151 generic-box.2.exe : generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
1152 $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll -out:$@ $(srcdir)/generic-box.2.cs
1154 EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
1155 generic-delegate2-lib.2.dll : generic-delegate2-lib.2.il
1156 $(ILASM) /dll /output:$@ $(srcdir)/generic-delegate2-lib.2.il
1157 generic-delegate2.2.exe : generic-delegate2.2.cs generic-delegate2-lib.2.dll
1158 $(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
1160 bug-3903.exe: bug-3903.cs
1161 $(MCS) -sdk:2 $(srcdir)/bug-3903.cs -out:$@
1163 gshared: test-generic-sharing
1166 @$(MAKE) AOT=1 gshared
1169 generics-sharing.2.exe shared-generic-methods.2.exe \
1170 shared-generic-synchronized.2.exe generic-initobj.2.exe \
1171 generics-sharing-other-exc.2.exe generic-box.2.exe \
1172 generic-unbox.2.exe generic-delegate.2.exe generic-sizeof.2.exe \
1173 generic-ldobj.2.exe generic-mkrefany.2.exe \
1174 generic-refanyval.2.exe generic-ldtoken.2.exe \
1175 generic-ldtoken-method.2.exe generic-ldtoken-field.2.exe \
1176 generic-virtual.2.exe generic-tailcall.2.exe \
1177 generic-interface-methods.2.exe generic-array-type.2.exe \
1178 generic-method-patching.2.exe generic-static-methods.2.exe \
1179 generic-null-call.2.exe generic-tailcall2.2.exe \
1180 generic-array-exc.2.exe generic-special.2.exe \
1181 generic-exceptions.2.exe generic-delegate2.2.exe \
1182 generic-virtual2.2.exe generic-valuetype-interface.2.exe \
1183 generic-valuetype-newobj.2.exe generic-valuetype-newobj2.2.exe \
1184 generic-getgenericarguments.2.exe generic-type-builder.2.exe \
1185 generic-synchronized.2.exe generic-delegate-ctor.2.exe \
1186 generic-constrained.2.exe bug-431413.2.exe \
1187 generic-virtual-invoke.2.exe generic-typedef.2.exe \
1188 generic-marshalbyref.2.exe bug-459285.2.exe bug-461198.2.exe \
1189 generic-sealed-virtual.2.exe generic-system-arrays.2.exe \
1190 generic-stack-traces.2.exe generic-stack-traces2.2.exe \
1191 bug-472600.2.exe bug-473482.2.exe bug-473999.2.exe \
1192 bug-479763.2.exe generic-xdomain.2.exe \
1193 generic-type-load-exception.2.exe bug-616463.exe \
1196 test-generic-sharing-normal: $(GSHARED_TESTS)
1197 @for fn in $+ ; do \
1198 echo "Testing $$fn ..."; \
1199 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared $$fn > $$fn.stdout || exit 1; \
1200 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,shared $$fn > $$fn.stdout || exit 1; \
1201 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline $$fn > $$fn.stdout || exit 1; \
1202 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline,shared $$fn > $fn.stdout || exit 1; \
1203 if [ x$(AOT) = x1 ]; then MONO_GENERIC_SHARING=all $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; MONO_GENERIC_SHARING=all $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
1206 test-generic-sharing-managed: test-runner.exe $(GSHARED_TESTS)
1207 @$(RUNTIME) ./test-runner.exe -j a --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
1210 test-generic-sharing:
1212 test-generic-sharing:
1213 @if test x$(M) != x; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
1216 EXTRA_DIST += async-exceptions.cs
1217 async-exceptions.exe : async-exceptions.cs
1218 $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
1219 test-async-exceptions : async-exceptions.exe
1220 for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:foo $$i async-exceptions.exe || exit 1; done
1221 for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:bar $$i async-exceptions.exe || exit 1; done
1223 EXTRA_DIST += modules.cs modules-m1.cs
1224 modules-m1.netmodule: modules-m1.cs
1225 $(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
1226 modules.exe: modules.cs modules-m1.netmodule TestDriver.dll
1227 $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
1229 # Useful if mono is compiled with --enable-shared=no
1231 cp "../../libtool" .
1232 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
1233 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
1240 EXTRA_DIST += bug-438454.cs bug-438454.exe.stdout.expected threadpool-in-processexit.cs threadpool-in-processexit.exe.stdout.expected
1242 @$(MCS) $(srcdir)/bug-438454.cs -out:bug-438454.exe
1243 @echo "Testing bug-438454.exe..."
1244 @$(RUNTIME) bug-438454.exe > bug-438454.exe.stdout
1245 @diff -w bug-438454.exe.stdout $(srcdir)/bug-438454.exe.stdout.expected
1246 @$(MCS) $(srcdir)/threadpool-in-processexit.cs -out:threadpool-in-processexit.exe
1247 @echo "Testing threadpool-in-processexit.exe..."
1248 @$(RUNTIME) threadpool-in-processexit.exe > threadpool-in-processexit.exe.stdout
1249 @diff -w threadpool-in-processexit.exe.stdout $(srcdir)/threadpool-in-processexit.exe.stdout.expected
1253 gc-oom-handling.exe \
1254 gc-oom-handling2.exe
1257 test-oom: $(OOM_TESTS)
1258 @for fn in $+ ; do \
1259 echo "Testing $$fn ..."; \
1260 MONO_GC_PARAMS=max-heap-size=16m,major=marksweep-par MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout || exit 1; \
1261 MONO_GC_PARAMS=max-heap-size=16m MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout || exit 1; \
1262 MONO_GC_PARAMS=max-heap-size=16m $(RUNTIME) $$fn > $$fn.stdout || exit 1; \
1266 noinst_LTLIBRARIES = libtest.la
1268 AM_CPPFLAGS = $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
1271 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
1272 # This shows up when compiling mono_test_marshal_delegate ()
1273 libtest_la_CFLAGS=-fno-optimize-sibling-calls
1274 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
1275 # can't find them. So we use --kill-at to remove the @ suffix as well.
1276 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
1278 libtest_la_LDFLAGS = -rpath `pwd`
1280 libtest_la_SOURCES = libtest.c
1281 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
1283 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.aotlog *.exe stest.dat