3 TEST_PROG = ../interpreter/mint
4 JITTEST_PROG = ../mini/mono
6 TEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
7 JITTEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default 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
13 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
16 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
17 $(RUNTIME) $(mcs_topdir)/tools/mkbundle/mkbundle.exe
19 CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
20 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
22 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
67 valuetype-gettype.cs \
69 static-constructor.cs \
79 invoke-string-ctors.cs \
107 reflection-const-field.cs \
135 appdomain-client.cs \
136 appdomain-unload.cs \
171 test-byval-in-struct.cs \
176 thread-static-init.cs \
196 delegate-async-exit.cs \
197 delegate-delegate-exit.cs \
200 finalizer-exception.cs \
203 main-returns-abort-resetabort.cs \
204 main-returns-background-abort-resetabort.cs \
205 main-returns-background-resetabort.cs \
206 main-returns-background.cs \
207 main-returns-background-change.cs \
214 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
219 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
223 delegate-async-exception.exe \
224 delegate-delegate-exception.exe \
225 $(PLATFORM_DISABLED_TESTS)
227 # These only compile with MS CSC
241 static-fields-nonconst.il \
242 reload-at-bb-end.il \
246 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
247 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
248 TESTBS=$(BENCHSRC:.cs=.exe)
249 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
251 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
256 %.exe: %.cs TestDriver.dll
257 $(CSC) -r:TestDriver.dll -out:$@ $<
259 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
261 test: testjit test-type-load
263 test: testjit testbundle test-type-load
267 $(CSC) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
269 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
272 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
273 for i in $(TESTSI_CS); do \
274 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
276 passed=`expr $${passed} + 1`; \
278 if [ $$? = 2 ]; then break; fi; \
279 failed=`expr $${failed} + 1`; \
282 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
284 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
287 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
288 for i in $(TESTSI_IL); do \
289 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
291 passed=`expr $${passed} + 1`; \
293 if [ $$? = 2 ]; then break; fi; \
294 failed=`expr $${failed} + 1`; \
297 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
299 testb: $(TEST_PROG) $(TESTBS)
300 for i in $(TESTBS); do \
301 $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
304 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
308 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
310 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
312 passed=`expr $${passed} + 1`; \
314 if [ $$? = 2 ]; then break; fi; \
315 failed=`expr $${failed} + 1`; \
316 failed_tests="$${failed_tests} $$i"; \
319 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
320 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
321 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
323 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
327 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
328 for i in $(TESTSI_CS) $(TESTBS); do \
330 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
331 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
333 passed=`expr $${passed} + 1`; \
335 if [ $$? = 2 ]; then break; fi; \
336 failed=`expr $${failed} + 1`; \
337 failed_tests="$${failed_tests} $$i"; \
340 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
341 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
342 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
345 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
347 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
351 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
352 for i in $(TESTSI_CS) $(TESTSI_IL); do \
353 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
355 passed=`expr $${passed} + 1`; \
357 if [ $$? = 2 ]; then break; fi; \
358 failed=`expr $${failed} + 1`; \
359 failed_tests="$${failed_tests} $$i"; \
362 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
363 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
364 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
366 testjitspeed: $(JITTEST_PROG) $(TESTBS)
367 for i in $(TESTBS); do \
369 time $(JITTEST_PROG) $$i; \
372 stresstest: $(STRESS_TESTS)
376 for i in $(STRESS_TESTS); do \
377 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
379 passed=`expr $${passed} + 1`; \
381 if [ $$? = 2 ]; then break; fi; \
382 failed=`expr $${failed} + 1`; \
383 failed_tests="$${failed_tests} $$i"; \
386 echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
387 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
388 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
390 testbundle: console.exe
391 $(MKBUNDLE) --static console.exe
392 $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
395 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
396 test-type-load: TestDriver.dll
397 $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
398 $(CSC) /target:library /out:t.dll /d:FOUND $(srcdir)/t-missing.cs
399 $(CSC) /r:TestDriver.dll /r:load-missing.dll /r:t.dll /out:load-exceptions.exe $(srcdir)/load-exceptions.cs
400 $(CSC) /target:library /out:t.dll $(srcdir)/t-missing.cs
401 $(RUNTIME) load-exceptions.exe
403 noinst_LTLIBRARIES = libtest.la
405 INCLUDES = $(GLIB_CFLAGS)
408 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
409 # can't find them. So we use --kill-at to remove the @ suffix as well.
410 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
412 libtest_la_LDFLAGS = -rpath `pwd`
414 libtest_la_SOURCES = libtest.c
415 libtest_la_LIBADD = $(GLIB_LIBS)
417 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat