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
77 typeload-unaligned.cs \
79 valuetype-gettype.cs \
81 static-constructor.cs \
91 invoke-string-ctors.cs \
101 array-subtype-attr.cs \
107 newobj-valuetype.cs \
121 reflection-const-field.cs \
150 appdomain-client.cs \
151 appdomain-unload.cs \
187 test-byval-in-struct.cs \
192 thread-static-init.cs \
218 delegate-async-exit.cs \
219 delegate-delegate-exit.cs \
222 finalizer-exception.cs \
225 main-returns-abort-resetabort.cs \
226 main-returns-background-abort-resetabort.cs \
227 main-returns-background-resetabort.cs \
228 main-returns-background.cs \
229 main-returns-background-change.cs \
240 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
245 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
249 delegate-async-exception.exe \
250 delegate-delegate-exception.exe \
251 appdomain-unload.exe \
252 $(PLATFORM_DISABLED_TESTS)
254 # These only compile with MS CSC
269 long-shift-regalloc.il \
275 static-fields-nonconst.il \
276 reload-at-bb-end.il \
277 test-enum-indstoreil.il \
288 catch-generics.2.cs \
291 stackframes-async.2.cs \
292 module-cctor-loader.2.cs \
293 generics-invoke-byref.2.cs \
294 generic-signature-compare.2.cs \
298 TEST_IL2_SRC = find-method.2.il \
301 ldtoken_with_byref_typespec.2.il
303 # pre-requisite test sources: files that are not test themselves
304 # but that need to be compiled
305 PREREQ_IL_SRC=event-il.il module-cctor.il
307 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
310 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
311 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
312 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
313 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
314 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
315 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
316 TESTBS=$(BENCHSRC:.cs=.exe)
317 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
319 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
320 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
328 %.exe: %.2.cs TestDriver.dll
329 $(GMCS) -r:TestDriver.dll -out:$@ $<
331 %.exe: %.cs TestDriver.dll
332 $(MCS) -r:TestDriver.dll -out:$@ $<
334 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
336 test: testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
338 # Can't use mkbundle on win32 since there is no static build there
340 test: testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
342 test: testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
347 test : test-coreclr-security
351 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
353 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
356 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
357 for i in $(TESTSI_CS); do \
358 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
360 passed=`expr $${passed} + 1`; \
362 if [ $$? = 2 ]; then break; fi; \
363 failed=`expr $${failed} + 1`; \
366 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
368 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
371 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
372 for i in $(TESTSI_IL); do \
373 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
375 passed=`expr $${passed} + 1`; \
377 if [ $$? = 2 ]; then break; fi; \
378 failed=`expr $${failed} + 1`; \
381 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
383 testb: $(TEST_PROG) $(TESTBS)
384 for i in $(TESTBS); do \
385 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
388 testjit: testjit-default testjit-net_2_0
390 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
394 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
396 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
398 passed=`expr $${passed} + 1`; \
400 if [ $$? = 2 ]; then break; fi; \
401 failed=`expr $${failed} + 1`; \
402 failed_tests="$${failed_tests} $$i"; \
405 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
406 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
407 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
409 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
413 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
415 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
417 passed=`expr $${passed} + 1`; \
419 if [ $$? = 2 ]; then break; fi; \
420 failed=`expr $${failed} + 1`; \
421 failed_tests="$${failed_tests} $$i"; \
424 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
425 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
426 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
428 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
432 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
433 for i in $(TESTSI_CS) $(TESTBS); do \
435 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
436 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
438 passed=`expr $${passed} + 1`; \
440 if [ $$? = 2 ]; then break; fi; \
441 failed=`expr $${failed} + 1`; \
442 failed_tests="$${failed_tests} $$i"; \
445 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
446 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
447 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
450 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
452 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
456 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
457 for i in $(TESTSI_CS) $(TESTSI_IL); do \
458 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
460 passed=`expr $${passed} + 1`; \
462 if [ $$? = 2 ]; then break; fi; \
463 failed=`expr $${failed} + 1`; \
464 failed_tests="$${failed_tests} $$i"; \
467 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
468 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
469 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
471 testjitspeed: $(JITTEST_PROG) $(TESTBS)
472 for i in $(TESTBS); do \
474 time $(JITTEST_PROG) $$i; \
477 test-iomap-regression: exists.cs
478 $(MCS) $(srcdir)/exists.cs -out:exists.exe
479 MONO_IOMAP=all $(RUNTIME) exists.exe
481 stresstest: $(STRESS_TESTS)
485 for i in $(STRESS_TESTS); do \
486 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
488 passed=`expr $${passed} + 1`; \
490 if [ $$? = 2 ]; then break; fi; \
491 failed=`expr $${failed} + 1`; \
492 failed_tests="$${failed_tests} $$i"; \
495 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
496 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
497 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
499 testbundle: console.exe
500 $(MKBUNDLE) --static console.exe
501 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
504 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
505 test-type-load: TestDriver.dll
506 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
507 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
508 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
509 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
510 $(RUNTIME) load-exceptions.exe
512 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
513 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
514 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
515 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
516 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
517 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
518 $(RUNTIME) test-inline-call-stack.exe
520 EXTRA_DIST += bug-80307.cs
521 bug-80307.exe: $(srcdir)/bug-80307.cs
522 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
524 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
525 test-bug-80307: bug-80307.exe
526 cd $(top_builddir)/runtime && $(MAKE) test-support-files
527 $(RUNTIME) bug-80307.exe
529 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
530 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
531 $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
532 $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
533 $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
535 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
536 $(RUNTIME) bug-81673.exe
538 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
539 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
540 $(GMCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
541 $(GMCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
542 $(GMCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
543 rm -f bug-81691-a.dll
545 test-bug-81691 : bug-81691.exe bug-81691-b.dll
546 $(RUNTIME) bug-81691.exe
548 EXTRA_DIST += bug-81466.il bug-81466-lib.il
549 bug-81466-lib.dll: bug-81466-lib.il
550 $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
551 bug-81466.exe: bug-81466.il bug-81466-lib.dll
552 $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
553 test-bug-81466: bug-81466.exe bug-81466-lib.dll
554 $(RUNTIME) bug-81466.exe
557 EXTRA_DIST += coreclr-security.cs
558 coreclr-security.exe : coreclr-security.cs
559 $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
561 test-coreclr-security : coreclr-security.exe
562 $(RUNTIME21) --security=core-clr-test coreclr-security.exe
565 # Useful if mono is compiled with --enable-shared=no
568 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
569 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
572 noinst_LTLIBRARIES = libtest.la
574 INCLUDES = $(GLIB_CFLAGS)
577 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
578 # This shows up when compiling mono_test_marshal_delegate ()
579 libtest_la_CFLAGS=-fno-optimize-sibling-calls
580 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
581 # can't find them. So we use --kill-at to remove the @ suffix as well.
582 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
584 libtest_la_LDFLAGS = -rpath `pwd`
586 libtest_la_SOURCES = libtest.c
587 libtest_la_LIBADD = $(GLIB_LIBS)
589 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat