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_TOP_BUILD_DIR=$(top_builddir) \
17 PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
18 $(RUNTIME) $(mcs_topdir)/tools/mkbundle/mkbundle.exe
20 CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
21 ILASM = $(RUNTIME) $(mcs_topdir)/ilasm/ilasm.exe
23 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
67 valuetype-gettype.cs \
69 static-constructor.cs \
80 invoke-string-ctors.cs \
108 reflection-const-field.cs \
137 appdomain-client.cs \
138 appdomain-unload.cs \
173 test-byval-in-struct.cs \
178 thread-static-init.cs \
198 delegate-async-exit.cs \
199 delegate-delegate-exit.cs \
202 finalizer-exception.cs \
205 main-returns-abort-resetabort.cs \
206 main-returns-background-abort-resetabort.cs \
207 main-returns-background-resetabort.cs \
208 main-returns-background.cs \
209 main-returns-background-change.cs \
216 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
221 PLATFORM_DISABLED_TESTS=appdomain-unload.exe
225 delegate-async-exception.cs \
226 delegate-delegate-exception.cs \
227 $(PLATFORM_DISABLED_TESTS)
229 # These only compile with MS CSC
243 static-fields-nonconst.il \
247 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
248 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
249 TESTBS=$(BENCHSRC:.cs=.exe)
250 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
252 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
257 %.exe: %.cs TestDriver.dll
258 $(CSC) -r:TestDriver.dll -out:$@ $<
260 test: testjit testbundle
263 $(CSC) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
265 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
268 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
269 for i in $(TESTSI_CS); do \
270 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
272 passed=`expr $${passed} + 1`; \
274 if [ $$? = 2 ]; then break; fi; \
275 failed=`expr $${failed} + 1`; \
278 echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
280 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
283 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
284 for i in $(TESTSI_IL); do \
285 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
287 passed=`expr $${passed} + 1`; \
289 if [ $$? = 2 ]; then break; fi; \
290 failed=`expr $${failed} + 1`; \
293 echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
295 testb: $(TEST_PROG) $(TESTBS)
296 for i in $(TESTBS); do \
297 $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
300 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
304 for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
306 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
308 passed=`expr $${passed} + 1`; \
310 if [ $$? = 2 ]; then break; fi; \
311 failed=`expr $${failed} + 1`; \
312 failed_tests="$${failed_tests} $$i"; \
315 echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
316 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
317 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
319 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
323 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
324 for i in $(TESTSI_CS) $(TESTBS); do \
326 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
327 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
329 passed=`expr $${passed} + 1`; \
331 if [ $$? = 2 ]; then break; fi; \
332 failed=`expr $${failed} + 1`; \
333 failed_tests="$${failed_tests} $$i"; \
336 echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
337 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
338 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
341 $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
343 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
347 export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
348 for i in $(TESTSI_CS) $(TESTSI_IL); do \
349 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
351 passed=`expr $${passed} + 1`; \
353 if [ $$? = 2 ]; then break; fi; \
354 failed=`expr $${failed} + 1`; \
355 failed_tests="$${failed_tests} $$i"; \
358 echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
359 if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
360 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
362 testjitspeed: $(JITTEST_PROG) $(TESTBS)
363 for i in $(TESTBS); do \
365 time $(JITTEST_PROG) $$i; \
368 stresstest: $(STRESS_TESTS)
372 for i in $(STRESS_TESTS); do \
373 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(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) failed."; \
383 if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
384 for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
386 testbundle: console.exe
387 $(MKBUNDLE) --static console.exe
388 $(with_mono_path) ./a.out
391 noinst_LTLIBRARIES = libtest.la
393 INCLUDES = $(GLIB_CFLAGS)
396 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
397 # can't find them. So we use --kill-at to remove the @ suffix as well.
398 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
400 libtest_la_LDFLAGS = -rpath `pwd`
402 libtest_la_SOURCES = libtest.c
403 libtest_la_LIBADD = $(GLIB_LIBS)
405 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat