3 TEST_PROG = ../interpreter/mint
4 JITTEST_PROG = ../mini/mono
6 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
7 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(JITTEST_PROG)
9 RUNTIME_ARGS=--config tests-config --optimize=all
11 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/default
12 with_mono_path2 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
14 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
15 RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper
18 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
19 $(RUNTIME) $(mcs_topdir)/tools/mkbundle/mkbundle.exe
21 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
22 GMCS = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
23 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
24 ILASM2 = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
26 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
71 valuetype-gettype.cs \
73 static-constructor.cs \
83 invoke-string-ctors.cs \
111 reflection-const-field.cs \
140 appdomain-client.cs \
141 appdomain-unload.cs \
177 test-byval-in-struct.cs \
182 thread-static-init.cs \
203 delegate-async-exit.cs \
204 delegate-delegate-exit.cs \
207 finalizer-exception.cs \
210 main-returns-abort-resetabort.cs \
211 main-returns-background-abort-resetabort.cs \
212 main-returns-background-resetabort.cs \
213 main-returns-background.cs \
214 main-returns-background-change.cs \
222 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
227 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
231 delegate-async-exception.exe \
232 delegate-delegate-exception.exe \
233 appdomain-unload.exe \
234 $(PLATFORM_DISABLED_TESTS)
236 # These only compile with MS CSC
251 static-fields-nonconst.il \
252 reload-at-bb-end.il \
253 test-enum-indstoreil.il \
256 TEST_CS2_SRC = interlocked-2.2.cs
257 TEST_IL2_SRC = find-method.2.il
259 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
260 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
261 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
262 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
263 TESTBS=$(BENCHSRC:.cs=.exe)
264 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
266 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
274 %.exe: %.2.cs TestDriver.dll
275 $(GMCS) -r:TestDriver.dll -out:$@ $<
277 %.exe: %.cs TestDriver.dll
278 $(MCS) -r:TestDriver.dll -out:$@ $<
280 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
282 test: testjit test-type-load test-inline-call-stack
284 test: testjit testbundle test-type-load test-inline-call-stack
288 $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
290 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
293 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
294 for i in $(TESTSI_CS); do \
295 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
297 passed=`expr $${passed} + 1`; \
299 if [ $$? = 2 ]; then break; fi; \
300 failed=`expr $${failed} + 1`; \
303 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
305 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
308 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
309 for i in $(TESTSI_IL); do \
310 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
312 passed=`expr $${passed} + 1`; \
314 if [ $$? = 2 ]; then break; fi; \
315 failed=`expr $${failed} + 1`; \
318 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
320 testb: $(TEST_PROG) $(TESTBS)
321 for i in $(TESTBS); do \
322 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
325 testjit: testjit-default testjit-net_2_0
327 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
331 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
333 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
335 passed=`expr $${passed} + 1`; \
337 if [ $$? = 2 ]; then break; fi; \
338 failed=`expr $${failed} + 1`; \
339 failed_tests="$${failed_tests} $$i"; \
342 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
343 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
344 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
346 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
350 for i in $(TESTSI_CS2) $(TESTSI_IL2); do \
352 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
354 passed=`expr $${passed} + 1`; \
356 if [ $$? = 2 ]; then break; fi; \
357 failed=`expr $${failed} + 1`; \
358 failed_tests="$${failed_tests} $$i"; \
361 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
362 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
363 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
365 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
369 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
370 for i in $(TESTSI_CS) $(TESTBS); do \
372 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
373 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
375 passed=`expr $${passed} + 1`; \
377 if [ $$? = 2 ]; then break; fi; \
378 failed=`expr $${failed} + 1`; \
379 failed_tests="$${failed_tests} $$i"; \
382 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
383 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
384 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
387 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
389 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
393 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
394 for i in $(TESTSI_CS) $(TESTSI_IL); do \
395 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_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 testjitspeed: $(JITTEST_PROG) $(TESTBS)
409 for i in $(TESTBS); do \
411 time $(JITTEST_PROG) $$i; \
414 stresstest: $(STRESS_TESTS)
418 for i in $(STRESS_TESTS); do \
419 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
421 passed=`expr $${passed} + 1`; \
423 if [ $$? = 2 ]; then break; fi; \
424 failed=`expr $${failed} + 1`; \
425 failed_tests="$${failed_tests} $$i"; \
428 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
429 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
430 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
432 testbundle: console.exe
433 $(MKBUNDLE) --static console.exe
434 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
437 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
438 test-type-load: TestDriver.dll
439 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
440 $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
441 $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
442 $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
443 $(RUNTIME) load-exceptions.exe
445 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
446 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
447 $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
448 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
449 $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
450 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
451 $(RUNTIME) test-inline-call-stack.exe
453 # Useful if mono is compiled with --enable-shared=no
456 sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
457 sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
460 noinst_LTLIBRARIES = libtest.la
462 INCLUDES = $(GLIB_CFLAGS)
465 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
466 # can't find them. So we use --kill-at to remove the @ suffix as well.
467 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
469 libtest_la_LDFLAGS = -rpath `pwd`
471 libtest_la_SOURCES = libtest.c
472 libtest_la_LIBADD = $(GLIB_LIBS)
474 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat