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 test: testjit testbundle test-type-load test-inline-call-stack
294 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
296 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
299 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
300 for i in $(TESTSI_CS); do \
301 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
303 passed=`expr $${passed} + 1`; \
305 if [ $$? = 2 ]; then break; fi; \
306 failed=`expr $${failed} + 1`; \
309 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
311 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
314 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
315 for i in $(TESTSI_IL); do \
316 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
318 passed=`expr $${passed} + 1`; \
320 if [ $$? = 2 ]; then break; fi; \
321 failed=`expr $${failed} + 1`; \
324 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
326 testb: $(TEST_PROG) $(TESTBS)
327 for i in $(TESTBS); do \
328 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
331 testjit: testjit-default testjit-net_2_0
333 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
337 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
339 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
341 passed=`expr $${passed} + 1`; \
343 if [ $$? = 2 ]; then break; fi; \
344 failed=`expr $${failed} + 1`; \
345 failed_tests="$${failed_tests} $$i"; \
348 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
349 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
350 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
352 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
356 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
358 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
360 passed=`expr $${passed} + 1`; \
362 if [ $$? = 2 ]; then break; fi; \
363 failed=`expr $${failed} + 1`; \
364 failed_tests="$${failed_tests} $$i"; \
367 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
368 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
369 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
371 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
375 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
376 for i in $(TESTSI_CS) $(TESTBS); do \
378 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
379 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
381 passed=`expr $${passed} + 1`; \
383 if [ $$? = 2 ]; then break; fi; \
384 failed=`expr $${failed} + 1`; \
385 failed_tests="$${failed_tests} $$i"; \
388 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
389 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
390 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
393 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
395 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
399 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
400 for i in $(TESTSI_CS) $(TESTSI_IL); do \
401 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
403 passed=`expr $${passed} + 1`; \
405 if [ $$? = 2 ]; then break; fi; \
406 failed=`expr $${failed} + 1`; \
407 failed_tests="$${failed_tests} $$i"; \
410 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
411 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
412 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
414 testjitspeed: $(JITTEST_PROG) $(TESTBS)
415 for i in $(TESTBS); do \
417 time $(JITTEST_PROG) $$i; \
420 stresstest: $(STRESS_TESTS)
424 for i in $(STRESS_TESTS); do \
425 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
427 passed=`expr $${passed} + 1`; \
429 if [ $$? = 2 ]; then break; fi; \
430 failed=`expr $${failed} + 1`; \
431 failed_tests="$${failed_tests} $$i"; \
434 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
435 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
436 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
438 testbundle: console.exe
439 $(MKBUNDLE) --static console.exe
440 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
443 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
444 test-type-load: TestDriver.dll
445 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
446 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
447 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
448 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
449 $(RUNTIME) load-exceptions.exe
451 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
452 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
453 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
454 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
455 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
456 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
457 $(RUNTIME) test-inline-call-stack.exe
459 # Useful if mono is compiled with --enable-shared=no
462 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
463 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
466 noinst_LTLIBRARIES = libtest.la
468 INCLUDES = $(GLIB_CFLAGS)
471 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
472 # This shows up when compiling mono_test_marshal_delegate ()
473 libtest_la_CFLAGS=-fno-optimize-sibling-calls
474 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
475 # can't find them. So we use --kill-at to remove the @ suffix as well.
476 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
478 libtest_la_LDFLAGS = -rpath `pwd`
480 libtest_la_SOURCES = libtest.c
481 libtest_la_LIBADD = $(GLIB_LIBS)
483 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat