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/default
14 with_mono_path2 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
15 with_mono_path21 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_1
17 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
18 RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper
19 RUNTIME21 = $(with_mono_path21) $(top_builddir)/runtime/mono-wrapper
22 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
23 $(RUNTIME) $(mcs_topdir)/class/lib/default/mkbundle.exe
25 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
26 GMCS = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
27 SMCS = $(RUNTIME21) $(mcs_topdir)/class/lib/net_2_1/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
28 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
29 ILASM2 = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
31 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
46 assemblyresolve_event.cs \
47 assemblyresolve_event3.cs \
79 typeload-unaligned.cs \
81 valuetype-gettype.cs \
83 static-constructor.cs \
93 invoke-string-ctors.cs \
101 assignable-tests.cs \
103 array-subtype-attr.cs \
109 newobj-valuetype.cs \
123 reflection-const-field.cs \
152 appdomain-client.cs \
153 appdomain-unload.cs \
189 test-byval-in-struct.cs \
194 thread-static-init.cs \
221 delegate-async-exit.cs \
222 delegate-delegate-exit.cs \
225 finalizer-exception.cs \
228 main-returns-abort-resetabort.cs \
229 main-returns-background-abort-resetabort.cs \
230 main-returns-background-resetabort.cs \
231 main-returns-background.cs \
232 main-returns-background-change.cs \
243 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
248 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
252 delegate-async-exception.exe \
253 delegate-delegate-exception.exe \
254 appdomain-unload.exe \
255 $(PLATFORM_DISABLED_TESTS)
257 # These only compile with MS CSC
272 long-shift-regalloc.il \
278 static-fields-nonconst.il \
279 reload-at-bb-end.il \
280 test-enum-indstoreil.il \
288 assemblyresolve_event2.2.cs \
293 catch-generics.2.cs \
296 stackframes-async.2.cs \
297 module-cctor-loader.2.cs \
298 generics-invoke-byref.2.cs \
299 generic-signature-compare.2.cs \
300 generics-sharing.2.cs \
302 dynamic-method-access.2.cs \
305 ienumerator-interfaces.2.cs \
306 generic_type_definition_encoding.2.cs \
307 generic_type_definition.2.cs \
311 TEST_IL2_SRC = find-method.2.il \
315 ldtoken_with_byref_typespec.2.il
317 # pre-requisite test sources: files that are not test themselves
318 # but that need to be compiled
319 PREREQ_IL_SRC=event-il.il module-cctor.il
321 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
324 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
325 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
326 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
327 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
328 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
329 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
330 TESTBS=$(BENCHSRC:.cs=.exe)
331 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
333 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
334 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
342 %.exe: %.2.cs TestDriver.dll
343 $(GMCS) -r:TestDriver.dll -out:$@ $<
345 %.exe: %.cs TestDriver.dll
346 $(MCS) -r:TestDriver.dll -out:$@ $<
348 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
350 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
352 # Can't use mkbundle on win32 since there is no static build there
353 # Can't run test-unhandled-exception on Windows because of all the debug popups...
355 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
357 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
362 test : test-coreclr-security
365 assemblyresolve/test/asm.dll:
366 $(MAKE) -C assemblyresolve prereq
369 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
371 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
374 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
375 for i in $(TESTSI_CS); do \
376 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
378 passed=`expr $${passed} + 1`; \
380 if [ $$? = 2 ]; then break; fi; \
381 failed=`expr $${failed} + 1`; \
384 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
386 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
389 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
390 for i in $(TESTSI_IL); do \
391 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
393 passed=`expr $${passed} + 1`; \
395 if [ $$? = 2 ]; then break; fi; \
396 failed=`expr $${failed} + 1`; \
399 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
401 testb: $(TEST_PROG) $(TESTBS)
402 for i in $(TESTBS); do \
403 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
406 testjit: testjit-default testjit-net_2_0
408 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
412 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
414 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
416 passed=`expr $${passed} + 1`; \
418 if [ $$? = 2 ]; then break; fi; \
419 failed=`expr $${failed} + 1`; \
420 failed_tests="$${failed_tests} $$i"; \
423 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
424 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
425 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
427 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
431 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
433 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
435 passed=`expr $${passed} + 1`; \
437 if [ $$? = 2 ]; then break; fi; \
438 failed=`expr $${failed} + 1`; \
439 failed_tests="$${failed_tests} $$i"; \
442 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
443 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
444 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
446 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
450 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
451 for i in $(TESTSI_CS) $(TESTBS); do \
453 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
454 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
456 passed=`expr $${passed} + 1`; \
458 if [ $$? = 2 ]; then break; fi; \
459 failed=`expr $${failed} + 1`; \
460 failed_tests="$${failed_tests} $$i"; \
463 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
464 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
465 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
468 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
470 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
474 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
475 for i in $(TESTSI_CS) $(TESTSI_IL); do \
476 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
478 passed=`expr $${passed} + 1`; \
480 if [ $$? = 2 ]; then break; fi; \
481 failed=`expr $${failed} + 1`; \
482 failed_tests="$${failed_tests} $$i"; \
485 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
486 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
487 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
489 testjitspeed: $(JITTEST_PROG) $(TESTBS)
490 for i in $(TESTBS); do \
492 time $(JITTEST_PROG) $$i; \
495 test-iomap-regression: exists.cs
496 $(MCS) $(srcdir)/exists.cs -out:exists.exe
497 MONO_IOMAP=all $(RUNTIME) exists.exe
499 stresstest: $(STRESS_TESTS)
503 for i in $(STRESS_TESTS); do \
504 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
506 passed=`expr $${passed} + 1`; \
508 if [ $$? = 2 ]; then break; fi; \
509 failed=`expr $${failed} + 1`; \
510 failed_tests="$${failed_tests} $$i"; \
513 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
514 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
515 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
517 testbundle: console.exe
518 $(MKBUNDLE) --static console.exe
519 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
522 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
523 test-type-load: TestDriver.dll
524 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
525 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
526 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
527 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
528 $(RUNTIME) load-exceptions.exe
530 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
531 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
532 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
533 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
534 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
535 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
536 $(RUNTIME) test-inline-call-stack.exe
539 EXTRA_DIST += unhandled-exception-base-configuration.config
540 EXTRA_DIST += unhandled-exception-legacy-configuration.config
541 EXTRA_DIST += unhandled-exception-test-case.2.cs
542 EXTRA_DIST += unhandled-exception-test-runner.2.cs
543 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
544 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
545 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
546 cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
547 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
548 cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
549 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
550 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
551 cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
552 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
553 cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
554 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
555 $(MCS) /debug unhandled-exception-test-case.1.cs
556 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
557 $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
558 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
559 $(GMCS) /debug unhandled-exception-test-case.2.cs
560 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
561 $(GMCS) /debug unhandled-exception-test-case-legacy.2.cs
562 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
563 $(GMCS) /debug unhandled-exception-test-runner.2.cs
565 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
566 $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
568 EXTRA_DIST += bug-80307.cs
569 bug-80307.exe: $(srcdir)/bug-80307.cs
570 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
572 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
573 test-bug-80307: bug-80307.exe
574 cd $(top_builddir)/runtime && $(MAKE) test-support-files
575 $(RUNTIME) bug-80307.exe
577 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
578 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
579 $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
580 $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
581 $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
583 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
584 $(RUNTIME) bug-81673.exe
586 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
587 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
588 $(GMCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
589 $(GMCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
590 $(GMCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
591 rm -f bug-81691-a.dll
593 test-bug-81691 : bug-81691.exe bug-81691-b.dll
594 $(RUNTIME) bug-81691.exe
596 EXTRA_DIST += bug-81466.il bug-81466-lib.il
597 bug-81466-lib.dll: bug-81466-lib.il
598 $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
599 bug-81466.exe: bug-81466.il bug-81466-lib.dll
600 $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
601 test-bug-81466: bug-81466.exe bug-81466-lib.dll
602 $(RUNTIME) bug-81466.exe
604 EXTRA_DIST += coreclr-security.cs
607 coreclr-security.exe : coreclr-security.cs
608 $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
610 test-coreclr-security : coreclr-security.exe
611 $(RUNTIME21) --security=core-clr-test coreclr-security.exe
614 EXTRA_DIST += async-exceptions.cs
615 async-exceptions.exe : async-exceptions.cs
616 $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
617 test-async-exceptions : async-exceptions.exe
618 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
619 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
621 # Useful if mono is compiled with --enable-shared=no
624 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
625 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
628 noinst_LTLIBRARIES = libtest.la
630 INCLUDES = $(GLIB_CFLAGS)
633 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
634 # This shows up when compiling mono_test_marshal_delegate ()
635 libtest_la_CFLAGS=-fno-optimize-sibling-calls
636 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
637 # can't find them. So we use --kill-at to remove the @ suffix as well.
638 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
640 libtest_la_LDFLAGS = -rpath `pwd`
642 libtest_la_SOURCES = libtest.c
643 libtest_la_LIBADD = $(GLIB_LIBS)
645 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat