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)/tools/mkbundle/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
73 valuetype-gettype.cs \
75 static-constructor.cs \
85 invoke-string-ctors.cs \
100 newobj-valuetype.cs \
113 reflection-const-field.cs \
142 appdomain-client.cs \
143 appdomain-unload.cs \
179 test-byval-in-struct.cs \
184 thread-static-init.cs \
208 delegate-async-exit.cs \
209 delegate-delegate-exit.cs \
212 finalizer-exception.cs \
215 main-returns-abort-resetabort.cs \
216 main-returns-background-abort-resetabort.cs \
217 main-returns-background-resetabort.cs \
218 main-returns-background.cs \
219 main-returns-background-change.cs \
227 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
232 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
236 delegate-async-exception.exe \
237 delegate-delegate-exception.exe \
238 appdomain-unload.exe \
239 $(PLATFORM_DISABLED_TESTS)
241 # These only compile with MS CSC
257 static-fields-nonconst.il \
258 reload-at-bb-end.il \
259 test-enum-indstoreil.il \
262 TEST_CS2_SRC = interlocked-2.2.cs pinvoke-2.2.cs
263 TEST_IL2_SRC = find-method.2.il
265 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
266 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
267 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
268 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
269 TESTBS=$(BENCHSRC:.cs=.exe)
270 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
272 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
280 %.exe: %.2.cs TestDriver.dll
281 $(GMCS) -r:TestDriver.dll -out:$@ $<
283 %.exe: %.cs TestDriver.dll
284 $(MCS) -r:TestDriver.dll -out:$@ $<
286 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
288 test: testjit test-type-load test-inline-call-stack
290 # Can't use mkbundle on win32 since there is no static build there
292 test: testjit test-type-load test-inline-call-stack
294 test: testjit testbundle test-type-load test-inline-call-stack
299 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
301 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
304 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
305 for i in $(TESTSI_CS); do \
306 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
308 passed=`expr $${passed} + 1`; \
310 if [ $$? = 2 ]; then break; fi; \
311 failed=`expr $${failed} + 1`; \
314 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
316 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
319 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
320 for i in $(TESTSI_IL); do \
321 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
323 passed=`expr $${passed} + 1`; \
325 if [ $$? = 2 ]; then break; fi; \
326 failed=`expr $${failed} + 1`; \
329 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
331 testb: $(TEST_PROG) $(TESTBS)
332 for i in $(TESTBS); do \
333 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
336 testjit: testjit-default testjit-net_2_0
338 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
342 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
344 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
346 passed=`expr $${passed} + 1`; \
348 if [ $$? = 2 ]; then break; fi; \
349 failed=`expr $${failed} + 1`; \
350 failed_tests="$${failed_tests} $$i"; \
353 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
354 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
355 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
357 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
361 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
363 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
365 passed=`expr $${passed} + 1`; \
367 if [ $$? = 2 ]; then break; fi; \
368 failed=`expr $${failed} + 1`; \
369 failed_tests="$${failed_tests} $$i"; \
372 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
373 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
374 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
376 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
380 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
381 for i in $(TESTSI_CS) $(TESTBS); do \
383 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
384 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
386 passed=`expr $${passed} + 1`; \
388 if [ $$? = 2 ]; then break; fi; \
389 failed=`expr $${failed} + 1`; \
390 failed_tests="$${failed_tests} $$i"; \
393 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
394 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
395 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
398 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
400 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
404 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
405 for i in $(TESTSI_CS) $(TESTSI_IL); do \
406 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
408 passed=`expr $${passed} + 1`; \
410 if [ $$? = 2 ]; then break; fi; \
411 failed=`expr $${failed} + 1`; \
412 failed_tests="$${failed_tests} $$i"; \
415 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
416 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
417 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
419 testjitspeed: $(JITTEST_PROG) $(TESTBS)
420 for i in $(TESTBS); do \
422 time $(JITTEST_PROG) $$i; \
425 stresstest: $(STRESS_TESTS)
429 for i in $(STRESS_TESTS); do \
430 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
432 passed=`expr $${passed} + 1`; \
434 if [ $$? = 2 ]; then break; fi; \
435 failed=`expr $${failed} + 1`; \
436 failed_tests="$${failed_tests} $$i"; \
439 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
440 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
441 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
443 testbundle: console.exe
444 $(MKBUNDLE) --static console.exe
445 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
448 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
449 test-type-load: TestDriver.dll
450 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
451 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
452 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
453 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
454 $(RUNTIME) load-exceptions.exe
456 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
457 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
458 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
459 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
460 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
461 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
462 $(RUNTIME) test-inline-call-stack.exe
464 # Useful if mono is compiled with --enable-shared=no
467 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
468 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
471 noinst_LTLIBRARIES = libtest.la
473 INCLUDES = $(GLIB_CFLAGS)
476 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
477 # This shows up when compiling mono_test_marshal_delegate ()
478 libtest_la_CFLAGS=-fno-optimize-sibling-calls
479 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
480 # can't find them. So we use --kill-at to remove the @ suffix as well.
481 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
483 libtest_la_LDFLAGS = -rpath `pwd`
485 libtest_la_SOURCES = libtest.c
486 libtest_la_LIBADD = $(GLIB_LIBS)
488 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat