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
16 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
17 RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper
20 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
21 $(RUNTIME) $(mcs_topdir)/class/lib/default/mkbundle.exe
23 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
24 GMCS = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
25 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
26 ILASM2 = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
28 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
74 typeload-unaligned.cs \
76 valuetype-gettype.cs \
78 static-constructor.cs \
88 invoke-string-ctors.cs \
98 array-subtype-attr.cs \
104 newobj-valuetype.cs \
118 reflection-const-field.cs \
147 appdomain-client.cs \
148 appdomain-unload.cs \
184 test-byval-in-struct.cs \
189 thread-static-init.cs \
214 delegate-async-exit.cs \
215 delegate-delegate-exit.cs \
218 finalizer-exception.cs \
221 main-returns-abort-resetabort.cs \
222 main-returns-background-abort-resetabort.cs \
223 main-returns-background-resetabort.cs \
224 main-returns-background.cs \
225 main-returns-background-change.cs \
235 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
240 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
244 delegate-async-exception.exe \
245 delegate-delegate-exception.exe \
246 appdomain-unload.exe \
247 $(PLATFORM_DISABLED_TESTS)
249 # These only compile with MS CSC
261 long-shift-regalloc.il \
267 static-fields-nonconst.il \
268 reload-at-bb-end.il \
269 test-enum-indstoreil.il \
278 catch-generics.2.cs \
281 stackframes-async.2.cs \
282 module-cctor-loader.2.cs \
285 TEST_IL2_SRC = find-method.2.il \
289 # pre-requisite test sources: files that are not test themselves
290 # but that need to be compiled
291 PREREQ_IL_SRC=event-il.il module-cctor.il
294 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
295 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
296 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
297 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
298 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
299 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
300 TESTBS=$(BENCHSRC:.cs=.exe)
301 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
303 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
304 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
312 %.exe: %.2.cs TestDriver.dll
313 $(GMCS) -r:TestDriver.dll -out:$@ $<
315 %.exe: %.cs TestDriver.dll
316 $(MCS) -r:TestDriver.dll -out:$@ $<
318 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
320 test: testjit test-type-load test-inline-call-stack test-bug-80307
322 # Can't use mkbundle on win32 since there is no static build there
324 test: testjit test-type-load test-inline-call-stack test-bug-80307
326 test: testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307
331 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
333 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
336 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
337 for i in $(TESTSI_CS); do \
338 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
340 passed=`expr $${passed} + 1`; \
342 if [ $$? = 2 ]; then break; fi; \
343 failed=`expr $${failed} + 1`; \
346 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
348 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
351 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
352 for i in $(TESTSI_IL); do \
353 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
355 passed=`expr $${passed} + 1`; \
357 if [ $$? = 2 ]; then break; fi; \
358 failed=`expr $${failed} + 1`; \
361 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
363 testb: $(TEST_PROG) $(TESTBS)
364 for i in $(TESTBS); do \
365 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
368 testjit: testjit-default testjit-net_2_0
370 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
374 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
376 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
378 passed=`expr $${passed} + 1`; \
380 if [ $$? = 2 ]; then break; fi; \
381 failed=`expr $${failed} + 1`; \
382 failed_tests="$${failed_tests} $$i"; \
385 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
386 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
387 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
389 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
393 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
395 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
397 passed=`expr $${passed} + 1`; \
399 if [ $$? = 2 ]; then break; fi; \
400 failed=`expr $${failed} + 1`; \
401 failed_tests="$${failed_tests} $$i"; \
404 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
405 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
406 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
408 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
412 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
413 for i in $(TESTSI_CS) $(TESTBS); do \
415 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
416 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
418 passed=`expr $${passed} + 1`; \
420 if [ $$? = 2 ]; then break; fi; \
421 failed=`expr $${failed} + 1`; \
422 failed_tests="$${failed_tests} $$i"; \
425 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
426 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
427 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
430 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
432 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
436 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
437 for i in $(TESTSI_CS) $(TESTSI_IL); do \
438 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
440 passed=`expr $${passed} + 1`; \
442 if [ $$? = 2 ]; then break; fi; \
443 failed=`expr $${failed} + 1`; \
444 failed_tests="$${failed_tests} $$i"; \
447 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
448 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
449 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
451 testjitspeed: $(JITTEST_PROG) $(TESTBS)
452 for i in $(TESTBS); do \
454 time $(JITTEST_PROG) $$i; \
457 test-iomap-regression: exists.cs
458 $(MCS) $(srcdir)/exists.cs -out:exists.exe
459 MONO_IOMAP=all $(RUNTIME) exists.exe
461 stresstest: $(STRESS_TESTS)
465 for i in $(STRESS_TESTS); do \
466 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
468 passed=`expr $${passed} + 1`; \
470 if [ $$? = 2 ]; then break; fi; \
471 failed=`expr $${failed} + 1`; \
472 failed_tests="$${failed_tests} $$i"; \
475 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
476 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
477 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
479 testbundle: console.exe
480 $(MKBUNDLE) --static console.exe
481 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
484 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
485 test-type-load: TestDriver.dll
486 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
487 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
488 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
489 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
490 $(RUNTIME) load-exceptions.exe
492 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
493 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
494 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
495 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
496 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
497 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
498 $(RUNTIME) test-inline-call-stack.exe
500 EXTRA_DIST += bug-80307.cs
501 bug-80307.exe: $(srcdir)/bug-80307.cs
502 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
504 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
505 test-bug-80307: bug-80307.exe
506 cd $(top_builddir)/runtime && $(MAKE) test-support-files
507 $(RUNTIME) bug-80307.exe
509 # Useful if mono is compiled with --enable-shared=no
512 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
513 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
516 noinst_LTLIBRARIES = libtest.la
518 INCLUDES = $(GLIB_CFLAGS)
521 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
522 # This shows up when compiling mono_test_marshal_delegate ()
523 libtest_la_CFLAGS=-fno-optimize-sibling-calls
524 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
525 # can't find them. So we use --kill-at to remove the @ suffix as well.
526 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
528 libtest_la_LDFLAGS = -rpath `pwd`
530 libtest_la_SOURCES = libtest.c
531 libtest_la_LIBADD = $(GLIB_LIBS)
533 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat