1 SUBDIRS = cas assemblyresolve
5 TEST_PROG = ../interpreter/mint
6 JITTEST_PROG = ../mini/mono
8 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
9 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
11 RUNTIME_ARGS=--config tests-config --optimize=all
13 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
14 with_mono_path21 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_1
16 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
17 RUNTIME21 = $(with_mono_path21) $(top_builddir)/runtime/mono-wrapper
20 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
21 $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/mkbundle.exe
23 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
24 SMCS = $(RUNTIME21) --security=temporary-smcs-hack $(mcs_topdir)/class/lib/net_2_1/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
25 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
27 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
42 assemblyresolve_event.cs \
43 assemblyresolve_event3.cs \
75 typeload-unaligned.cs \
77 valuetype-gettype.cs \
79 static-constructor.cs \
89 invoke-string-ctors.cs \
99 array-subtype-attr.cs \
105 newobj-valuetype.cs \
119 reflection-const-field.cs \
149 appdomain-client.cs \
150 appdomain-unload.cs \
185 marshal-valuetypes.cs \
186 test-byval-in-struct.cs \
191 thread-static-init.cs \
219 delegate-async-exit.cs \
220 delegate-delegate-exit.cs \
223 finalizer-exception.cs \
226 main-returns-abort-resetabort.cs \
227 main-returns-background-abort-resetabort.cs \
228 main-returns-background-resetabort.cs \
229 main-returns-background.cs \
230 main-returns-background-change.cs \
237 transparentproxy.cs \
238 imt_big_iface_test.cs \
241 soft-float-tests.cs \
243 assemblyresolve_event2.2.cs \
248 catch-generics.2.cs \
251 stackframes-async.2.cs \
252 module-cctor-loader.2.cs \
253 generics-invoke-byref.2.cs \
254 generic-signature-compare.2.cs \
255 generics-sharing.2.cs \
256 shared-generic-methods.2.cs \
257 shared-generic-synchronized.2.cs \
258 generic-inlining.2.cs \
259 generic-initobj.2.cs \
260 recursive-generics.2.cs \
262 dynamic-method-access.2.cs \
265 ienumerator-interfaces.2.cs \
266 array-enumerator-ifaces.2.cs \
267 generic_type_definition_encoding.2.cs \
268 generic_type_definition.2.cs \
272 bug-322722_patch_bx.2.cs \
274 bug-322722_dyn_method_throw.2.cs
277 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
280 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
282 TEST_CS_SRC = $(BASE_TEST_CS_SRC)
287 TEST_CS_SRC+=async-exc-compilation.cs
292 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
297 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
301 delegate-async-exception.exe \
302 delegate-delegate-exception.exe \
303 appdomain-unload.exe \
305 $(PLATFORM_DISABLED_TESTS)
307 # These only compile with MS CSC
322 long-shift-regalloc.il \
328 static-fields-nonconst.il \
329 reload-at-bb-end.il \
330 test-enum-indstoreil.il \
337 call_missing_method.il \
338 call_missing_class.il \
339 ldfld_missing_field.il \
340 ldfld_missing_class.il \
345 ldtoken_with_byref_typespec.2.il \
346 resolve_method_bug.2.il \
347 resolve_field_bug.2.il \
348 resolve_type_bug.2.il \
349 generics-sharing-other-exc.2.il
353 # pre-requisite test sources: files that are not test themselves
354 # but that need to be compiled
355 PREREQ_IL_SRC=event-il.il module-cctor.il
357 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
360 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
361 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
362 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
363 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
364 TESTBS=$(BENCHSRC:.cs=.exe)
365 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
367 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) \
368 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
373 %.exe: %.cs TestDriver.dll
374 $(MCS) -r:TestDriver.dll -out:$@ $<
376 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
378 test: assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 test-generic-sharing
380 # Can't use mkbundle on win32 since there is no static build there
381 # Can't run test-unhandled-exception on Windows because of all the debug popups...
383 test: assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 test-generic-sharing
385 test: assemblyresolve/test/asm.dll testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 custom-modifiers test-generic-sharing
390 #test : test-coreclr-security
393 assemblyresolve/test/asm.dll:
394 $(MAKE) -C assemblyresolve prereq
397 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
399 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
402 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
403 for i in $(TESTSI_CS); do \
404 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
406 passed=`expr $${passed} + 1`; \
408 if [ $$? = 2 ]; then break; fi; \
409 failed=`expr $${failed} + 1`; \
412 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
414 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
417 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
418 for i in $(TESTSI_IL); do \
419 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
421 passed=`expr $${passed} + 1`; \
423 if [ $$? = 2 ]; then break; fi; \
424 failed=`expr $${failed} + 1`; \
427 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
429 testb: $(TEST_PROG) $(TESTBS)
430 for i in $(TESTBS); do \
431 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
434 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
438 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
440 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
442 passed=`expr $${passed} + 1`; \
444 if [ $$? = 2 ]; then break; fi; \
445 failed=`expr $${failed} + 1`; \
446 failed_tests="$${failed_tests} $$i"; \
449 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
450 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
451 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
453 testaot: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
457 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
458 for i in $(TESTSI_CS) $(TESTSI_IL) $(TESTBS); do \
460 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
461 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
463 passed=`expr $${passed} + 1`; \
465 if [ $$? = 2 ]; then break; fi; \
466 failed=`expr $${failed} + 1`; \
467 failed_tests="$${failed_tests} $$i"; \
470 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
471 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
472 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
475 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
477 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
481 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
482 for i in $(TESTSI_CS) $(TESTSI_IL); do \
483 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
485 passed=`expr $${passed} + 1`; \
487 if [ $$? = 2 ]; then break; fi; \
488 failed=`expr $${failed} + 1`; \
489 failed_tests="$${failed_tests} $$i"; \
492 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
493 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
494 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
496 testjitspeed: $(JITTEST_PROG) $(TESTBS)
497 for i in $(TESTBS); do \
499 time $(JITTEST_PROG) $$i; \
502 test-iomap-regression: exists.cs
503 $(MCS) $(srcdir)/exists.cs -out:exists.exe
504 MONO_IOMAP=all $(RUNTIME) exists.exe
506 stresstest: $(STRESS_TESTS)
510 for i in $(STRESS_TESTS); do \
511 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
513 passed=`expr $${passed} + 1`; \
515 if [ $$? = 2 ]; then break; fi; \
516 failed=`expr $${failed} + 1`; \
517 failed_tests="$${failed_tests} $$i"; \
520 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
521 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
522 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
524 testbundle: console.exe
525 $(MKBUNDLE) --static console.exe
526 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
529 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
530 test-type-load: TestDriver.dll
531 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
532 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
533 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
534 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
535 $(RUNTIME) load-exceptions.exe
537 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
538 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
539 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
540 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
541 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
542 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
543 $(RUNTIME) test-inline-call-stack.exe
546 EXTRA_DIST += unhandled-exception-base-configuration.config
547 EXTRA_DIST += unhandled-exception-legacy-configuration.config
548 EXTRA_DIST += unhandled-exception-test-case.2.cs
549 EXTRA_DIST += unhandled-exception-test-runner.2.cs
550 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
551 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
552 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
553 cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
554 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
555 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
556 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
557 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
558 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
559 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
560 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
561 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
562 $(MCS) /debug unhandled-exception-test-case.1.cs
563 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
564 $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
565 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
566 $(MCS) /debug unhandled-exception-test-case.2.cs
567 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
568 $(MCS) /debug unhandled-exception-test-case-legacy.2.cs
569 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
570 $(MCS) /debug unhandled-exception-test-runner.2.cs
572 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
573 $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
575 EXTRA_DIST += bug-80307.cs
576 bug-80307.exe: $(srcdir)/bug-80307.cs
577 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
579 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
580 test-bug-80307: bug-80307.exe
581 cd $(top_builddir)/runtime && $(MAKE) test-support-files
582 $(RUNTIME) bug-80307.exe
584 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
585 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
586 $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
587 $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
588 $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
590 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
591 $(RUNTIME) bug-81673.exe
593 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
594 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
595 $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
596 $(MCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
597 $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
598 rm -f bug-81691-a.dll
600 test-bug-81691 : bug-81691.exe bug-81691-b.dll
601 $(RUNTIME) bug-81691.exe
603 EXTRA_DIST += bug-81466.il bug-81466-lib.il
604 bug-81466-lib.dll: bug-81466-lib.il
605 $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
606 bug-81466.exe: bug-81466.il bug-81466-lib.dll
607 $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
608 test-bug-81466: bug-81466.exe bug-81466-lib.dll
609 $(RUNTIME) bug-81466.exe
611 EXTRA_DIST += bug-324535-il.il bug-324535.cs
612 bug-324535-il.dll : bug-324535-il.il
613 $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
614 bug-324535.exe : bug-324535.cs bug-324535-il.dll
615 $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
616 test-bug-324535 : bug-324535.exe bug-324535-il.dll
617 $(RUNTIME) bug-324535.exe
619 EXTRA_DIST += make_imt_test.sh
620 imt_big_iface_test.cs: $(srcdir)/make_imt_test.sh
621 $(srcdir)/make_imt_test.sh > imt_big_iface_test.cs
623 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
624 custom-modifiers-lib.dll: custom-modifiers-lib.il
625 $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
626 custom-modifiers.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
627 $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.exe $(srcdir)/custom-modifiers.2.cs
628 custom-modifiers: custom-modifiers.exe
629 $(RUNTIME) custom-modifiers.exe
631 EXTRA_DIST += coreclr-security.cs
634 coreclr-security.exe : coreclr-security.cs
635 $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
637 test-coreclr-security : coreclr-security.exe
638 $(RUNTIME21) --security=core-clr-test coreclr-security.exe
641 test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe shared-generic-synchronized.2.exe generic-initobj.2.exe generics-sharing-other-exc.2.exe
642 $(RUNTIME) -O=gshared generics-sharing.2.exe
643 $(RUNTIME) -O=gshared,-inline shared-generic-methods.2.exe
644 $(RUNTIME) -O=gshared shared-generic-synchronized.2.exe
645 $(RUNTIME) -O=gshared,-inline generic-initobj.2.exe
646 $(RUNTIME) -O=gshared,-inline generics-sharing-other-exc.2.exe
648 EXTRA_DIST += async-exceptions.cs
649 async-exceptions.exe : async-exceptions.cs
650 $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
651 test-async-exceptions : async-exceptions.exe
652 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
653 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
655 # Useful if mono is compiled with --enable-shared=no
658 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
659 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
662 noinst_LTLIBRARIES = libtest.la
664 INCLUDES = $(GLIB_CFLAGS)
667 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
668 # This shows up when compiling mono_test_marshal_delegate ()
669 libtest_la_CFLAGS=-fno-optimize-sibling-calls
670 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
671 # can't find them. So we use --kill-at to remove the @ suffix as well.
672 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
674 libtest_la_LDFLAGS = -rpath `pwd`
676 libtest_la_SOURCES = libtest.c
677 libtest_la_LIBADD = $(GLIB_LIBS)
679 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat