Revert "Revert "Merge branch 'master' of https://github.com/mono/mono""
[mono.git] / mono / tests / Makefile.am
1 SUBDIRS = cas assemblyresolve gc-descriptors
2
3 check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test-process-exit test-messages rm-empty-logs
4 check-full: test-sgen check-local
5 check-parallel: compile-tests check-full
6
7 # for backwards compatibility on Wrench
8 test-wrench: check-parallel
9
10 aotcheck: testaot gshared-aot
11
12 TEST_PROG = ../interpreter/mint
13
14 JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
15
16 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
17 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
18
19 RUNTIME_ARGS=--config tests-config --optimize=all --debug
20
21 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_4_5
22
23 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
24
25 MKBUNDLE = \
26         PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
27         $(RUNTIME) $(mcs_topdir)/class/lib/net_4_5/mkbundle.exe
28
29 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -debug \
30         -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
31         -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
32         -nowarn:0197
33 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/net_4_5/ilasm.exe
34
35 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
36
37 STRESS_TESTS_SRC=       \
38         abort-stress-1.cs       \
39         abort-stress-2.cs       \
40         abort-stress-3.cs       \
41         domain-stress.cs        \
42         gchandle-stress.cs      \
43         monitor-stress.cs       \
44         thread-stress.cs        \
45         gc-stress.cs            \
46         exit-stress.cs          \
47         process-stress.cs       \
48         assembly-load-stress.cs
49
50 # Disabled until ?mcs is fixed
51 #       bug-331958.cs
52 BASE_TEST_CS_SRC=               \
53         bug-2907.cs             \
54         array-init.cs           \
55         arraylist.cs            \
56         assemblyresolve_event.cs        \
57         assemblyresolve_event3.cs       \
58         checked.cs              \
59         char-isnumber.cs        \
60         create-instance.cs      \
61         field-layout.cs         \
62         pack-layout.cs          \
63         pack-bug.cs             \
64         hash-table.cs           \
65         test-ops.cs             \
66         obj.cs                  \
67         test-dup-mp.cs          \
68         string.cs               \
69         stringbuilder.cs        \
70         switch.cs               \
71         outparm.cs              \
72         delegate.cs             \
73         bitconverter.cs         \
74         exception.cs            \
75         exception2.cs           \
76         exception3.cs           \
77         exception4.cs           \
78         exception5.cs           \
79         exception6.cs           \
80         exception7.cs           \
81         exception8.cs           \
82         exception10.cs          \
83         exception11.cs          \
84         exception12.cs          \
85         exception13.cs          \
86         exception14.cs          \
87         exception15.cs          \
88         exception16.cs          \
89         exception17.cs          \
90         typeload-unaligned.cs   \
91         struct.cs               \
92         valuetype-gettype.cs    \
93         typeof-ptr.cs           \
94         static-constructor.cs   \
95         pinvoke.cs              \
96         pinvoke2.cs             \
97         pinvoke3.cs             \
98         pinvoke11.cs            \
99         pinvoke13.cs            \
100         pinvoke17.cs            \
101         invoke.cs               \
102         invoke2.cs              \
103         runtime-invoke.cs               \
104         invoke-string-ctors.cs          \
105         reinit.cs               \
106         box.cs                  \
107         array.cs                \
108         enum.cs                 \
109         enum2.cs                \
110         property.cs             \
111         enumcast.cs             \
112         assignable-tests.cs     \
113         array-cast.cs           \
114         array-subtype-attr.cs   \
115         cattr-compile.cs        \
116         cattr-field.cs          \
117         cattr-object.cs         \
118         custom-attr.cs          \
119         double-cast.cs          \
120         newobj-valuetype.cs     \
121         arraylist-clone.cs      \
122         setenv.cs               \
123         vtype.cs                \
124         isvaluetype.cs          \
125         iface6.cs               \
126         iface7.cs               \
127         ipaddress.cs            \
128         array-vt.cs             \
129         interface1.cs           \
130         reflection-enum.cs      \
131         reflection-prop.cs      \
132         reflection4.cs          \
133         reflection5.cs          \
134         reflection-const-field.cs \
135         many-locals.cs          \
136         string-compare.cs       \
137         test-prime.cs           \
138         params.cs               \
139         reflection.cs           \
140         interface.cs            \
141         iface.cs                \
142         iface2.cs               \
143         iface3.cs               \
144         iface4.cs               \
145         iface-large.cs          \
146         virtual-method.cs       \
147         intptrcast.cs           \
148         indexer.cs              \
149         stream.cs               \
150         console.cs              \
151         shift.cs                \
152         jit-int.cs              \
153         jit-uint.cs             \
154         jit-long.cs             \
155         long.cs                 \
156         jit-ulong.cs            \
157         jit-float.cs            \
158         pop.cs                  \
159         time.cs                 \
160         appdomain.cs        \
161         appdomain1.cs           \
162         appdomain2.cs           \
163         appdomain-client.cs     \
164         appdomain-unload.cs \
165         appdomain-async-invoke.cs       \
166         loader.cs       \
167         pointer.cs              \
168         hashcode.cs             \
169         delegate1.cs            \
170         delegate2.cs            \
171         delegate3.cs            \
172         delegate5.cs            \
173         delegate6.cs            \
174         delegate7.cs            \
175         delegate8.cs            \
176         delegate9.cs            \
177         remoting1.cs            \
178         remoting2.cs            \
179         remoting3.cs            \
180         remoting4.cs            \
181         remoting5.cs            \
182         largeexp.cs             \
183         largeexp2.cs            \
184         marshalbyref1.cs        \
185         static-ctor.cs          \
186         inctest.cs              \
187         bound.cs                \
188         array-invoke.cs         \
189         test-arr.cs             \
190         decimal.cs              \
191         decimal-array.cs        \
192         marshal.cs              \
193         marshal1.cs             \
194         marshal2.cs             \
195         marshal3.cs             \
196         marshal5.cs             \
197         marshal6.cs             \
198         marshal7.cs             \
199         marshal8.cs             \
200         marshal9.cs             \
201         marshalbool.cs          \
202         marshal-valuetypes.cs   \
203         test-byval-in-struct.cs \
204         thread.cs               \
205         thread5.cs              \
206         thread6.cs              \
207         thread-static.cs        \
208         thread-static-init.cs   \
209         context-static.cs       \
210         float-pop.cs            \
211         interfacecast.cs        \
212         array3.cs               \
213         classinit.cs            \
214         classinit2.cs           \
215         synchronized.cs         \
216         async_read.cs           \
217         threadpool.cs           \
218         threadpool1.cs          \
219         threadpool-exceptions1.cs \
220         threadpool-exceptions2.cs \
221         threadpool-exceptions3.cs \
222         threadpool-exceptions4.cs \
223         threadpool-exceptions5.cs \
224         threadpool-exceptions6.cs \
225         threadpool-exceptions7.cs \
226         base-definition.cs      \
227         bug-27420.cs            \
228         bug-47295.cs            \
229         bug-46781.cs            \
230         bug-48015.cs            \
231         bug-42136.cs            \
232         bug-59286.cs            \
233         bug-70561.cs            \
234         bug-78311.cs            \
235         bug-78653.cs            \
236         bug-78656.cs            \
237         bug-77127.cs            \
238         bug-323114.cs           \
239         bug-Xamarin-5278.cs     \
240         interlocked.cs          \
241         cross-domain.cs         \
242         appdomain-exit.cs       \
243         delegate-async-exit.cs  \
244         delegate-delegate-exit.cs       \
245         delegate-exit.cs        \
246         finalizer-abort.cs      \
247         finalizer-exception.cs  \
248         finalizer-exit.cs       \
249         finalizer-thread.cs     \
250         main-exit.cs    \
251         main-returns-abort-resetabort.cs        \
252         main-returns-background-abort-resetabort.cs     \
253         main-returns-background-resetabort.cs   \
254         main-returns-background.cs      \
255         main-returns-background-change.cs       \
256         main-returns.cs         \
257         subthread-exit.cs       \
258         desweak.cs              \
259         cominterop.cs           \
260         exists.cs               \
261         handleref.cs    \
262         transparentproxy.cs \
263         dbnull-missing.cs       \
264         test-type-ctor.cs       \
265         soft-float-tests.cs     \
266         thread-exit.cs          \
267         finalize-parent.cs      \
268         assemblyresolve_event2.2.cs     \
269         interlocked-2.2.cs      \
270         pinvoke-2.2.cs          \
271         bug-78431.2.cs          \
272         bug-79684.2.cs          \
273         catch-generics.2.cs     \
274         event-get.2.cs          \
275         safehandle.2.cs         \
276         stackframes-async.2.cs          \
277         module-cctor-loader.2.cs        \
278         generics-invoke-byref.2.cs      \
279         generic-signature-compare.2.cs  \
280         generics-sharing.2.cs   \
281         shared-generic-methods.2.cs     \
282         shared-generic-synchronized.2.cs        \
283         generic-inlining.2.cs   \
284         generic-initobj.2.cs    \
285         generic-delegate.2.cs   \
286         generic-sizeof.2.cs     \
287         generic-virtual.2.cs    \
288         generic-interface-methods.2.cs  \
289         generic-array-type.2.cs \
290         generic-method-patching.2.cs    \
291         generic-static-methods.2.cs     \
292         generic-null-call.2.cs  \
293         generic-special.2.cs    \
294         generic-exceptions.2.cs \
295         generic-virtual2.2.cs   \
296         generic-valuetype-interface.2.cs        \
297         generic-getgenericarguments.2.cs        \
298         generic-type-builder.2.cs       \
299         generic-synchronized.2.cs       \
300         generic-delegate-ctor.2.cs      \
301         generic-array-iface-set.2.cs    \
302         generic-typedef.2.cs    \
303         generic-marshalbyref.2.cs       \
304         generic-xdomain.2.cs    \
305         bug-431413.2.cs \
306         bug-459285.2.cs \
307         generic-virtual-invoke.2.cs     \
308         bug-461198.2.cs \
309         generic-sealed-virtual.2.cs     \
310         generic-system-arrays.2.cs      \
311         generic-stack-traces.2.cs       \
312         generic-stack-traces2.2.cs      \
313         bug-472600.2.cs \
314         recursive-generics.2.cs \
315         bug-473482.2.cs \
316         bug-473999.2.cs \
317         bug-479763.2.cs \
318         bug-616463.cs   \
319         bug-80392.2.cs          \
320         dynamic-method-access.2.cs      \
321         dynamic-method-finalize.2.cs    \
322         bug-82194.2.cs  \
323         anonarray.2.cs  \
324         ienumerator-interfaces.2.cs     \
325         array-enumerator-ifaces.2.cs    \
326         generic_type_definition_encoding.2.cs \
327         generic_type_definition.2.cs    \
328         bug-333798.2.cs         \
329         bug-333798-tb.2.cs              \
330         bug-335131.2.cs         \
331         bug-322722_patch_bx.2.cs                \
332         bug-348522.2.cs         \
333         bug-340662_bug.cs       \
334         bug-322722_dyn_method_throw.2.cs        \
335         bug-389886-2.cs \
336         bug-325283.2.cs \
337         thunks.cs \
338         winx64structs.cs \
339         bug-349190.2.cs \
340         nullable_boxing.2.cs    \
341         valuetype-equals.cs     \
342         custom-modifiers.2.cs   \
343         bug-382986.cs   \
344         test-inline-call-stack.cs       \
345         bug-324535.cs   \
346         modules.cs      \
347         bug-81673.cs    \
348         bug-81691.cs    \
349         bug-80307.cs    \
350         bug-415577.cs   \
351         filter-stack.cs \
352         vararg2.cs      \
353         bug-389886-sre-generic-interface-instances.cs   \
354         bug-461867.cs   \
355         bug-461941.cs   \
356         bug-461261.cs   \
357         bug-400716.cs   \
358         bug-462592.cs   \
359         bug-459094.cs   \
360         generic-unloading.2.cs  \
361         generic-unloading-sub.2.cs      \
362         bug-467456.cs   \
363         appdomain-unload-callback.cs    \
364         bug-508538.cs   \
365         bug-472692.2.cs         \
366         gchandles.cs    \
367         interlocked-3.cs        \
368         interlocked-4.2.cs      \
369         appdomain-thread-abort.cs \
370         xdomain-threads.cs      \
371         w32message.cs   \
372         bug-544446.cs   \
373         gc-altstack.cs  \
374         large-gc-bitmap.cs      \
375         bug-561239.cs   \
376         bug-562150.cs   \
377         bug-575941.cs   \
378         bug-599469.cs   \
379         bug-389886-3.cs \
380         monitor.cs      \
381         dynamic-method-resurrection.cs  \
382         bug-666008.cs   \
383         bug-685908.cs   \
384         sgen-long-vtype.cs      \
385         delegate-invoke.cs      \
386         bug-696593.cs   \
387         bug-705140.cs   \
388         bug-1147.cs     \
389         mono-path.cs    \
390         bug-bxc-795.cs  \
391         bug-3903.cs     \
392         async-with-cb-throws.cs \
393         appdomain-unload-doesnot-raise-pending-events.cs        \
394         bug-6148.cs     \
395         assembly_append_ordering.cs     \
396         bug-10127.cs    \
397         bug-18026.cs    \
398         allow-synchronous-major.cs      \
399         unload-appdomain-on-shutdown.cs \
400         block_guard_restore_aligment_on_exit.cs \
401         finally_block_ending_in_dead_bb.cs      \
402         thread_static_gc_layout.cs \
403         sleep.cs
404
405 TEST_CS_SRC_DIST=       \
406         $(BASE_TEST_CS_SRC)     \
407         async-exc-compilation.cs \
408         filter-stack.cs \
409         finally_guard.cs
410
411 TEST_CS_SRC_GEN = \
412         runtime-invoke.gen.cs \
413         imt_big_iface_test.cs
414
415 if AMD64
416 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN) async-exc-compilation.cs finally_guard.cs
417 # #651684
418 PLATFORM_DISABLED_TESTS = finally_guard.exe
419 else
420 if X86
421 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN) async-exc-compilation.cs finally_guard.cs
422 else
423 TEST_CS_SRC = $(BASE_TEST_CS_SRC) $(TEST_CS_SRC_GEN)
424 endif
425 endif
426
427 if IA64
428 TEST_CS_SRC+=async-exc-compilation.cs filter-stack.cs
429 # bug #319249
430 PLATFORM_DISABLED_TESTS=exception17.exe
431 PLATFORM_DISABLED_TESTS+=winx64structs.exe
432 endif
433
434 if X86
435
436 if HOST_WIN32
437 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe
438 endif
439
440 endif
441
442 if POWERPC
443 # bug #71274
444 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
445 endif
446
447 if ARM
448 PLATFORM_DISABLED_TESTS=filter-stack.exe
449 endif
450
451 if MIPS
452 # monitor.exe is racy
453 PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
454 endif
455
456 if S390X
457 PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
458 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
459 endif
460
461 if NACL_CODEGEN
462 # Tests that use Thread.Abort()
463 PLATFORM_DISABLED_TESTS= abort-stress-1.exe \
464                          abort-stress-2.exe \
465                          abort-stress-3.exe \
466                          appdomain-thread-abort.exe \
467                          async-exc-compilation.exe \
468                          bug-561239.exe \
469                          bug-70561.exe \
470                          finalizer-abort.exe \
471                          finally_guard.exe \
472                          main-returns-abort-resetabort.exe \
473                          main-returns-background-abort-resetabort.exe \
474                          thread6.exe \
475                          threadpool-exceptions5.exe \
476                          threadpool-exceptions6.exe
477
478 # Tests that rely on AppDomain.Unload
479 PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
480                           appdomain-exit.exe \
481                           appdomain-unload-callback.exe \
482                           appdomain-unload.exe \
483                           domain-stress.exe \
484                           generic-unloading.2.exe \
485                           monitor.exe \
486                           remoting4.exe \
487                           threadpool-exceptions7.exe \
488                           xdomain-threads.exe
489
490 # pinvoke2 attaches a thread to the runtime, but
491 # doesn't 'unattach' it and it hangs in GC on exit
492 PLATFORM_DISABLED_TESTS+= pinvoke2.exe
493
494 # Tests that currently hang waiting for non-main threads
495 # to exit in NaCl, need to investigate.  Most are AppDomain
496 # creation and Delegate tests.
497 PLATFORM_DISABLED_TESTS+= appdomain1.exe \
498                           delegate9.exe \
499                           marshal-valuetypes.exe \
500                           cross-domain.exe \
501                           stackframes-async.2.exe \
502                           generic-marshalbyref.2.exe \
503                           generic-xdomain.2.exe \
504                           bug-415577.exe
505
506 # Tests that fail trying to write files (appdomain create mostly)
507 PLATFORM_DISABLED_TESTS+= bug-335131.2.exe \
508                           bug-349190.2.exe \
509                           bug-80307.exe \
510                           bug-462592.exe
511
512 # FIXME: don't know why delegate2.exe fails, it shouldn't
513 PLATFORM_DISABLED_TESTS+= delegate2.exe
514
515 # These tests newly fail with the latest revision. pinvoke3 fails because
516 # of a thread attach, the others have not been investigated.  TODO revisit.
517 PLATFORM_DISABLED_TESTS+= pinvoke3.exe \
518                           async_read.exe \
519                           async-with-cb-throws.exe \
520                           appdomain-unload-doesnot-raise-pending-events.exe \
521                           gsharing-valuetype-layout.exe
522
523 if X86
524 # FIXME: There are problems with async callbacks and results on NaCl 32-bit
525 PLATFORM_DISABLED_TESTS+= delegate1.exe \
526                           delegate3.exe \
527                           delegate5.exe \
528                           delegate8.exe \
529                           threadpool.exe \
530                           threadpool1.exe \
531                           threadpool-exceptions3.exe \
532                           bug-323114.exe \
533                           delegate-exit.exe \
534                           bug-80392.2.exe
535
536 # FIXME: These tests hang/fail for unknown reasons, deal with exiting
537 PLATFORM_DISABLED_TESTS+= main-returns-background-resetabort.exe \
538                           main-returns-background.exe \
539                           main-returns-background-change.exe
540 endif
541
542 endif
543
544 # The two finalizer tests only work under sgen
545 # gc-altstack.exe fails under boehm because it has no support for altstack
546 # bug-459094.exe creates an extremely deep directory tree
547 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
548 # reverted.
549 DISABLED_TESTS=                 \
550         delegate-async-exception.exe    \
551         bug-348522.2.exe        \
552         bug-459094.exe \
553         delegate-invoke.exe \
554         $(PLATFORM_DISABLED_TESTS)
555
556 DISABLED_TESTS_WRENCH=  \
557         $(DISABLED_TESTS)       \
558         $(PLATFORM_DISABLED_TESTS_WRENCH)       \
559         main-returns-background-resetabort.exe \
560         main-returns-background-abort-resetabort.exe    \
561         thread6.exe     \
562         assemblyresolve_event3.exe \
563         delegate2.exe   \
564         finally_guard.exe \
565         gc-altstack.exe
566
567 AOT_DISABLED_TESTS=constraints-load.exe
568
569 # These only compile with MS CSC
570 TEST_CSC_SRC=                   \
571         vararg.cs
572
573 TEST_IL_SRC=                    \
574         field-access.il         \
575         method-access.il        \
576         ldftn-access.il         \
577         cpblkTest.il            \
578         vbinterface.il          \
579         calliTest.il            \
580         ckfiniteTest.il         \
581         fault-handler.il                \
582         locallocTest.il         \
583         initblkTest.il          \
584         qt-instance.il          \
585         vararg.il               \
586         bug-29859.il            \
587         bug-78549.il            \
588         static-fields-nonconst.il       \
589         reload-at-bb-end.il     \
590         test-enum-indstoreil.il \
591         filter-bug.il           \
592         even-odd.il             \
593         bug-82022.il    \
594         vt-sync-method.il       \
595         enum_types.il   \
596         invalid-token.il        \
597         call_missing_method.il  \
598         call_missing_class.il   \
599         ldfld_missing_field.il  \
600         ldfld_missing_class.il  \
601         find-method.2.il        \
602         bug-79215.2.il  \
603         bug-79956.2.il  \
604         bug-327438.2.il \
605         bug-387274.2.il \
606         bug-426309.2.il \
607         ldtoken_with_byref_typespec.2.il \
608         resolve_method_bug.2.il \
609         resolve_field_bug.2.il \
610         resolve_type_bug.2.il   \
611         generics-sharing-other-exc.2.il \
612         generic-ldobj.2.il      \
613         generic-mkrefany.2.il   \
614         generic-refanyval.2.il  \
615         generic-ldtoken.2.il    \
616         generic-ldtoken-method.2.il     \
617         generic-ldtoken-field.2.il      \
618         generic-tailcall.2.il   \
619         generic-tailcall2.2.il  \
620         generic-array-exc.2.il  \
621         generic-valuetype-newobj2.2.il  \
622         generic-valuetype-newobj.2.il   \
623         generic-constrained.2.il        \
624         generic-type-load-exception.2.il        \
625         bug-81466.il    \
626         bug457574.il    \
627         bug445361.il    \
628         bug-463303.il   \
629         bug469742.2.il  \
630         bug-528055.il   \
631         constraints-load.il     \
632         array_load_exception.il \
633         bug-481403.il   \
634         interface-with-static-method.il \
635         bug-515884.il   \
636         bug-633291.il   \
637         delegate-with-null-target.il    \
638         bug-318677.il   \
639         gsharing-valuetype-layout.il    \
640         invalid_generic_instantiation.il
641
642
643 # pre-requisite test sources: files that are not test themselves
644 # but that need to be compiled
645 PREREQ_IL_SRC=event-il.il module-cctor.il
646 PREREQ_CS_SRC=
647 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
648 PREREQ_CS_DLL_SRC=
649
650 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
651 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
652 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
653 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
654 TESTBS=$(BENCHSRC:.cs=.exe)
655 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
656
657 EXTRA_DIST=test-driver $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
658         $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
659
660 %.exe: %.il
661         $(ILASM) -out:$@ $<
662
663 %.exe: %.cs TestDriver.dll
664         $(MCS) -r:TestDriver.dll -out:$@ $<
665
666 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
667 if POWERPC
668 test_platform:
669 else
670 # Can't use mkbundle on win32 since there is no static build there
671 # Can't run test-unhandled-exception on Windows because of all the debug popups...
672 if HOST_WIN32
673 test_platform:
674 else
675 # mkbundle uses the installed mono-2.pc so it won't work if there is no system mono
676 #test_platform: testbundle test-iomap-regression
677 test_platform:  test-iomap-regression
678 endif
679 endif
680
681 if X86
682 if HOST_WIN32
683 else
684 test_platform: test-eglib-remap
685 endif
686 endif
687
688 # Target to precompile the test executables
689 tests: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS) $(GSHARED_TESTS)
690
691 #
692 # Test that no symbols are missed in eglib-remap.h
693 #
694 OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file'
695 if NACL_CODEGEN
696 test-eglib-remap:
697 else
698 test-eglib-remap:
699         @echo "Testing eglib remap..."
700         @if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -v $(OK_G_SYMBOLS) | grep 't g_'; then exit 1; else exit 0; fi; fi
701 endif
702
703 #
704 # Tests that the internals in mono/io-layer/messages.c are ok by triggering the 
705 # code that checks that the table is properly sorted
706 #
707 if NACL_CODEGEN
708 test-messages:
709 else
710 if HOST_WIN32
711 test-messages:
712 else
713 test-messages: w32message.exe
714         > test_messages.zero
715         $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe >& w32message.allout && cmp test_messages.zero w32message.allout
716 endif
717 endif
718
719 if AMD64
720 test-sgen : sgen-tests
721 else
722 if X86
723 if HOST_WIN32
724 test-sgen :
725 else
726 test-sgen : sgen-tests
727 endif
728 else
729 if ARM
730 test-sgen : sgen-tests
731 else
732 if S390X
733 test-sgen : sgen-regular-tests
734 endif
735 endif
736 endif
737 endif
738
739 # Precompile the test assemblies in parallel
740 compile-tests:
741         $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
742
743 # Remove empty .stdout and .stderr files for wrench
744 rm-empty-logs:
745         @echo "Removing empty logs..."
746         @find . '(' -name "*.stdout" -o -name "*.stderr" ')' -empty -exec rm {} \;
747
748 assemblyresolve/test/asm.dll:
749         $(MAKE) -C assemblyresolve prereq
750
751 TestDriver.dll:
752         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
753
754 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
755         @failed=0; \
756         passed=0; \
757         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
758         if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
759         for i in $(TESTSI_CS); do       \
760                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS); \
761                 then \
762                         passed=`expr $${passed} + 1`; \
763                 else \
764                         if [ $$? = 2 ]; then break; fi; \
765                         failed=`expr $${failed} + 1`; \
766                 fi \
767         done; \
768         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
769
770 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
771         @failed=0; \
772         passed=0; \
773         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
774         if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
775         for i in $(TESTSI_IL); do       \
776                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS); \
777                 then \
778                         passed=`expr $${passed} + 1`; \
779                 else \
780                         if [ $$? = 2 ]; then break; fi; \
781                         failed=`expr $${failed} + 1`; \
782                 fi \
783         done; \
784         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
785
786 testb: $(TEST_PROG) $(TESTBS)
787         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
788         if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
789         for i in $(TESTBS); do  \
790                 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS);  \
791         done
792
793 runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
794         @failed=0; \
795         passed=0; \
796         failed_tests="";\
797         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
798         if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
799         rm -f testlist testlist.sorted; \
800         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do echo $${i} >> testlist; sort testlist > testlist.sorted; done; \
801         for i in `cat testlist.sorted`; do \
802                 rm -f $${i}.so; \
803                 if [ x$(AOT) = x1 ]; then if echo $(AOT_DISABLED_TESTS) | grep -v -q $${i}; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; fi; fi; \
804                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS); \
805                 then \
806                         passed=`expr $${passed} + 1`; \
807                 else \
808                         if [ $$? = 2 ]; then break; fi; \
809                         failed=`expr $${failed} + 1`; \
810                         failed_tests="$${failed_tests} $$i"; \
811                 fi \
812         done; \
813         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
814         rm -f testlist testlist.sorted; \
815         if [ $${failed} != 0 ]; then \
816           echo -e "\nFailed tests:\n"; \
817           for i in $${failed_tests}; do \
818             echo $${i}; \
819             if [ "x$$V" = "x1" ]; then \
820               cat $${i}.stdout; \
821               cat $${i}.stderr; \
822             fi; \
823           done; \
824           exit 1; \
825         fi
826
827 runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
828         if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
829         @$(RUNTIME) ./test-runner.exe -j a --disabled '$${disabled_tests}' $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
830
831 testjit:
832         @if test x$(M) != x; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
833
834 testaot:
835         @$(MAKE) AOT=1 runtest
836
837 testtrace:
838         @$(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" runtest
839
840 testinterp:
841         @$(MAKE) JITTEST_PROG_RUN="$(TEST_PROG_RUN)" runtest
842
843 testjitspeed: $(JITTEST_PROG) $(TESTBS)
844         for i in $(TESTBS); do  \
845                 echo $$i;       \
846                 time $(JITTEST_PROG) $$i;       \
847         done
848
849 test-iomap-regression: exists.cs
850         @$(MCS) $(srcdir)/exists.cs -out:exists.exe
851         @echo "Testing exists.exe..."
852         @MONO_IOMAP=all $(RUNTIME) exists.exe
853
854 stresstest: $(STRESS_TESTS)
855         @failed=0; \
856         passed=0; \
857         failed_tests="";\
858         for i in $(STRESS_TESTS); do    \
859                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
860                 then \
861                         passed=`expr $${passed} + 1`; \
862                 else \
863                         if [ $$? = 2 ]; then break; fi; \
864                         failed=`expr $${failed} + 1`; \
865                         failed_tests="$${failed_tests} $$i"; \
866                 fi \
867         done; \
868         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
869         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
870           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
871
872 testbundle: console.exe
873         @echo "Testing mkbundle..."
874         @$(MKBUNDLE) --static console.exe > mkbundle.stdout
875         @$(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out >> mkbundle.stdout
876         @- rm -rf a.out
877
878 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
879 test-type-load: TestDriver.dll
880         @$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il > /dev/null
881         @$(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
882         @$(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
883         @$(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
884         @echo "Testing load-exception.exe..."
885         @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
886
887 EXTRA_DIST += debug-casts.cs
888 # This depends on TLS, so its not ran by default
889 debug-casts:
890         @$(MCS) -r:TestDriver.dll $(srcdir)/debug-casts.cs
891         @$(RUNTIME) --debug=casts debug-casts.exe
892
893 EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs      finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs sgen-new-threads-dont-join-stw.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs
894
895
896 #those are actually configurations, eg plain_sgen-descriptors.exe
897 #DISABLE_SGEN_TESTS =
898
899 SGEN_TESTS =    \
900         finalizer-wait.exe      \
901         critical-finalizers.exe \
902         sgen-descriptors.exe    \
903         sgen-gshared-vtype.exe  \
904         sgen-domain-unload.exe  \
905         sgen-weakref-stress.exe \
906         sgen-cementing-stress.exe       \
907         sgen-case-23400.exe     \
908         sgen-new-threads-dont-join-stw.exe      \
909         bug-17590.exe
910
911 SGEN_CONFIGURATIONS =   \
912         "|plain"        \
913         "major=marksweep-par|ms-par"    \
914         "major=marksweep-conc|ms-conc"  \
915         "major=marksweep-conc,minor=split|ms-conc-split"        \
916         "minor=split|ms-split"  \
917         "minor=split,alloc-ratio=95|ms-split-95"        \
918         "|plain-clear-at-gc|clear-at-gc"        \
919         "major=marksweep-par|ms-par-clear-at-gc|clear-at-gc"    \
920         "major=marksweep-conc|ms-conc-clear-at-gc|clear-at-gc"  \
921         "minor=split|ms-split-clear-at-gc|clear-at-gc"
922
923
924 #FIXME We should move to use SGEN_CONFIGURATIONS once sgen supports trailling commas or its argument list.
925 SGEN_BRIDGE_CONFIGURATIONS =    \
926         "|plain"        \
927         ",major=marksweep-conc|ms-conc" \
928         ",minor=split|ms-split" \
929         ",bridge-implementation=new|plain-new-bridge"   \
930         ",bridge-implementation=new,major=marksweep-conc|ms-conc-new-bridge"    \
931         ",bridge-implementation=new,minor=split|ms-split-new-bridge"
932
933 sgen-regular-tests: $(SGEN_TESTS)
934         @failed=0; \
935         passed=0; \
936         failed_tests="";\
937         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
938         for test in $+; do      \
939                 echo "...$$test";       \
940                 for conf in $(SGEN_CONFIGURATIONS); do  \
941                         name=`echo $$conf | cut -d\| -f 2`;     \
942                         params=`echo $$conf | cut -d\| -f 1`;   \
943                         debug_opt=`echo $$conf | cut -d\| -f 3`;        \
944                         test_name="$${test}|$${name}";  \
945                         if MONO_GC_PARAMS="$$params" MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="$$debug_opt" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" "$${dump_action}" $(RUNTIME_ARGS);     \
946                         then \
947                                 passed=`expr $${passed} + 1`; \
948                         else \
949                                 if [ $$? = 2 ]; then break; fi; \
950                                 failed=`expr $${failed} + 1`; \
951                                 failed_tests="$${failed_tests} $$test_name"; \
952                         fi \
953                 done    \
954         done;   \
955         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
956         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
957           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
958
959 sgen-bridge-tests1: sgen-bridge.exe sgen-bridge-major-fragmentation.exe
960         @failed=0; \
961         passed=0; \
962         failed_tests="";\
963         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
964         for test in $+; do      \
965                 echo "...$$test";       \
966                 for conf in $(SGEN_BRIDGE_CONFIGURATIONS); do   \
967                         name=`echo $$conf | cut -d\| -f 2`;     \
968                         params=`echo $$conf | cut -d\| -f 1`;   \
969                         test_name="$${test}|$${name}";  \
970                         if MONO_GC_PARAMS="bridge=Bridge$${params}" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" "$${dump_action}" $(RUNTIME_ARGS);  \
971                         then \
972                                 passed=`expr $${passed} + 1`; \
973                         else \
974                                 if [ $$? = 2 ]; then break; fi; \
975                                 failed=`expr $${failed} + 1`; \
976                                 failed_tests="$${failed_tests} $$test_name"; \
977                         fi \
978                 done    \
979         done;   \
980         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
981         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
982           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
983
984 sgen-bridge-tests2: sgen-bridge-xref.exe
985         @failed=0; \
986         passed=0; \
987         failed_tests="";\
988         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
989         for test in $+; do      \
990                 echo "...$$test";       \
991                 for conf in $(SGEN_BRIDGE_CONFIGURATIONS); do   \
992                         name=`echo $$conf | cut -d\| -f 2`;     \
993                         params=`echo $$conf | cut -d\| -f 1`;   \
994                         test_name="$${test}|$${name}";  \
995                         if MONO_GC_PARAMS="bridge=2Bridge$${params}" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" "$${dump_action}" $(RUNTIME_ARGS); \
996                         then \
997                                 passed=`expr $${passed} + 1`; \
998                         else \
999                                 if [ $$? = 2 ]; then break; fi; \
1000                                 failed=`expr $${failed} + 1`; \
1001                                 failed_tests="$${failed_tests} $$test_name"; \
1002                         fi \
1003                 done    \
1004         done;   \
1005         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1006         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1007           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1008
1009 sgen-toggleref-tests: sgen-toggleref.exe
1010         @failed=0; \
1011         passed=0; \
1012         failed_tests="";\
1013         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
1014         for test in $+; do      \
1015                 echo "...$$test";       \
1016                 for conf in $(SGEN_CONFIGURATIONS); do  \
1017                         name=`echo $$conf | cut -d\| -f 2`;     \
1018                         params=`echo $$conf | cut -d\| -f 1`;   \
1019                         test_name="$${test}|$${name}";  \
1020                         if MONO_GC_PARAMS="toggleref-test,$$params" MONO_ENV_OPTIONS="--gc=sgen" $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$test_name "$(DISABLED_TESTS_SGEN)" "$${dump_action}" $(RUNTIME_ARGS);  \
1021                         then \
1022                                 passed=`expr $${passed} + 1`; \
1023                         else \
1024                                 if [ $$? = 2 ]; then break; fi; \
1025                                 failed=`expr $${failed} + 1`; \
1026                                 failed_tests="$${failed_tests} $$test_name"; \
1027                         fi \
1028                 done    \
1029         done;   \
1030         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1031         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1032           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1033
1034 sgen-bridge-tests: sgen-bridge-tests1 sgen-bridge-tests2
1035
1036 sgen-tests: sgen-regular-tests sgen-bridge-tests sgen-toggleref-tests
1037
1038 AOT_CONFIGURATIONS=     \
1039         "|regular"      \
1040         "--gc=boehm|boehm"
1041
1042 #LLVM crashes, got to fix it first.
1043 #       "--llvm|llvm"   \
1044 #       "--llvm --gc=boehm|llvm+boehm"
1045
1046
1047 test-aot:
1048         @failed=0; \
1049         passed=0; \
1050         failed_tests="";\
1051         profile=net_4_5;        \
1052         tmpfile=`mktemp -t mono_aot_output` || exit 1;  \
1053         rm -f test-aot-$${name}.stdout test-aot-$${name}.stderr; \
1054         for assembly in $(mcs_topdir)/class/lib/$$profile/*.dll ; do    \
1055                 asm_name=`basename $$assembly`; \
1056                 echo "... $$asm_name";  \
1057                 for conf in $(AOT_CONFIGURATIONS); do   \
1058                         name=`echo $$conf | cut -d\| -f 2`;     \
1059                         params=`echo $$conf | cut -d\| -f 1`;   \
1060                         test_name="$${asm_name}|$${name}";      \
1061                         echo "  $$test_name";   \
1062                         if MONO_PATH=$(mcs_topdir)/class/lib/$$profile $(JITTEST_PROG_RUN) $$params --aot=outfile=$$tmpfile $$assembly >> test-aot-$${name}.stdout 2>> test-aot-$${name}.stderr;        \
1063                         then \
1064                                 passed=`expr $${passed} + 1`; \
1065                         else \
1066                                 failed=`expr $${failed} + 1`; \
1067                                 failed_tests="$${failed_tests} $$test_name"; \
1068                         fi \
1069                 done;   \
1070         done;   \
1071         rm      $$tmpfile;      \
1072         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1073         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1074         for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1075
1076
1077 # Generated tests for runtime invoke
1078 EXTRA_DIST += gen-runtime-invoke.cs
1079 runtime-invoke.gen.exe: TestDriver.dll gen-runtime-invoke.exe
1080         $(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
1081         $(MCS) -out:runtime-invoke.gen.exe -r:TestDriver.dll runtime-invoke.gen.cs
1082
1083 EXTRA_DIST += make-imt-test.cs
1084 imt_big_iface_test.exe: TestDriver.dll make-imt-test.exe
1085         $(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
1086         $(MCS) -out:imt_big_iface_test.exe -r:TestDriver.dll imt_big_iface_test.cs
1087
1088 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
1089 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
1090         $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
1091 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
1092         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
1093
1094 EXTRA_DIST += unhandled-exception-base-configuration.config
1095 EXTRA_DIST += unhandled-exception-legacy-configuration.config
1096 EXTRA_DIST += appdomain-unload.exe.config
1097 EXTRA_DIST += unhandled-exception-test-case.2.cs
1098 EXTRA_DIST += unhandled-exception-test-runner.2.cs
1099 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
1100         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
1101 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
1102         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
1103 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
1104         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
1105 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
1106         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
1107         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
1108         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
1109         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
1110 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
1111         $(MCS) /debug unhandled-exception-test-case.1.cs
1112 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
1113         $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
1114 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
1115         $(MCS) /debug unhandled-exception-test-case.2.cs
1116 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
1117         $(MCS) /debug unhandled-exception-test-case-legacy.2.cs
1118 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
1119         $(MCS) /debug unhandled-exception-test-runner.2.cs
1120
1121 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
1122         $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
1123
1124 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
1125 bug-80307.exe: $(srcdir)/bug-80307.cs
1126         $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
1127         cd $(top_builddir)/runtime && $(MAKE) test-support-files
1128
1129 EXTRA_DIST += bug-81673-interface.cs
1130 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
1131         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1132         $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
1133         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1134
1135 EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
1136 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
1137         $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
1138         $(MCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
1139         $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
1140         rm -f bug-81691-a.dll
1141 bug-81691.exe: bug-81691-b.dll
1142
1143 EXTRA_DIST += bug-81466-lib.il
1144 bug-81466-lib.dll: bug-81466-lib.il
1145         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
1146 bug-81466.exe: bug-81466.il bug-81466-lib.dll
1147         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
1148
1149 EXTRA_DIST += bug-324535-il.il
1150 bug-324535-il.dll : bug-324535-il.il
1151         $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
1152 bug-324535.exe : bug-324535.cs bug-324535-il.dll
1153         $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
1154
1155 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
1156 custom-modifiers-lib.dll: custom-modifiers-lib.il
1157         $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
1158 custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
1159         $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
1160
1161 EXTRA_DIST += bug-382986-lib.cs
1162 bug-382986-lib.dll: bug-382986-lib.cs
1163         $(MCS) -target:library -out:$@ $(srcdir)/bug-382986-lib.cs
1164 bug-382986.exe: bug-382986.cs bug-382986-lib.dll
1165         $(MCS) -out:$@ -r:bug-382986-lib.dll $(srcdir)/bug-382986.cs
1166
1167 EXTRA_DIST += coreclr-security.cs
1168
1169 coreclr-security.exe : coreclr-security.cs
1170         $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
1171
1172 test-coreclr-security : coreclr-security.exe
1173         @echo "Testing coreclr-security.exe..."
1174         @$(RUNTIME_MOONLIGHT) --security=core-clr-test coreclr-security.exe
1175
1176 EXTRA_DIST += generic-unboxing.2.il
1177 generic-unboxing.2.dll : generic-unboxing.2.il
1178         $(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
1179
1180 EXTRA_DIST += generic-boxing.2.il
1181 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
1182         $(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
1183
1184 EXTRA_DIST += generic-unbox.2.cs
1185 generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
1186         $(MCS) -r:generic-unboxing.2.dll -out:$@ $(srcdir)/generic-unbox.2.cs
1187
1188 EXTRA_DIST += generic-box.2.cs
1189 generic-box.2.exe : generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
1190         $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll -out:$@ $(srcdir)/generic-box.2.cs
1191
1192 EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
1193 generic-delegate2-lib.2.dll : generic-delegate2-lib.2.il
1194         $(ILASM) /dll /output:$@ $(srcdir)/generic-delegate2-lib.2.il
1195 generic-delegate2.2.exe : generic-delegate2.2.cs generic-delegate2-lib.2.dll
1196         $(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
1197
1198 bug-3903.exe: bug-3903.cs
1199         $(MCS) -sdk:2 $(srcdir)/bug-3903.cs -out:$@
1200
1201 gshared: test-generic-sharing
1202
1203 gshared-aot:
1204         @$(MAKE) AOT=1 gshared
1205
1206 GSHARED_TESTS = \
1207                 generics-sharing.2.exe shared-generic-methods.2.exe     \
1208                 shared-generic-synchronized.2.exe generic-initobj.2.exe         \
1209                 generics-sharing-other-exc.2.exe generic-box.2.exe              \
1210                 generic-unbox.2.exe generic-delegate.2.exe generic-sizeof.2.exe \
1211                 generic-ldobj.2.exe generic-mkrefany.2.exe                      \
1212                 generic-refanyval.2.exe generic-ldtoken.2.exe                   \
1213                 generic-ldtoken-method.2.exe  generic-ldtoken-field.2.exe       \
1214                 generic-virtual.2.exe generic-tailcall.2.exe                    \
1215                 generic-interface-methods.2.exe generic-array-type.2.exe        \
1216                 generic-method-patching.2.exe generic-static-methods.2.exe      \
1217                 generic-null-call.2.exe generic-tailcall2.2.exe                 \
1218                 generic-array-exc.2.exe generic-special.2.exe                   \
1219                 generic-exceptions.2.exe generic-delegate2.2.exe                \
1220                 generic-virtual2.2.exe generic-valuetype-interface.2.exe        \
1221                 generic-valuetype-newobj.2.exe generic-valuetype-newobj2.2.exe  \
1222                 generic-getgenericarguments.2.exe generic-type-builder.2.exe    \
1223                 generic-synchronized.2.exe generic-delegate-ctor.2.exe          \
1224                 generic-constrained.2.exe bug-431413.2.exe                      \
1225                 generic-virtual-invoke.2.exe generic-typedef.2.exe              \
1226                 generic-marshalbyref.2.exe bug-459285.2.exe bug-461198.2.exe    \
1227                 generic-sealed-virtual.2.exe generic-system-arrays.2.exe        \
1228                 generic-stack-traces.2.exe generic-stack-traces2.2.exe          \
1229                 bug-472600.2.exe bug-473482.2.exe bug-473999.2.exe              \
1230                 bug-479763.2.exe generic-xdomain.2.exe                          \
1231                 generic-type-load-exception.2.exe bug-616463.exe        \
1232                 bug-1147.exe
1233
1234 test-generic-sharing-normal: $(GSHARED_TESTS)
1235         @for fn in $+ ; do      \
1236                 echo "Testing $$fn ...";        \
1237                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;     \
1238                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,shared         $$fn > $$fn.stdout || exit 1;     \
1239                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline        $$fn > $$fn.stdout || exit 1;     \
1240                 MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared,-inline,shared $$fn > $fn.stdout || exit 1;      \
1241                 if [ x$(AOT) = x1 ]; then MONO_GENERIC_SHARING=all $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; MONO_GENERIC_SHARING=all $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
1242         done
1243
1244 test-generic-sharing-managed: test-runner.exe $(GSHARED_TESTS)
1245         @$(RUNTIME) ./test-runner.exe -j a --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(GSHARED_TESTS)
1246
1247 if NACL_CODEGEN
1248 test-generic-sharing:
1249 else
1250 test-generic-sharing:
1251         @if test x$(M) != x; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
1252 endif
1253
1254 EXTRA_DIST += async-exceptions.cs
1255 async-exceptions.exe : async-exceptions.cs
1256         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
1257 test-async-exceptions : async-exceptions.exe
1258         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
1259         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
1260
1261 EXTRA_DIST += modules.cs modules-m1.cs
1262 modules-m1.netmodule: modules-m1.cs
1263         $(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
1264 modules.exe: modules.cs modules-m1.netmodule TestDriver.dll
1265         $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
1266
1267 # Useful if mono is compiled with --enable-shared=no
1268 patch-libtool:
1269         cp "../../libtool" .
1270         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
1271         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
1272         touch libtest.c
1273
1274
1275 if NACL_CODEGEN
1276 test-process-exit:
1277 else
1278 EXTRA_DIST += bug-438454.cs bug-438454.exe.stdout.expected threadpool-in-processexit.cs threadpool-in-processexit.exe.stdout.expected
1279 test-process-exit:
1280         @$(MCS) $(srcdir)/bug-438454.cs -out:bug-438454.exe
1281         @echo "Testing bug-438454.exe..."
1282         @$(RUNTIME) bug-438454.exe > bug-438454.exe.stdout
1283         @diff -w bug-438454.exe.stdout $(srcdir)/bug-438454.exe.stdout.expected
1284         @$(MCS) $(srcdir)/threadpool-in-processexit.cs -out:threadpool-in-processexit.exe
1285         @echo "Testing threadpool-in-processexit.exe..."
1286         @$(RUNTIME) threadpool-in-processexit.exe > threadpool-in-processexit.exe.stdout
1287         @diff -w threadpool-in-processexit.exe.stdout $(srcdir)/threadpool-in-processexit.exe.stdout.expected
1288 endif
1289
1290 OOM_TESTS =     \
1291         gc-oom-handling.exe     \
1292         gc-oom-handling2.exe
1293
1294
1295 test-oom: $(OOM_TESTS)
1296         @for fn in $+ ; do      \
1297                 echo "Testing $$fn ...";        \
1298                 MONO_GC_PARAMS=max-heap-size=16m,major=marksweep-par MONO_ENV_OPTIONS="--gc=sgen" $(RUNTIME) $$fn > $$fn.stdout || exit 1;      \
1299                 MONO_GC_PARAMS=max-heap-size=16m MONO_ENV_OPTIONS="--gc=sgen"                     $(RUNTIME) $$fn > $$fn.stdout || exit 1;      \
1300                 MONO_GC_PARAMS=max-heap-size=16m                                                  $(RUNTIME) $$fn > $$fn.stdout || exit 1;      \
1301         done
1302
1303
1304 noinst_LTLIBRARIES = libtest.la
1305
1306 AM_CPPFLAGS = $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
1307
1308 if HOST_WIN32
1309 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
1310 # This shows up when compiling mono_test_marshal_delegate ()
1311 libtest_la_CFLAGS=-fno-optimize-sibling-calls
1312 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
1313 # can't find them. So we use --kill-at to remove the @ suffix as well.
1314 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
1315 else
1316 libtest_la_LDFLAGS = -rpath `pwd`
1317 endif
1318 libtest_la_SOURCES = libtest.c
1319 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
1320
1321 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.aotlog *.exe stest.dat