2008-06-04 Mark Probst <mark.probst@gmail.com>
[mono.git] / mono / tests / Makefile.am
1 SUBDIRS = cas assemblyresolve
2
3 # avoid including eglib twice since GLIB_LIBS == GMODULE_LIBS for eglib builds
4 if EGLIB_BUILD
5 glib_libs = $(GLIB_LIBS)
6 else
7 glib_libs = $(GLIB_LIBS) $(GMODULE_LIBS)
8 endif
9
10 check-local: test
11
12 TEST_PROG = ../interpreter/mint
13 JITTEST_PROG = ../mini/mono
14
15 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
16 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
17
18 RUNTIME_ARGS=--config tests-config --optimize=all
19
20 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
21 with_mono_path21 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_1
22
23 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
24 RUNTIME21 = $(with_mono_path21) $(top_builddir)/runtime/mono-wrapper
25
26 MKBUNDLE = \
27         PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
28         $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/mkbundle.exe
29
30 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
31 SMCS = $(RUNTIME21) --runtime=moonlight --security=temporary-smcs-hack $(mcs_topdir)/class/lib/net_2_1/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
32 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
33
34 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
35
36 STRESS_TESTS_SRC=       \
37         abort-stress-1.cs       \
38         abort-stress-2.cs       \
39         abort-stress-3.cs       \
40         domain-stress.cs        \
41         gchandle-stress.cs      \
42         monitor-stress.cs       \
43         thread-stress.cs        \
44         gc-stress.cs            \
45         exit-stress.cs
46
47 BASE_TEST_CS_SRC=               \
48         array-init.cs           \
49         arraylist.cs            \
50         assemblyresolve_event.cs        \
51         assemblyresolve_event3.cs       \
52         checked.cs              \
53         char-isnumber.cs        \
54         create-instance.cs      \
55         field-layout.cs         \
56         pack-layout.cs          \
57         pack-bug.cs             \
58         hash-table.cs           \
59         test-ops.cs             \
60         obj.cs                  \
61         test-dup-mp.cs          \
62         string.cs               \
63         stringbuilder.cs        \
64         switch.cs               \
65         outparm.cs              \
66         delegate.cs             \
67         bitconverter.cs         \
68         exception.cs            \
69         exception2.cs           \
70         exception3.cs           \
71         exception4.cs           \
72         exception5.cs           \
73         exception6.cs           \
74         exception7.cs           \
75         exception8.cs           \
76         exception10.cs          \
77         exception11.cs          \
78         exception12.cs          \
79         exception13.cs          \
80         exception14.cs          \
81         exception15.cs          \
82         exception16.cs          \
83         typeload-unaligned.cs   \
84         struct.cs               \
85         valuetype-gettype.cs    \
86         typeof-ptr.cs           \
87         static-constructor.cs   \
88         pinvoke.cs              \
89         pinvoke2.cs             \
90         pinvoke3.cs             \
91         pinvoke11.cs            \
92         pinvoke13.cs            \
93         pinvoke17.cs            \
94         invoke.cs               \
95         invoke2.cs              \
96         runtime-invoke.cs               \
97         invoke-string-ctors.cs          \
98         reinit.cs               \
99         box.cs                  \
100         array.cs                \
101         enum.cs                 \
102         enum2.cs                \
103         property.cs             \
104         enumcast.cs             \
105         assignable-tests.cs     \
106         array-cast.cs           \
107         array-subtype-attr.cs   \
108         cattr-compile.cs        \
109         cattr-field.cs          \
110         cattr-object.cs         \
111         custom-attr.cs          \
112         double-cast.cs          \
113         newobj-valuetype.cs     \
114         arraylist-clone.cs      \
115         setenv.cs               \
116         vtype.cs                \
117         isvaluetype.cs          \
118         iface6.cs               \
119         iface7.cs               \
120         ipaddress.cs            \
121         array-vt.cs             \
122         interface1.cs           \
123         reflection-enum.cs      \
124         reflection-prop.cs      \
125         reflection4.cs          \
126         reflection5.cs          \
127         reflection-const-field.cs \
128         many-locals.cs          \
129         string-compare.cs       \
130         test-prime.cs           \
131         params.cs               \
132         reflection.cs           \
133         interface.cs            \
134         iface.cs                \
135         iface2.cs               \
136         iface3.cs               \
137         iface4.cs               \
138         iface-large.cs          \
139         virtual-method.cs       \
140         virtual-sync.cs \
141         intptrcast.cs           \
142         indexer.cs              \
143         stream.cs               \
144         console.cs              \
145         shift.cs                \
146         jit-int.cs              \
147         jit-uint.cs             \
148         jit-long.cs             \
149         long.cs                 \
150         jit-ulong.cs            \
151         jit-float.cs            \
152         pop.cs                  \
153         time.cs                 \
154         appdomain.cs        \
155         appdomain1.cs           \
156         appdomain2.cs           \
157         appdomain-client.cs     \
158         appdomain-unload.cs \
159         loader.cs       \
160         pointer.cs              \
161         hashcode.cs             \
162         delegate1.cs            \
163         delegate2.cs            \
164         delegate3.cs            \
165         delegate5.cs            \
166         delegate6.cs            \
167         delegate7.cs            \
168         delegate8.cs            \
169         remoting1.cs            \
170         remoting2.cs            \
171         remoting3.cs            \
172         remoting4.cs            \
173         remoting5.cs            \
174         largeexp.cs             \
175         largeexp2.cs            \
176         marshalbyref1.cs        \
177         static-ctor.cs          \
178         inctest.cs              \
179         bound.cs                \
180         array-invoke.cs         \
181         test-arr.cs             \
182         decimal.cs              \
183         decimal-array.cs        \
184         marshal.cs              \
185         marshal1.cs             \
186         marshal2.cs             \
187         marshal3.cs             \
188         marshal5.cs             \
189         marshal6.cs             \
190         marshal7.cs             \
191         marshal8.cs             \
192         marshal9.cs             \
193         marshal-valuetypes.cs   \
194         test-byval-in-struct.cs \
195         thread.cs               \
196         thread5.cs              \
197         thread6.cs              \
198         thread-static.cs        \
199         thread-static-init.cs   \
200         context-static.cs       \
201         float-pop.cs            \
202         interfacecast.cs        \
203         array3.cs               \
204         classinit.cs            \
205         classinit2.cs           \
206         synchronized.cs         \
207         async_read.cs           \
208         threadpool.cs           \
209         threadpool1.cs          \
210         base-definition.cs      \
211         bug-27420.cs            \
212         bug-47295.cs            \
213         bug-46781.cs            \
214         bug-48015.cs            \
215         bug-42136.cs            \
216         bug-59286.cs            \
217         bug-70561.cs            \
218         bug-78311.cs            \
219         bug-78653.cs            \
220         bug-78656.cs            \
221         bug-77127.cs            \
222         bug-323114.cs           \
223         bug-331958.cs           \
224         interlocked.cs          \
225         cross-domain.cs         \
226         appdomain-exit.cs       \
227         delegate-async-exit.cs  \
228         delegate-delegate-exit.cs       \
229         delegate-exit.cs        \
230         finalizer-abort.cs      \
231         finalizer-exception.cs  \
232         finalizer-exit.cs       \
233         main-exit.cs    \
234         main-returns-abort-resetabort.cs        \
235         main-returns-background-abort-resetabort.cs     \
236         main-returns-background-resetabort.cs   \
237         main-returns-background.cs      \
238         main-returns-background-change.cs       \
239         main-returns.cs         \
240         subthread-exit.cs       \
241         desweak.cs              \
242         cominterop.cs           \
243         exists.cs               \
244         handleref.cs    \
245         transparentproxy.cs \
246         imt_big_iface_test.cs \
247         dbnull-missing.cs       \
248         test-type-ctor.cs       \
249         soft-float-tests.cs     \
250         thread-exit.cs          \
251         assemblyresolve_event2.2.cs     \
252         interlocked-2.2.cs      \
253         pinvoke-2.2.cs          \
254         bug-78431.2.cs          \
255         bug-79684.2.cs          \
256         catch-generics.2.cs     \
257         event-get.2.cs          \
258         safehandle.2.cs         \
259         stackframes-async.2.cs          \
260         module-cctor-loader.2.cs        \
261         generics-invoke-byref.2.cs      \
262         generic-signature-compare.2.cs  \
263         generics-sharing.2.cs   \
264         shared-generic-methods.2.cs     \
265         shared-generic-synchronized.2.cs        \
266         generic-inlining.2.cs   \
267         generic-initobj.2.cs    \
268         generic-delegate.2.cs   \
269         generic-sizeof.2.cs     \
270         generic-virtual.2.cs    \
271         generic-interface-methods.2.cs  \
272         generic-array-type.2.cs \
273         generic-method-patching.2.cs    \
274         generic-null-call.2.cs  \
275         recursive-generics.2.cs \
276         bug-80392.2.cs          \
277         dynamic-method-access.2.cs      \
278         bug-82194.2.cs  \
279         anonarray.2.cs  \
280         ienumerator-interfaces.2.cs     \
281         array-enumerator-ifaces.2.cs    \
282         generic_type_definition_encoding.2.cs \
283         generic_type_definition.2.cs    \
284         bug-333798.2.cs         \
285         bug-333798-tb.2.cs              \
286         bug-335131.2.cs         \
287         bug-322722_patch_bx.2.cs                \
288         bug-348522.2.cs         \
289         bug-340662_bug.cs       \
290         bug-322722_dyn_method_throw.2.cs        \
291         bug-389886-2.cs \
292         bug-325283.2.cs \
293         thunks.cs
294
295 if AMD64
296 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
297 else
298 if X86
299 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
300 else
301 TEST_CS_SRC = $(BASE_TEST_CS_SRC)
302 endif
303 endif
304
305 if IA64
306 TEST_CS_SRC+=async-exc-compilation.cs
307 endif
308
309 if X86
310 # bug #71274
311 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
312 endif
313
314 if POWERPC
315 # bug #71274
316 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
317 endif
318
319 DISABLED_TESTS=                 \
320         delegate-async-exception.exe    \
321         delegate-delegate-exception.exe \
322         appdomain-unload.exe            \
323         bug-348522.2.exe        \
324         $(PLATFORM_DISABLED_TESTS)
325
326 # These only compile with MS CSC
327 TEST_CSC_SRC=                   \
328         vararg.cs
329
330 TEST_IL_SRC=                    \
331         field-access.il         \
332         method-access.il        \
333         ldftn-access.il         \
334         cpblkTest.il            \
335         vbinterface.il          \
336         jmpTest.il              \
337         calliTest.il            \
338         ckfiniteTest.il         \
339         fault-handler.il                \
340         locallocTest.il         \
341         initblkTest.il          \
342         qt-instance.il          \
343         vararg.il               \
344         bug-29859.il            \
345         bug-78549.il            \
346         static-fields-nonconst.il       \
347         reload-at-bb-end.il     \
348         test-enum-indstoreil.il \
349         filter-bug.il           \
350         even-odd.il             \
351         bug-82022.il    \
352         vt-sync-method.il       \
353         enum_types.il   \
354         invalid-token.il        \
355         call_missing_method.il  \
356         call_missing_class.il   \
357         ldfld_missing_field.il  \
358         ldfld_missing_class.il  \
359         find-method.2.il        \
360         bug-79215.2.il  \
361         bug-79956.2.il  \
362         bug-327438.2.il \
363         bug-387274.2.il \
364         ldtoken_with_byref_typespec.2.il \
365         resolve_method_bug.2.il \
366         resolve_field_bug.2.il \
367         resolve_type_bug.2.il   \
368         generics-sharing-other-exc.2.il \
369         generic-ldobj.2.il      \
370         generic-mkrefany.2.il   \
371         generic-refanyval.2.il  \
372         generic-ldtoken.2.il    \
373         generic-ldtoken-method.2.il     \
374         generic-ldtoken-field.2.il      \
375         generic-tailcall.2.il   \
376         generic-tailcall2.2.il  \
377         generic-array-exc.2.il
378
379 #       bug-318677.il
380
381 # pre-requisite test sources: files that are not test themselves
382 # but that need to be compiled
383 PREREQ_IL_SRC=event-il.il module-cctor.il
384 PREREQ_CS_SRC=
385 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
386 PREREQ_CS_DLL_SRC=
387
388 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
389 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
390 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
391 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
392 TESTBS=$(BENCHSRC:.cs=.exe)
393 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
394
395 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) \
396         $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
397
398 %.exe: %.il
399         $(ILASM) -out:$@ $<
400
401 %.exe: %.cs TestDriver.dll
402         $(MCS) -r:TestDriver.dll -out:$@ $<
403
404 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
405 if POWERPC
406 test:   assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 test-generic-sharing test-bug-382986
407 else
408 # Can't use mkbundle on win32 since there is no static build there
409 # Can't run test-unhandled-exception on Windows because of all the debug popups...
410 if PLATFORM_WIN32
411 test:   assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 test-generic-sharing test-bug-382986
412 else
413 test:   assemblyresolve/test/asm.dll testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466 test-bug-324535 custom-modifiers test-generic-sharing test-bug-382986 
414 endif
415 endif
416
417 if INSTALL_2_1
418 test : test-coreclr-security
419 endif
420
421 assemblyresolve/test/asm.dll:
422         $(MAKE) -C assemblyresolve prereq
423
424 TestDriver.dll:
425         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
426
427 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
428         @failed=0; \
429         passed=0; \
430         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
431         for i in $(TESTSI_CS); do       \
432                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
433                 then \
434                         passed=`expr $${passed} + 1`; \
435                 else \
436                         if [ $$? = 2 ]; then break; fi; \
437                         failed=`expr $${failed} + 1`; \
438                 fi \
439         done; \
440         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
441
442 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
443         @failed=0; \
444         passed=0; \
445         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
446         for i in $(TESTSI_IL); do       \
447                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
448                 then \
449                         passed=`expr $${passed} + 1`; \
450                 else \
451                         if [ $$? = 2 ]; then break; fi; \
452                         failed=`expr $${failed} + 1`; \
453                 fi \
454         done; \
455         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
456
457 testb: $(TEST_PROG) $(TESTBS)
458         for i in $(TESTBS); do  \
459                 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);     \
460         done
461
462 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
463         @failed=0; \
464         passed=0; \
465         failed_tests="";\
466         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
467                 rm -f $${i}.so; \
468                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
469                 then \
470                         passed=`expr $${passed} + 1`; \
471                 else \
472                         if [ $$? = 2 ]; then break; fi; \
473                         failed=`expr $${failed} + 1`; \
474                         failed_tests="$${failed_tests} $$i"; \
475                 fi \
476         done; \
477         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
478         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
479           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
480
481 testaot: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
482         @failed=0; \
483         passed=0; \
484         failed_tests="";\
485         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
486         for i in $(TESTSI_CS) $(TESTSI_IL) $(TESTBS); do        \
487                 rm -f $${i}.so; \
488                 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
489                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
490                 then \
491                         passed=`expr $${passed} + 1`; \
492                 else \
493                         if [ $$? = 2 ]; then break; fi; \
494                         failed=`expr $${failed} + 1`; \
495                         failed_tests="$${failed_tests} $$i"; \
496                 fi \
497         done; \
498         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
499         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
500           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
501
502 testtrace:
503         $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
504
505 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
506         @failed=0; \
507         passed=0; \
508         failed_tests="";\
509         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
510         for i in $(TESTSI_CS) $(TESTSI_IL); do \
511                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
512                 then \
513                         passed=`expr $${passed} + 1`; \
514                 else \
515                         if [ $$? = 2 ]; then break; fi; \
516                         failed=`expr $${failed} + 1`; \
517                         failed_tests="$${failed_tests} $$i"; \
518                 fi \
519         done; \
520         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
521         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
522           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
523
524 testjitspeed: $(JITTEST_PROG) $(TESTBS)
525         for i in $(TESTBS); do  \
526                 echo $$i;       \
527                 time $(JITTEST_PROG) $$i;       \
528         done
529
530 test-iomap-regression: exists.cs
531         $(MCS) $(srcdir)/exists.cs -out:exists.exe
532         MONO_IOMAP=all $(RUNTIME) exists.exe
533
534 stresstest: $(STRESS_TESTS)
535         @failed=0; \
536         passed=0; \
537         failed_tests="";\
538         for i in $(STRESS_TESTS); do    \
539                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
540                 then \
541                         passed=`expr $${passed} + 1`; \
542                 else \
543                         if [ $$? = 2 ]; then break; fi; \
544                         failed=`expr $${failed} + 1`; \
545                         failed_tests="$${failed_tests} $$i"; \
546                 fi \
547         done; \
548         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
549         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
550           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
551
552 testbundle: console.exe
553         $(MKBUNDLE) --static console.exe
554         $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
555         - rm -rf a.out
556
557 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
558 test-type-load: TestDriver.dll
559         $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
560         $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
561         $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
562         $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
563         $(RUNTIME) load-exceptions.exe
564
565 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
566 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
567         $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
568 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
569         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
570 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
571         $(RUNTIME) test-inline-call-stack.exe
572
573
574 EXTRA_DIST += unhandled-exception-base-configuration.config
575 EXTRA_DIST += unhandled-exception-legacy-configuration.config
576 EXTRA_DIST += unhandled-exception-test-case.2.cs
577 EXTRA_DIST += unhandled-exception-test-runner.2.cs
578 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
579         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
580 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
581         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
582 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
583         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
584 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
585         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
586         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
587         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
588         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
589 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
590         $(MCS) /debug unhandled-exception-test-case.1.cs
591 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
592         $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
593 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
594         $(MCS) /debug unhandled-exception-test-case.2.cs
595 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
596         $(MCS) /debug unhandled-exception-test-case-legacy.2.cs
597 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
598         $(MCS) /debug unhandled-exception-test-runner.2.cs
599
600 test-unhandled-exception: unhandled-exception-test-runner.2.exe unhandled-exception-config_files unhandled-exception-test-case.1.exe unhandled-exception-test-case-legacy.1.exe  unhandled-exception-test-case.2.exe unhandled-exception-test-case-legacy.2.exe
601         $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
602
603 EXTRA_DIST += bug-80307.cs
604 bug-80307.exe: $(srcdir)/bug-80307.cs
605         $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
606
607 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
608 test-bug-80307: bug-80307.exe
609         cd $(top_builddir)/runtime && $(MAKE) test-support-files
610         $(RUNTIME) bug-80307.exe
611
612 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
613 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
614         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
615         $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
616         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
617
618 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
619         $(RUNTIME) bug-81673.exe
620
621 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
622 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
623         $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
624         $(MCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
625         $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
626         rm -f bug-81691-a.dll
627
628 test-bug-81691 : bug-81691.exe bug-81691-b.dll
629         $(RUNTIME) bug-81691.exe
630
631 EXTRA_DIST += bug-81466.il bug-81466-lib.il
632 bug-81466-lib.dll: bug-81466-lib.il
633         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
634 bug-81466.exe: bug-81466.il bug-81466-lib.dll
635         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
636 test-bug-81466: bug-81466.exe bug-81466-lib.dll
637         $(RUNTIME) bug-81466.exe
638
639 EXTRA_DIST += bug-324535-il.il bug-324535.cs
640 bug-324535-il.dll : bug-324535-il.il
641         $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
642 bug-324535.exe : bug-324535.cs bug-324535-il.dll
643         $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
644 test-bug-324535 : bug-324535.exe bug-324535-il.dll
645         $(RUNTIME) bug-324535.exe
646
647 EXTRA_DIST += make_imt_test.sh
648 imt_big_iface_test.cs: $(srcdir)/make_imt_test.sh
649         $(srcdir)/make_imt_test.sh > imt_big_iface_test.cs
650
651 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
652 custom-modifiers-lib.dll: custom-modifiers-lib.il
653         $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
654 custom-modifiers.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
655         $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.exe $(srcdir)/custom-modifiers.2.cs
656 custom-modifiers: custom-modifiers.exe
657         $(RUNTIME) custom-modifiers.exe
658
659 EXTRA_DIST += bug-382986.cs  bug-382986-lib.cs
660 bug-382986-lib.dll: bug-382986-lib.cs
661         $(MCS) -target:library -out:$@ $(srcdir)/bug-382986-lib.cs
662 bug-382986.exe: bug-382986.cs bug-382986-lib.dll
663         $(MCS) -out:$@ -r:bug-382986-lib.dll $(srcdir)/bug-382986.cs
664 test-bug-382986: bug-382986.exe
665         $(RUNTIME) bug-382986.exe
666
667 EXTRA_DIST += coreclr-security.cs
668
669 if INSTALL_2_1
670 coreclr-security.exe : coreclr-security.cs
671         $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
672
673 test-coreclr-security : coreclr-security.exe
674         $(RUNTIME21) --security=core-clr-test coreclr-security.exe
675 endif
676
677 EXTRA_DIST += generic-unboxing.2.il
678 generic-unboxing.2.dll : generic-unboxing.2.il
679         $(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
680
681 EXTRA_DIST += generic-boxing.2.il
682 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
683         $(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
684
685 EXTRA_DIST += generic-unbox.2.cs
686 generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
687         $(MCS) -r:generic-unboxing.2.dll -out:$@ $(srcdir)/generic-unbox.2.cs
688
689 EXTRA_DIST += generic-box.2.cs
690 generic-box.2.exe : generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
691         $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll -out:$@ $(srcdir)/generic-box.2.cs
692
693 test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe      \
694                 shared-generic-synchronized.2.exe generic-initobj.2.exe         \
695                 generics-sharing-other-exc.2.exe generic-box.2.exe              \
696                 generic-unbox.2.exe generic-delegate.2.exe generic-sizeof.2.exe \
697                 generic-ldobj.2.exe generic-mkrefany.2.exe                      \
698                 generic-refanyval.2.exe generic-ldtoken.2.exe                   \
699                 generic-ldtoken-method.2.exe  generic-ldtoken-field.2.exe       \
700                 generic-virtual.2.exe generic-tailcall.2.exe                    \
701                 generic-interface-methods.2.exe generic-array-type.2.exe        \
702                 generic-method-patching.2.exe   \
703                 generic-null-call.2.exe generic-tailcall2.2.exe                 \
704                 generic-array-exc.2.exe
705         for fn in $+ ; do       \
706                 echo "Testing $$fn ...";        \
707                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline        $$fn || exit 1;   \
708                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline,shared $$fn || exit 1;   \
709         done
710
711 EXTRA_DIST += async-exceptions.cs
712 async-exceptions.exe : async-exceptions.cs
713         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
714 test-async-exceptions : async-exceptions.exe
715         for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:foo $$i async-exceptions.exe || exit 1; done
716         for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:bar $$i async-exceptions.exe || exit 1; done
717
718 # Useful if mono is compiled with --enable-shared=no
719 patch-libtool:
720         cp "../../libtool" .
721         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
722         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
723         touch libtest.c
724
725 noinst_LTLIBRARIES = libtest.la
726
727 INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
728
729 if PLATFORM_WIN32
730 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
731 # This shows up when compiling mono_test_marshal_delegate ()
732 libtest_la_CFLAGS=-fno-optimize-sibling-calls
733 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
734 # can't find them. So we use --kill-at to remove the @ suffix as well.
735 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
736 else
737 libtest_la_LDFLAGS = -rpath `pwd`
738 endif
739 libtest_la_SOURCES = libtest.c
740 libtest_la_LIBADD = $(glib_libs)
741
742 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat