5 TEST_PROG = ../interpreter/mint
6 JITTEST_PROG = ../mini/mono
8 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
9 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(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 \
117 reflection-const-field.cs \
146 appdomain-client.cs \
147 appdomain-unload.cs \
183 test-byval-in-struct.cs \
188 thread-static-init.cs \
212 delegate-async-exit.cs \
213 delegate-delegate-exit.cs \
216 finalizer-exception.cs \
219 main-returns-abort-resetabort.cs \
220 main-returns-background-abort-resetabort.cs \
221 main-returns-background-resetabort.cs \
222 main-returns-background.cs \
223 main-returns-background-change.cs \
232 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
237 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
241 delegate-async-exception.exe \
242 delegate-delegate-exception.exe \
243 appdomain-unload.exe \
244 $(PLATFORM_DISABLED_TESTS)
246 # These only compile with MS CSC
258 long-shift-regalloc.il \
264 static-fields-nonconst.il \
265 reload-at-bb-end.il \
266 test-enum-indstoreil.il \
275 catch-generics.2.cs \
278 module-cctor-loader.2.cs \
281 TEST_IL2_SRC = find-method.2.il \
285 # pre-requisite test sources: files that are not test themselves
286 # but that need to be compiled
287 PREREQ_IL_SRC=event-il.il module-cctor.il
290 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
291 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
292 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
293 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
294 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
295 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
296 TESTBS=$(BENCHSRC:.cs=.exe)
297 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
299 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
300 $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
308 %.exe: %.2.cs TestDriver.dll
309 $(GMCS) -r:TestDriver.dll -out:$@ $<
311 %.exe: %.cs TestDriver.dll
312 $(MCS) -r:TestDriver.dll -out:$@ $<
314 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
316 test: testjit test-type-load test-inline-call-stack test-bug-80307
318 # Can't use mkbundle on win32 since there is no static build there
320 test: testjit test-type-load test-inline-call-stack test-bug-80307
322 test: testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307
327 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
329 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
332 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
333 for i in $(TESTSI_CS); do \
334 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
336 passed=`expr $${passed} + 1`; \
338 if [ $$? = 2 ]; then break; fi; \
339 failed=`expr $${failed} + 1`; \
342 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
344 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
347 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
348 for i in $(TESTSI_IL); do \
349 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
351 passed=`expr $${passed} + 1`; \
353 if [ $$? = 2 ]; then break; fi; \
354 failed=`expr $${failed} + 1`; \
357 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
359 testb: $(TEST_PROG) $(TESTBS)
360 for i in $(TESTBS); do \
361 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
364 testjit: testjit-default testjit-net_2_0
366 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
370 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
372 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
374 passed=`expr $${passed} + 1`; \
376 if [ $$? = 2 ]; then break; fi; \
377 failed=`expr $${failed} + 1`; \
378 failed_tests="$${failed_tests} $$i"; \
381 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
382 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
383 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
385 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
389 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
391 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
393 passed=`expr $${passed} + 1`; \
395 if [ $$? = 2 ]; then break; fi; \
396 failed=`expr $${failed} + 1`; \
397 failed_tests="$${failed_tests} $$i"; \
400 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
401 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
402 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
404 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
408 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
409 for i in $(TESTSI_CS) $(TESTBS); do \
411 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
412 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
414 passed=`expr $${passed} + 1`; \
416 if [ $$? = 2 ]; then break; fi; \
417 failed=`expr $${failed} + 1`; \
418 failed_tests="$${failed_tests} $$i"; \
421 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
422 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
423 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
426 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
428 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
432 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
433 for i in $(TESTSI_CS) $(TESTSI_IL); do \
434 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
436 passed=`expr $${passed} + 1`; \
438 if [ $$? = 2 ]; then break; fi; \
439 failed=`expr $${failed} + 1`; \
440 failed_tests="$${failed_tests} $$i"; \
443 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
444 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
445 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
447 testjitspeed: $(JITTEST_PROG) $(TESTBS)
448 for i in $(TESTBS); do \
450 time $(JITTEST_PROG) $$i; \
453 test-iomap-regression: exists.cs
454 $(MCS) $(srcdir)/exists.cs -out:exists.exe
455 MONO_IOMAP=all $(RUNTIME) exists.exe
457 stresstest: $(STRESS_TESTS)
461 for i in $(STRESS_TESTS); do \
462 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
464 passed=`expr $${passed} + 1`; \
466 if [ $$? = 2 ]; then break; fi; \
467 failed=`expr $${failed} + 1`; \
468 failed_tests="$${failed_tests} $$i"; \
471 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
472 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
473 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
475 testbundle: console.exe
476 $(MKBUNDLE) --static console.exe
477 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
480 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
481 test-type-load: TestDriver.dll
482 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
483 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
484 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
485 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
486 $(RUNTIME) load-exceptions.exe
488 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
489 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
490 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
491 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
492 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
493 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
494 $(RUNTIME) test-inline-call-stack.exe
496 EXTRA_DIST += bug-80307.cs
497 bug-80307.exe: $(srcdir)/bug-80307.cs
498 $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
499 test-bug-80307: bug-80307.exe
500 $(RUNTIME) bug-80307.exe
502 # Useful if mono is compiled with --enable-shared=no
505 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
506 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
509 noinst_LTLIBRARIES = libtest.la
511 INCLUDES = $(GLIB_CFLAGS)
514 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
515 # This shows up when compiling mono_test_marshal_delegate ()
516 libtest_la_CFLAGS=-fno-optimize-sibling-calls
517 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
518 # can't find them. So we use --kill-at to remove the @ suffix as well.
519 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
521 libtest_la_LDFLAGS = -rpath `pwd`
523 libtest_la_SOURCES = libtest.c
524 libtest_la_LIBADD = $(GLIB_LIBS)
526 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat