1ac4b05e278feacf7f4fc3b732636356c3f3333d
[mono.git] / mono / tests / Makefile.am
1 SUBDIRS = gc-descriptors . testing_gac
2
3 check-local:
4         $(MAKE) test-jit
5         $(MAKE) test-generic-sharing
6         $(MAKE) test-type-load
7         $(MAKE) test-multi-netmodule
8         $(MAKE) test-cattr-type-load
9         $(MAKE) test-reflection-load-with-context
10         $(MAKE) test-platform
11         $(MAKE) test-console-output
12         $(MAKE) test-env-options
13         $(MAKE) test-unhandled-exception-2
14 if !FULL_AOT_TESTS
15         $(MAKE) test-appdomain-unload
16 endif
17         $(MAKE) test-process-stress
18         $(MAKE) test-pedump
19         $(MAKE) rm-empty-logs
20         $(MAKE) runtest-gac-loading
21
22 check-full:
23         $(MAKE) test-sgen
24         $(MAKE) check-local
25
26 check-parallel:
27         $(MAKE) compile-tests
28         $(MAKE) check-full
29
30 check-coreclr:
31         $(MAKE) -C $(mono_build_root)/acceptance-tests check-coreclr
32
33 check-stress:
34         MONO_TESTS_STRESS=1 $(MAKE) test-sgen
35
36 # for backwards compatibility on Wrench
37 test-wrench: check-parallel
38
39 aotcheck: testaot gshared-aot
40
41 JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
42
43 JITTEST_PROG_RUN = MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
44
45
46 RUNTIME_ARGS=--config tests-config --optimize=all --debug
47
48 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
49
50 with_mono_path = MONO_PATH=$(CLASS)
51
52 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
53 TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper --aot-path=$(mcs_topdir)/class/lib/build
54
55 MKBUNDLE = \
56         PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
57         $(RUNTIME) $(CLASS)/mkbundle.exe
58
59 if FULL_AOT_TESTS
60 PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP 
61 endif
62
63 if HYBRID_AOT_TESTS
64 PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY 
65 endif
66
67 MCS_NO_LIB = $(TOOLS_RUNTIME) $(CSC) -unsafe -debug:portable \
68         -noconfig -nologo \
69         -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
70         -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
71         -nowarn:0197 $(PROFILE_MCS_FLAGS)
72
73 MCS = $(MCS_NO_LIB)
74
75 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
76
77 TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
78
79 if FULL_AOT_TESTS
80 TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
81 endif
82
83 if HYBRID_AOT_TESTS
84 TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
85 endif
86
87 if HOST_WIN32
88 TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),mono)
89 else
90 TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
91 endif
92
93 TEST_RUNNER += $(if $(V), --verbose,)
94
95 TESTS_BENCH_SRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
96
97 TESTS_STRESS_SRC=       \
98         abort-stress-1.cs       \
99         abort-stress-2.cs       \
100         abort-stress-3.cs       \
101         domain-stress.cs        \
102         gchandle-stress.cs      \
103         monitor-stress.cs       \
104         thread-stress.cs        \
105         gc-stress.cs            \
106         gc-copy-stress.cs       \
107         gc-graystack-stress.cs          \
108         exit-stress.cs          \
109         process-stress.cs       \
110         assembly-load-stress.cs
111
112 # Disabled until ?mcs is fixed
113 #       bug-331958.cs
114 TESTS_CS_SRC=           \
115         generic-unloading-sub.2.cs      \
116         create-instance.cs      \
117         bug-2907.cs             \
118         array-init.cs           \
119         arraylist.cs            \
120         assembly-load-remap.cs  \
121         assemblyresolve_event.cs        \
122         assemblyresolve_event3.cs       \
123         assemblyresolve_event4.cs       \
124         checked.cs              \
125         char-isnumber.cs        \
126         field-layout.cs         \
127         pack-layout.cs          \
128         pack-bug.cs             \
129         hash-table.cs           \
130         test-ops.cs             \
131         obj.cs                  \
132         test-dup-mp.cs          \
133         string.cs               \
134         stringbuilder.cs        \
135         switch.cs               \
136         outparm.cs              \
137         delegate.cs             \
138         bitconverter.cs         \
139         exception.cs            \
140         exception2.cs           \
141         exception3.cs           \
142         exception4.cs           \
143         exception5.cs           \
144         exception6.cs           \
145         exception7.cs           \
146         exception8.cs           \
147         exception10.cs          \
148         exception11.cs          \
149         exception12.cs          \
150         exception13.cs          \
151         exception14.cs          \
152         exception15.cs          \
153         exception16.cs          \
154         exception17.cs          \
155         exception18.cs          \
156         typeload-unaligned.cs   \
157         struct.cs               \
158         valuetype-gettype.cs    \
159         typeof-ptr.cs           \
160         static-constructor.cs   \
161         pinvoke.cs              \
162         pinvoke-utf8.cs         \
163         pinvoke3.cs             \
164         pinvoke11.cs            \
165         pinvoke13.cs            \
166         pinvoke17.cs            \
167         invoke.cs               \
168         invoke2.cs              \
169         runtime-invoke.cs               \
170         invoke-string-ctors.cs          \
171         reinit.cs               \
172         box.cs                  \
173         array.cs                \
174         enum.cs                 \
175         enum2.cs                \
176         enum-intrins.cs         \
177         property.cs             \
178         enumcast.cs             \
179         assignable-tests.cs     \
180         array-cast.cs           \
181         array-subtype-attr.cs   \
182         cattr-compile.cs        \
183         cattr-field.cs          \
184         cattr-object.cs         \
185         custom-attr.cs          \
186         double-cast.cs          \
187         newobj-valuetype.cs     \
188         arraylist-clone.cs      \
189         setenv.cs               \
190         vtype.cs                \
191         isvaluetype.cs          \
192         iface6.cs               \
193         iface7.cs               \
194         ipaddress.cs            \
195         array-vt.cs             \
196         interface1.cs           \
197         reflection-enum.cs      \
198         reflection-prop.cs      \
199         reflection4.cs          \
200         reflection5.cs          \
201         reflection-const-field.cs \
202         many-locals.cs          \
203         string-compare.cs       \
204         test-prime.cs           \
205         test-tls.cs             \
206         params.cs               \
207         reflection.cs           \
208         interface.cs            \
209         iface.cs                \
210         iface2.cs               \
211         iface3.cs               \
212         iface4.cs               \
213         iface-large.cs          \
214         virtual-method.cs       \
215         intptrcast.cs           \
216         indexer.cs              \
217         stream.cs               \
218         console.cs              \
219         shift.cs                \
220         jit-int.cs              \
221         jit-uint.cs             \
222         jit-long.cs             \
223         long.cs                 \
224         jit-ulong.cs            \
225         jit-float.cs            \
226         pop.cs                  \
227         time.cs                 \
228         pointer.cs              \
229         hashcode.cs             \
230         delegate1.cs            \
231         delegate2.cs            \
232         delegate3.cs            \
233         delegate5.cs            \
234         delegate6.cs            \
235         delegate7.cs            \
236         delegate8.cs            \
237         delegate10.cs           \
238         delegate11.cs           \
239         delegate12.cs           \
240         delegate13.cs           \
241         largeexp.cs             \
242         largeexp2.cs            \
243         marshalbyref1.cs        \
244         static-ctor.cs          \
245         inctest.cs              \
246         bound.cs                \
247         array-invoke.cs         \
248         test-arr.cs             \
249         decimal.cs              \
250         decimal-array.cs        \
251         marshal.cs              \
252         marshal1.cs             \
253         marshal2.cs             \
254         marshal3.cs             \
255         marshal5.cs             \
256         marshal6.cs             \
257         marshal7.cs             \
258         marshal8.cs             \
259         marshal9.cs             \
260         marshalbool.cs          \
261         test-byval-in-struct.cs \
262         thread.cs               \
263         thread5.cs              \
264         thread-static.cs        \
265         thread-static-init.cs   \
266         context-static.cs       \
267         float-pop.cs            \
268         interfacecast.cs        \
269         array3.cs               \
270         classinit.cs            \
271         classinit2.cs           \
272         classinit3.cs           \
273         synchronized.cs         \
274         async_read.cs           \
275         threadpool.cs           \
276         threadpool1.cs          \
277         threadpool-exceptions1.cs \
278         threadpool-exceptions2.cs \
279         threadpool-exceptions3.cs \
280         threadpool-exceptions4.cs \
281         threadpool-exceptions5.cs \
282         threadpool-exceptions6.cs \
283         base-definition.cs      \
284         bug-27420.cs            \
285         bug-46781.cs            \
286         bug-42136.cs            \
287         bug-59286.cs            \
288         bug-70561.cs            \
289         bug-78311.cs            \
290         bug-78653.cs            \
291         bug-78656.cs            \
292         bug-77127.cs            \
293         bug-323114.cs           \
294         bug-Xamarin-5278.cs     \
295         interlocked.cs          \
296         delegate-async-exit.cs  \
297         delegate-delegate-exit.cs       \
298         delegate-exit.cs        \
299         finalizer-abort.cs      \
300         finalizer-exception.cs  \
301         finalizer-exit.cs       \
302         finalizer-thread.cs     \
303         main-exit.cs    \
304         main-returns-abort-resetabort.cs        \
305         main-returns-background-abort-resetabort.cs     \
306         main-returns-background-resetabort.cs   \
307         main-returns-background.cs      \
308         main-returns-background-change.cs       \
309         main-returns.cs         \
310         subthread-exit.cs       \
311         desweak.cs              \
312         exists.cs               \
313         handleref.cs    \
314         dbnull-missing.cs       \
315         test-type-ctor.cs       \
316         soft-float-tests.cs     \
317         thread-exit.cs          \
318         finalize-parent.cs      \
319         interlocked-2.2.cs      \
320         pinvoke-2.2.cs          \
321         bug-78431.2.cs          \
322         bug-79684.2.cs          \
323         catch-generics.2.cs     \
324         event-get.2.cs          \
325         safehandle.2.cs         \
326         module-cctor-loader.2.cs        \
327         generics-invoke-byref.2.cs      \
328         generic-signature-compare.2.cs  \
329         generics-sharing.2.cs   \
330         shared-generic-methods.2.cs     \
331         shared-generic-synchronized.2.cs        \
332         generic-inlining.2.cs   \
333         generic-initobj.2.cs    \
334         generic-delegate.2.cs   \
335         generic-sizeof.2.cs     \
336         generic-virtual.2.cs    \
337         generic-interface-methods.2.cs  \
338         generic-array-type.2.cs \
339         generic-method-patching.2.cs    \
340         generic-static-methods.2.cs     \
341         generic-null-call.2.cs  \
342         generic-special.2.cs    \
343         generic-exceptions.2.cs \
344         generic-virtual2.2.cs   \
345         generic-valuetype-interface.2.cs        \
346         generic-getgenericarguments.2.cs        \
347         generic-synchronized.2.cs       \
348         generic-delegate-ctor.2.cs      \
349         generic-array-iface-set.2.cs    \
350         generic-typedef.2.cs    \
351         bug-431413.2.cs \
352         bug-459285.2.cs \
353         generic-virtual-invoke.2.cs     \
354         bug-461198.2.cs \
355         generic-sealed-virtual.2.cs     \
356         generic-system-arrays.2.cs      \
357         generic-stack-traces.2.cs       \
358         generic-stack-traces2.2.cs      \
359         bug-472600.2.cs \
360         recursive-generics.2.cs \
361         bug-473482.2.cs \
362         bug-473999.2.cs \
363         bug-479763.2.cs \
364         bug-616463.cs   \
365         bug-80392.2.cs          \
366         bug-82194.2.cs  \
367         anonarray.2.cs  \
368         ienumerator-interfaces.2.cs     \
369         array-enumerator-ifaces.2.cs    \
370         generic_type_definition_encoding.2.cs \
371         bug-333798.2.cs         \
372         bug-348522.2.cs         \
373         bug-340662_bug.cs       \
374         bug-325283.2.cs \
375         thunks.cs \
376         winx64structs.cs \
377         nullable_boxing.2.cs    \
378         valuetype-equals.cs     \
379         custom-modifiers.2.cs   \
380         bug-382986.cs   \
381         test-inline-call-stack.cs       \
382         bug-324535.cs   \
383         modules.cs      \
384         bug-81673.cs    \
385         bug-81691.cs    \
386         bug-415577.cs   \
387         filter-stack.cs \
388         vararg.cs       \
389         vararg2.cs      \
390         bug-461867.cs   \
391         bug-461941.cs   \
392         bug-461261.cs   \
393         bug-400716.cs   \
394         bug-459094.cs   \
395         bug-467456.cs   \
396         bug-508538.cs   \
397         bug-472692.2.cs         \
398         gchandles.cs    \
399         interlocked-3.cs        \
400         interlocked-4.2.cs      \
401         w32message.cs   \
402         gc-altstack.cs  \
403         large-gc-bitmap.cs      \
404         bug-561239.cs   \
405         bug-562150.cs   \
406         bug-599469.cs   \
407         monitor-resurrection.cs \
408         monitor-wait-abort.cs   \
409         monitor-abort.cs        \
410         bug-666008.cs   \
411         bug-685908.cs   \
412         sgen-long-vtype.cs      \
413         delegate-invoke.cs      \
414         bug-696593.cs   \
415         bug-705140.cs   \
416         bug-1147.cs     \
417         mono-path.cs    \
418         bug-bxc-795.cs  \
419         bug-3903.cs     \
420         async-with-cb-throws.cs \
421         bug-6148.cs     \
422         bug-10127.cs    \
423         bug-18026.cs    \
424         allow-synchronous-major.cs      \
425         block_guard_restore_aligment_on_exit.cs \
426         thread_static_gc_layout.cs \
427         sleep.cs \
428         bug-27147.cs    \
429         bug-30085.cs    \
430         bug-17537.cs    \
431         pinvoke_ppcc.cs \
432         pinvoke_ppcs.cs \
433         pinvoke_ppci.cs \
434         pinvoke_ppcf.cs \
435         pinvoke_ppcd.cs \
436         bug-29585.cs    \
437         priority.cs     \
438         abort-cctor.cs  \
439         thread-native-exit.cs \
440         reference-loader.cs \
441         thread-suspend-suspended.cs \
442         thread-suspend-selfsuspended.cs \
443         remoting4.cs    \
444         remoting1.cs    \
445         remoting2.cs    \
446         remoting3.cs    \
447         remoting5.cs    \
448         appdomain.cs    \
449         appdomain-client.cs     \
450         appdomain-unload.cs     \
451         appdomain-async-invoke.cs       \
452         appdomain-thread-abort.cs       \
453         appdomain1.cs   \
454         appdomain2.cs   \
455         appdomain-exit.cs       \
456         assemblyresolve_event2.2.cs     \
457         appdomain-unload-callback.cs    \
458         appdomain-unload-doesnot-raise-pending-events.cs        \
459         unload-appdomain-on-shutdown.cs \
460         bug-47295.cs    \
461         loader.cs       \
462         pinvoke2.cs     \
463         generic-type-builder.2.cs       \
464         dynamic-generic-size.cs \
465         cominterop.cs   \
466         dynamic-method-access.2.cs      \
467         dynamic-method-finalize.2.cs    \
468         dynamic-method-stack-traces.cs  \
469         generic_type_definition.2.cs    \
470         bug-333798-tb.2.cs      \
471         bug-335131.2.cs \
472         bug-322722_patch_bx.2.cs        \
473         bug-322722_dyn_method_throw.2.cs        \
474         bug-389886-2.cs \
475         bug-349190.2.cs \
476         bug-389886-sre-generic-interface-instances.cs   \
477         bug-462592.cs   \
478         bug-575941.cs   \
479         bug-389886-3.cs \
480         constant-division.cs    \
481         dynamic-method-resurrection.cs  \
482         bug-80307.cs    \
483         assembly_append_ordering.cs     \
484         bug-544446.cs   \
485         bug-36848.cs    \
486         generic-marshalbyref.2.cs       \
487         stackframes-async.2.cs  \
488         transparentproxy.cs     \
489         bug-48015.cs    \
490         delegate9.cs    \
491         marshal-valuetypes.cs   \
492         xdomain-threads.cs      \
493         monitor.cs      \
494         generic-xdomain.2.cs    \
495         threadpool-exceptions7.cs       \
496         cross-domain.cs \
497         generic-unloading.2.cs  \
498         namedmutex-destroy-race.cs      \
499         thread6.cs      \
500         appdomain-threadpool-unload.cs  \
501         process-unref-race.cs   \
502         bug-46661.cs    \
503         w32message.cs \
504         runtime-invoke.gen.cs \
505         imt_big_iface_test.cs
506
507 if AMD64
508 TESTS_CS_SRC += async-exc-compilation.cs finally_guard.cs finally_block_ending_in_dead_bb.cs
509 endif
510
511 if X86
512 TESTS_CS_SRC += async-exc-compilation.cs finally_guard.cs finally_block_ending_in_dead_bb.cs
513 endif
514
515 if IA64
516 TESTS_CS_SRC += async-exc-compilation.cs filter-stack.cs
517 endif
518
519 TESTS_IL_SRC=                   \
520         field-access.il         \
521         method-access.il        \
522         ldftn-access.il         \
523         cpblkTest.il            \
524         vbinterface.il          \
525         calliTest.il            \
526         calliGenericTest.il             \
527         ckfiniteTest.il         \
528         fault-handler.il                \
529         locallocTest.il         \
530         initblkTest.il          \
531         qt-instance.il          \
532         vararg.il               \
533         bug-29859.il            \
534         bug-78549.il            \
535         static-fields-nonconst.il       \
536         reload-at-bb-end.il     \
537         test-enum-indstoreil.il \
538         filter-bug.il           \
539         even-odd.il             \
540         bug-82022.il    \
541         vt-sync-method.il       \
542         enum_types.il   \
543         invalid-token.il        \
544         call_missing_method.il  \
545         call_missing_class.il   \
546         ldfld_missing_field.il  \
547         ldfld_missing_class.il  \
548         find-method.2.il        \
549         bug-79215.2.il  \
550         bug-79956.2.il  \
551         bug-327438.2.il \
552         bug-387274.2.il \
553         bug-426309.2.il \
554         ldtoken_with_byref_typespec.2.il \
555         resolve_method_bug.2.il \
556         resolve_field_bug.2.il \
557         resolve_type_bug.2.il   \
558         generics-sharing-other-exc.2.il \
559         generic-ldobj.2.il      \
560         generic-mkrefany.2.il   \
561         generic-refanyval.2.il  \
562         generic-ldtoken.2.il    \
563         generic-ldtoken-method.2.il     \
564         generic-ldtoken-field.2.il      \
565         generic-tailcall.2.il   \
566         generic-tailcall2.2.il  \
567         generic-array-exc.2.il  \
568         generic-valuetype-newobj2.2.il  \
569         generic-valuetype-newobj.2.il   \
570         generic-constrained.2.il        \
571         generic-type-load-exception.2.il        \
572         bug-81466.il    \
573         bug457574.il    \
574         bug445361.il    \
575         bug-463303.il   \
576         bug469742.2.il  \
577         bug-528055.il   \
578         array_load_exception.il \
579         bug-481403.il   \
580         interface-with-static-method.il \
581         bug-633291.il   \
582         delegate-with-null-target.il    \
583         bug-318677.il   \
584         gsharing-valuetype-layout.il    \
585         invalid_generic_instantiation.il \
586         bug-45841-fpstack-exceptions.il \
587         instance_tailrec.il
588
589 TESTS_GSHARED_SRC = \
590         generics-sharing.2.cs   \
591         shared-generic-methods.2.cs     \
592         shared-generic-synchronized.2.cs        \
593         generic-initobj.2.cs            \
594         generics-sharing-other-exc.2.cs \
595         generic-box.2.cs                \
596         generic-unbox.2.cs      \
597         generic-delegate.2.cs   \
598         generic-sizeof.2.cs     \
599         generic-ldobj.2.cs      \
600         generic-mkrefany.2.cs                   \
601         generic-refanyval.2.cs  \
602         generic-ldtoken.2.cs                    \
603         generic-ldtoken-method.2.cs     \
604         generic-ldtoken-field.2.cs      \
605         generic-virtual.2.cs    \
606         generic-tailcall.2.cs                   \
607         generic-interface-methods.2.cs  \
608         generic-array-type.2.cs \
609         generic-method-patching.2.cs    \
610         generic-static-methods.2.cs     \
611         generic-null-call.2.cs  \
612         generic-tailcall2.2.cs                  \
613         generic-array-exc.2.cs  \
614         generic-special.2.cs                    \
615         generic-exceptions.2.cs \
616         generic-delegate2.2.cs          \
617         generic-virtual2.2.cs   \
618         generic-valuetype-interface.2.cs        \
619         generic-valuetype-newobj.2.cs   \
620         generic-valuetype-newobj2.2.cs  \
621         generic-getgenericarguments.2.cs        \
622         generic-synchronized.2.cs       \
623         generic-delegate-ctor.2.cs              \
624         generic-constrained.2.cs        \
625         bug-431413.2.cs                 \
626         generic-virtual-invoke.2.cs     \
627         generic-typedef.2.cs            \
628         generic-marshalbyref.2.cs       \
629         bug-459285.2.cs \
630         bug-461198.2.cs \
631         generic-sealed-virtual.2.cs     \
632         generic-system-arrays.2.cs      \
633         generic-stack-traces.2.cs       \
634         generic-stack-traces2.2.cs              \
635         bug-472600.2.cs \
636         bug-473482.2.cs \
637         bug-473999.2.cs         \
638         bug-479763.2.cs                         \
639         generic-type-load-exception.2.cs        \
640         bug-616463.cs   \
641         bug-1147.cs     \
642         generic-type-builder.2.cs
643
644 if AMD64
645 # #651684
646 PLATFORM_DISABLED_TESTS = finally_guard.exe
647
648 if HOST_WIN32
649 PLATFORM_DISABLED_TESTS += w32message.exe
650 endif
651
652 endif
653
654 if IA64
655 # bug #319249
656 PLATFORM_DISABLED_TESTS=exception17.exe
657 PLATFORM_DISABLED_TESTS+=winx64structs.exe
658 endif
659
660 if X86
661
662 if HOST_WIN32
663 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
664         bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe w32message.exe \
665         unhandled-exception-1.exe unhandled-exception-2.exe unhandled-exception-3.exe unhandled-exception-4.exe \
666         unhandled-exception-5.exe unhandled-exception-6.exe unhandled-exception-7.exe unhandled-exception-8.exe
667 endif
668
669 endif
670
671 if POWERPC
672 # bug #71274
673 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
674 endif
675
676 if POWERPC64
677 # FIXME: These tests hang/fail for unknown reasons
678 PLATFORM_DISABLED_TESTS=monitor.exe threadpool-exceptions5.exe appdomain-thread-abort.exe appdomain-unload.exe \
679         pinvoke2.exe pinvoke3.exe pinvoke11.exe threadpool-exceptions7.exe winx64structs.exe bug-10127.exe pinvoke_ppcc.exe \
680         pinvoke_ppcs.exe pinvoke_ppci.exe pinvoke_ppcf.exe pinvoke_ppcd.exe abort-cctor.exe load-exceptions.exe \
681         sgen-domain-unload-2.exe sgen-weakref-stress.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw.exe \
682         sgen-new-threads-dont-join-stw-2.exe sgen-new-threads-collect.exe sgen-bridge.exe
683 endif
684
685 if ARM
686 PLATFORM_DISABLED_TESTS=filter-stack.exe
687 endif
688
689 if MIPS
690 # monitor.exe is racy
691 PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
692 endif
693
694 if S390X
695 PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
696 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
697
698 PLATFORM_DISABLED_TESTS += \
699         sgen-toggleref.exe \
700         sgen-bridge.exe \
701         sgen-bridge-major-fragmentation.exe \
702         sgen-bridge-xref.exe
703 endif
704
705 if NACL_CODEGEN
706 # Tests that use Thread.Abort()
707 PLATFORM_DISABLED_TESTS= abort-stress-1.exe \
708                          abort-stress-2.exe \
709                          abort-stress-3.exe \
710                          appdomain-thread-abort.exe \
711                          async-exc-compilation.exe \
712                          bug-561239.exe \
713                          bug-70561.exe \
714                          finalizer-abort.exe \
715                          finally_guard.exe \
716                          finally_block_ending_in_dead_bb.exe \
717                          main-returns-abort-resetabort.exe \
718                          main-returns-background-abort-resetabort.exe \
719                          thread6.exe \
720                          threadpool-exceptions5.exe \
721                          threadpool-exceptions6.exe
722
723 PLATFORM_DISABLED_TESTS+= w32message.exe
724
725 # Tests that rely on AppDomain.Unload
726 PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
727                           appdomain-exit.exe \
728                           appdomain-unload-callback.exe \
729                           appdomain-unload.exe \
730                           domain-stress.exe \
731                           generic-unloading.2.exe \
732                           monitor.exe \
733                           remoting4.exe \
734                           threadpool-exceptions7.exe \
735                           xdomain-threads.exe
736
737 # pinvoke2 attaches a thread to the runtime, but
738 # doesn't 'unattach' it and it hangs in GC on exit
739 PLATFORM_DISABLED_TESTS+= pinvoke2.exe
740
741 # Tests that currently hang waiting for non-main threads
742 # to exit in NaCl, need to investigate.  Most are AppDomain
743 # creation and Delegate tests.
744 PLATFORM_DISABLED_TESTS+= appdomain1.exe \
745                           delegate9.exe \
746                           marshal-valuetypes.exe \
747                           cross-domain.exe \
748                           stackframes-async.2.exe \
749                           generic-marshalbyref.2.exe \
750                           generic-xdomain.2.exe \
751                           bug-415577.exe
752
753 # Tests that fail trying to write files (appdomain create mostly)
754 PLATFORM_DISABLED_TESTS+= bug-335131.2.exe \
755                           bug-349190.2.exe \
756                           bug-80307.exe \
757                           bug-462592.exe
758
759 # FIXME: don't know why delegate2.exe fails, it shouldn't
760 PLATFORM_DISABLED_TESTS+= delegate2.exe
761
762 # These tests newly fail with the latest revision. pinvoke3 fails because
763 # of a thread attach, the others have not been investigated.  TODO revisit.
764 PLATFORM_DISABLED_TESTS+= pinvoke3.exe \
765                           async_read.exe \
766                           async-with-cb-throws.exe \
767                           appdomain-unload-doesnot-raise-pending-events.exe \
768                           gsharing-valuetype-layout.exe
769
770 if X86
771 # FIXME: There are problems with async callbacks and results on NaCl 32-bit
772 PLATFORM_DISABLED_TESTS+= delegate1.exe \
773                           delegate3.exe \
774                           delegate5.exe \
775                           delegate8.exe \
776                           threadpool.exe \
777                           threadpool1.exe \
778                           threadpool-exceptions3.exe \
779                           bug-323114.exe \
780                           delegate-exit.exe \
781                           bug-80392.2.exe
782
783 # FIXME: These tests hang/fail for unknown reasons, deal with exiting
784 PLATFORM_DISABLED_TESTS+= main-returns-background-resetabort.exe \
785                           main-returns-background.exe \
786                           main-returns-background-change.exe
787 endif
788
789 endif
790
791 if ENABLE_COOP
792 COOP_DISABLED_TESTS= thunks.exe
793 else
794 COOP_DISABLED_TESTS= 
795 endif
796
797 PROFILE_DISABLED_TESTS=
798
799 if FULL_AOT_TESTS
800 # Tests which rely on TypeLoadExceptions
801 # In full-aot mode, these cause the relevant methods to be not AOTed.
802 PROFILE_DISABLED_TESTS += \
803         typeload-unaligned.exe \
804         field-access.exe \
805         invalid_generic_instantiation.exe \
806         bug-481403.exe \
807         array_ldelema.exe \
808         array_load_exception.exe \
809         bug445361.exe \
810         generic-type-load-exception.2.exe \
811         invalid-token.exe \
812         call_missing_method.exe \
813         call_missing_class.exe \
814         ldfld_missing_field.exe \
815         ldfld_missing_class.exe \
816         vt-sync-method.exe
817
818 # Tests which rely on remoting
819 PROFILE_DISABLED_TESTS += \
820         context-static.exe \
821         bug-415577.exe \
822         generic-marshalbyref.2.exe \
823         unhandled-exception-7.exe
824
825 # Tests which use unsupported pinvoke+full aot
826 # functionality
827 PROFILE_DISABLED_TESTS += \
828         marshal.exe \
829         marshal2.exe \
830         marshal6.exe \
831         marshal7.exe \
832         marshal8.exe \
833         pinvoke-2.2.exe \
834         pinvoke3.exe \
835         thunks.exe
836
837 # Tests which load assemblies which are not
838 # in the testing_aot_full profile
839 PROFILE_DISABLED_TESTS += \
840         assembly-load-remap.exe
841
842 # Test which needs remoting support
843 PROFILE_DISABLED_TESTS += \
844         remoting4.exe   \
845         remoting1.exe   \
846         remoting2.exe   \
847         remoting3.exe   \
848         remoting5.exe
849
850 # Tests which needs AppDomain support
851 PROFILE_DISABLED_TESTS += \
852         appdomain.exe   \
853         appdomain-client.exe    \
854         appdomain-unload.exe    \
855         appdomain-async-invoke.exe      \
856         appdomain-thread-abort.exe      \
857         appdomain1.exe  \
858         appdomain2.exe  \
859         appdomain-exit.exe      \
860         appdomain-unload-callback.exe   \
861         appdomain-unload-doesnot-raise-pending-events.exe       \
862         unload-appdomain-on-shutdown.exe        \
863         assemblyresolve_event2.2.exe    \
864         bug-544446.exe  \
865         bug-36848.exe   \
866         generic-marshalbyref.2.exe      \
867         stackframes-async.2.exe \
868         transparentproxy.exe    \
869         bug-48015.exe   \
870         delegate9.exe   \
871         marshal-valuetypes.exe  \
872         xdomain-threads.exe     \
873         monitor.exe     \
874         generic-xdomain.2.exe   \
875         threadpool-exceptions7.exe      \
876         cross-domain.exe        \
877         generic-unloading.2.exe \
878         appdomain-threadpool-unload.exe
879
880 # Tests which needs System.Reflection.Emit support
881 PROFILE_DISABLED_TESTS += \
882         bug-47295.exe   \
883         loader.exe      \
884         pinvoke2.exe    \
885         generic-type-builder.2.exe      \
886         dynamic-generic-size.exe        \
887         cominterop.exe  \
888         dynamic-method-access.2.exe     \
889         dynamic-method-finalize.2.exe   \
890         dynamic-method-stack-traces.exe \
891         generic_type_definition.2.exe   \
892         bug-333798-tb.2.exe     \
893         bug-335131.2.exe        \
894         bug-322722_patch_bx.2.exe       \
895         bug-322722_dyn_method_throw.2.exe       \
896         bug-389886-2.exe        \
897         bug-349190.2.exe        \
898         bug-389886-sre-generic-interface-instances.exe  \
899         bug-462592.exe  \
900         bug-575941.exe  \
901         bug-389886-3.exe        \
902         constant-division.exe   \
903         dynamic-method-resurrection.exe \
904         assembly_append_ordering.exe
905
906 # Test which needs System.Web support
907 PROFILE_DISABLED_TESTS += \
908         bug-80307.exe
909
910 # Tests which needs named Mutex support
911 PROFILE_DISABLED_TESTS += \
912         namedmutex-destroy-race.exe
913
914 # ThreadAbortException doesn't have necessary field for this test
915 PROFILE_DISABLED_TESTS += \
916         thread6.exe
917
918 # can't AOT the TestingReferenceAssembly.dll which is a dependency
919 # of reference-loader.exe because it contains the [ReferenceAssemblyAttribute]
920 # and the runtime errors out with "File does not contain a valid CIL image."
921 PROFILE_DISABLED_TESTS += \
922         reference-loader.exe
923
924 # constraints-load.il: 
925 # Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to 
926 # Could not resolve type with token 01000002 assembly:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.BrokenIComparable`1 member:<none>.
927 PROFILE_DISABLED_TESTS += \
928         constraints-load.exe \
929         bug-515884.exe
930
931 PROFILE_DISABLED_TESTS += \
932         generic-type-builder.2.exe
933
934 PROFILE_DISABLED_TESTS += \
935         sgen-domain-unload.exe  \
936         sgen-domain-unload-2.exe
937
938 PROFILE_DISABLED_TESTS += \
939         appdomain-loader.exe
940 endif
941
942 if HYBRID_AOT_TESTS
943 PROFILE_DISABLED_TESTS += \
944         bug-80307.exe \
945         namedmutex-destroy-race.exe
946 endif
947
948 AOT_DISABLED_TESTS= \
949         constraints-load.exe
950
951 CI_DISABLED_TESTS = \
952         main-returns-background-resetabort.exe \
953         main-returns-background-abort-resetabort.exe    \
954         assemblyresolve_event3.exe \
955         delegate2.exe   \
956         finally_guard.exe \
957         generic-xdomain.2.exe
958
959 # failing tests which we temporarily disable for PRs
960 # so they don't interfere with other people's work
961 CI_PR_DISABLED_TESTS = \
962         appdomain-threadpool-unload.exe \
963         appdomain-thread-abort.exe
964
965 # appdomain-threadpool-unload.exe creates 100 appdomains, takes too long with llvm
966 LLVM_DISABLED_TESTS = \
967         appdomain-threadpool-unload.exe
968
969 LLVM = $(filter --llvm, $(MONO_ENV_OPTIONS))
970
971 # The two finalizer tests only work under sgen
972 # gc-altstack.exe fails under boehm because it has no support for altstack
973 # bug-459094.exe creates an extremely deep directory tree
974 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
975 # reverted.
976 # bug-Xamarin-5278.exe got broken by 5d26590e79da139a284459299aee95c25f4cd835
977 # bug-45841-fpstack-exceptions.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47053
978 # appdomain-thread-abort.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47054
979 KNOWN_FAILING_TESTS = \
980         delegate-async-exception.exe    \
981         bug-348522.2.exe        \
982         bug-459094.exe \
983         delegate-invoke.exe \
984         bug-Xamarin-5278.exe \
985         bug-45841-fpstack-exceptions.exe \
986         appdomain-thread-abort.exe
987
988 DISABLED_TESTS = \
989         $(KNOWN_FAILING_TESTS) \
990         $(PLATFORM_DISABLED_TESTS) \
991         $(EXTRA_DISABLED_TESTS) \
992         $(COOP_DISABLED_TESTS) \
993         $(PROFILE_DISABLED_TESTS) \
994         $(if $(AOT),$(AOT_DISABLED_TESTS)) \
995         $(if $(CI),$(CI_DISABLED_TESTS)) \
996         $(if $(CI_PR),$CI_PR_DISABLED_TESTS) \
997         $(if $(LLVM),$(LLVM_DISABLED_TESTS))
998
999 INTERP_DISABLED_TESTS = \
1000         $(CI_PR_DISABLED_TESTS) \
1001         $(CI_DISABLED_TESTS) \
1002         $(KNOWN_FAILING_TESTS) \
1003         abort-cctor.exe \
1004         appdomain-async-invoke.exe \
1005         appdomain-exit.exe \
1006         appdomain-unload-callback.exe \
1007         appdomain-unload-doesnot-raise-pending-events.exe \
1008         appdomain-unload.exe \
1009         appdomain.exe \
1010         appdomain1.exe \
1011         appdomain2.exe \
1012         array_load_exception.exe \
1013         assembly_append_ordering.exe \
1014         assemblyresolve_event4.exe \
1015         async-exc-compilation.exe \
1016         async-with-cb-throws.exe \
1017         async_read.exe \
1018         bug-18026.exe \
1019         bug-2907.exe \
1020         bug-323114.exe \
1021         bug-327438.2.exe \
1022         bug-335131.2.exe \
1023         bug-415577.exe \
1024         bug-461867.exe \
1025         bug-461941.exe \
1026         bug-46661.exe \
1027         bug-47295.exe \
1028         bug-48015.exe \
1029         bug-544446.exe \
1030         bug-685908.exe \
1031         bug-80307.exe \
1032         bug-80392.2.exe \
1033         bug-81673.exe \
1034         bug-82022.exe \
1035         bug445361.exe \
1036         call_missing_class.exe \
1037         call_missing_method.exe \
1038         calliGenericTest.exe \
1039         cominterop.exe \
1040         constant-division.exe \
1041         context-static.exe \
1042         cross-domain.exe \
1043         delegate-async-exit.exe \
1044         delegate-delegate-exit.exe \
1045         delegate-exit.exe \
1046         delegate-with-null-target.exe \
1047         delegate1.exe \
1048         delegate3.exe \
1049         delegate5.exe \
1050         delegate8.exe \
1051         delegate9.exe \
1052         dynamic-method-access.2.exe \
1053         dynamic-method-finalize.2.exe \
1054         dynamic-method-resurrection.exe \
1055         dynamic-method-stack-traces.exe \
1056         even-odd.exe \
1057         exception18.exe \
1058         field-access.exe \
1059         finally_block_ending_in_dead_bb.exe \
1060         generic-marshalbyref.2.exe \
1061         generic-mkrefany.2.exe \
1062         generic-refanyval.2.exe \
1063         generic-stack-traces2.2.exe \
1064         generic-type-load-exception.2.exe \
1065         generic-unloading.2.exe \
1066         generics-invoke-byref.2.exe \
1067         generics-sharing.2.exe \
1068         handleref.exe \
1069         invalid-token.exe \
1070         invalid_generic_instantiation.exe \
1071         ldfld_missing_class.exe \
1072         ldfld_missing_field.exe \
1073         ldftn-access.exe \
1074         main-returns-background-change.exe \
1075         marshal-valuetypes.exe \
1076         marshal.exe \
1077         marshal2.exe \
1078         marshal8.exe \
1079         marshal9.exe \
1080         marshalbool.exe \
1081         method-access.exe \
1082         monitor.exe \
1083         nullable_boxing.2.exe \
1084         pinvoke-2.2.exe \
1085         pinvoke-utf8.exe \
1086         pinvoke.exe \
1087         pinvoke11.exe \
1088         pinvoke2.exe \
1089         pinvoke3.exe \
1090         pinvoke_ppcc.exe \
1091         pinvoke_ppcd.exe \
1092         pinvoke_ppcf.exe \
1093         pinvoke_ppci.exe \
1094         pinvoke_ppcs.exe \
1095         process-unref-race.exe \
1096         reload-at-bb-end.exe \
1097         remoting1.exe \
1098         remoting2.exe \
1099         remoting3.exe \
1100         remoting4.exe \
1101         remoting5.exe \
1102         safehandle.2.exe \
1103         stackframes-async.2.exe \
1104         static-constructor.exe \
1105         test-inline-call-stack.exe \
1106         test-type-ctor.exe \
1107         thread6.exe \
1108         threadpool-exceptions1.exe \
1109         threadpool-exceptions2.exe \
1110         threadpool-exceptions3.exe \
1111         threadpool-exceptions4.exe \
1112         threadpool-exceptions5.exe \
1113         threadpool-exceptions6.exe \
1114         threadpool-exceptions7.exe \
1115         threadpool.exe \
1116         threadpool1.exe \
1117         thunks.exe \
1118         transparentproxy.exe \
1119         typeload-unaligned.exe \
1120         unload-appdomain-on-shutdown.exe \
1121         vararg.exe \
1122         vararg2.exe \
1123         vt-sync-method.exe \
1124         winx64structs.exe \
1125         xdomain-threads.exe
1126
1127 TESTS_CS=$(filter-out $(DISABLED_TESTS),$(TESTS_CS_SRC:.cs=.exe))
1128 TESTS_IL=$(filter-out $(DISABLED_TESTS),$(TESTS_IL_SRC:.il=.exe))
1129 TESTS_BENCH=$(filter-out $(DISABLED_TESTS),$(TESTS_BENCH_SRC:.cs=.exe))
1130 TESTS_STRESS=$(filter-out $(DISABLED_TESTS),$(TESTS_STRESS_SRC:.cs=.exe))
1131 TESTS_GSHARED=$(filter-out $(DISABLED_TESTS),$(TESTS_GSHARED_SRC:.cs=.exe))
1132
1133 if FULL_AOT_TESTS
1134 TESTSAOT_CS=$(TESTS_CS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1135 TESTSAOT_IL=$(TESTS_IL:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1136 TESTSAOT_BENCH=$(TESTS_BENCH:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1137 TESTSAOT_STRESS=$(TESTS_STRESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1138 TESTSAOT_GSHARED=$(TESTS_GSHARED:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1139 endif
1140
1141 if HYBRID_AOT_TESTS
1142 TESTSAOT_CS=$(TESTS_CS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1143 TESTSAOT_IL=$(TESTS_IL:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1144 TESTSAOT_BENCH=$(TESTS_BENCH:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1145 TESTSAOT_STRESS=$(TESTS_STRESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1146 TESTSAOT_GSHARED=$(TESTS_GSHARED:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1147 endif
1148
1149 EXTRA_DIST=test-driver test-runner.cs $(TESTS_CS_SRC) $(TESTS_IL_SRC) \
1150         $(TESTS_BENCH_SRC) $(TESTS_STRESS_SRC) stress-runner.pl
1151
1152 %.exe: %.il
1153         $(ILASM) -out:$@ $<
1154
1155 if !FULL_AOT_TESTS
1156 if !HYBRID_AOT_TESTS
1157 TEST_DRIVER_HARD_KILL_FEATURE=-r:$(CLASS)/Mono.Posix.dll
1158 endif
1159 endif
1160
1161 if FULL_AOT_TESTS
1162 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
1163 else
1164 if HYBRID_AOT_TESTS
1165 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
1166 else
1167 TEST_DRIVER_DEPEND=TestDriver.dll
1168 endif
1169 endif
1170
1171 %.exe: %.cs $(TEST_DRIVER_DEPEND)
1172         $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
1173
1174 # N.B. test-runner.exe references the TOOLS_RUNTIME versions of the framework assemblies
1175 test-runner.exe: test-runner.cs $(TEST_DRIVER_DEPEND)
1176         $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
1177
1178 %.dll: %.cs
1179         $(MCS) -r:$(CLASS)/System.dll -target:library -out:$@ $<
1180 %.dll: %.il
1181         $(ILASM) /dll /output:$@ $<
1182
1183 reference-loader.exe: reference-loader.cs TestingReferenceAssembly.dll TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_DEPEND)
1184         $(MCS) -r:$(CLASS)/System.dll -r:TestDriver.dll -r:TestingReferenceAssembly.dll -r:TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $(srcdir)/reference-loader.cs
1185
1186 TestingReferenceAssembly.dll: TestingReferenceAssembly.cs
1187         $(MCS) -target:library -out:$@ $<
1188
1189 TestingReferenceReferenceAssembly.dll: TestingReferenceReferenceAssembly.cs TestingReferenceAssembly.dll
1190         $(MCS) -r:TestingReferenceAssembly.dll -target:library -out:$@ $<
1191
1192 %.exe$(PLATFORM_AOT_SUFFIX): %.exe 
1193         $(RUNTIME) $(AOT_BUILD_FLAGS) $<
1194
1195 %.dll$(PLATFORM_AOT_SUFFIX): %.dll 
1196         $(RUNTIME) $(AOT_BUILD_FLAGS) $<
1197
1198 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
1199 if POWERPC
1200 test-platform:
1201 else
1202 # Can't use mkbundle on win32 since there is no static build there
1203 # Can't run test-unhandled-exception on Windows because of all the debug popups...
1204 if HOST_WIN32
1205 test-platform:
1206 else
1207 # mkbundle uses the installed mono-2.pc so it won't work if there is no system mono
1208 #test-platform: testbundle test-iomap-regression
1209 test-platform:  test-iomap-regression
1210 endif
1211 endif
1212
1213 if X86
1214 if HOST_WIN32
1215 else
1216 test-platform: test-eglib-remap
1217 endif
1218 endif
1219
1220 # Target to precompile the test executables
1221 tests: compile-tests
1222
1223 #
1224 # Test that no symbols are missed in eglib-remap.h
1225 #
1226 OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file\|g_Ctoc\'
1227 if NACL_CODEGEN
1228 test-eglib-remap:
1229 else
1230 test-eglib-remap:
1231         @echo "Testing eglib remap..."
1232         @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
1233 endif
1234
1235 test-env-options:
1236         MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
1237
1238 # Precompile the test assemblies in parallel
1239 compile-tests:
1240         $(MAKE) -j4 $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTS_GSHARED) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) $(TESTSAOT_GSHARED) compile-gac-loading
1241
1242 # Remove empty .stdout and .stderr files for wrench
1243 rm-empty-logs:
1244         @echo "Removing empty logs..."
1245         find . '(' -name "*.stdout" -o -name "*.stderr" ')' -size 0 -exec rm {} \;
1246
1247 TestDriver.dll:
1248         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs $(srcdir)/../mini/TestHelpers.cs
1249
1250 runtest: compile-tests
1251         @failed=0; \
1252         passed=0; \
1253         failed_tests="";\
1254         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
1255         rm -f testlist testlist.sorted; \
1256         for i in $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH); do echo $${i} >> testlist; sort testlist > testlist.sorted; done; \
1257         for i in `cat testlist.sorted`; do \
1258                 rm -f $${i}.so; \
1259                 $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; \
1260                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" "$${dump_action}" $(RUNTIME_ARGS); \
1261                 then \
1262                         passed=`expr $${passed} + 1`; \
1263                 else \
1264                         if [ $$? = 2 ]; then break; fi; \
1265                         failed=`expr $${failed} + 1`; \
1266                         failed_tests="$${failed_tests} $$i"; \
1267                 fi \
1268         done; \
1269         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1270         rm -f testlist testlist.sorted; \
1271         if [ $${failed} != 0 ]; then \
1272           echo -e "\nFailed tests:\n"; \
1273           for i in $${failed_tests}; do \
1274             echo $${i}; \
1275             if [ "x$$V" = "x1" ]; then \
1276               cat $${i}.stdout; \
1277               cat $${i}.stderr; \
1278             fi; \
1279           done; \
1280           exit 1; \
1281         fi
1282
1283 runtest-managed: test-runner.exe compile-tests
1284         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --testsuite-name "runtime" --timeout 300 --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1285
1286 runtest-managed-serial: test-runner.exe compile-tests
1287         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j 1 --testsuite-name "runtime" --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1288
1289 test-jit:
1290         @if test x$(M) != x0; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
1291
1292 testaot:
1293         @$(MAKE) AOT=1 runtest
1294
1295 testtrace:
1296         @$(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" runtest
1297
1298 testinterp: test-runner.exe compile-tests
1299         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --runtime-args "--interpreter" --testsuite-name "runtime-interp" --timeout 300 --disabled "$(INTERP_DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1300
1301 testjitspeed: $(JITTEST_PROG) compile-tests
1302         for i in $(TESTS_BENCH); do     \
1303                 echo $$i;       \
1304                 time $(JITTEST_PROG) $$i;       \
1305         done
1306
1307 test-iomap-regression: exists.exe
1308         @echo "Testing exists.exe..."
1309         @MONO_IOMAP=all $(RUNTIME) exists.exe
1310
1311 stresstest: compile-tests
1312         @failed=0; \
1313         passed=0; \
1314         failed_tests="";\
1315         for i in $(TESTS_STRESS); do    \
1316                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
1317                 then \
1318                         passed=`expr $${passed} + 1`; \
1319                 else \
1320                         if [ $$? = 2 ]; then break; fi; \
1321                         failed=`expr $${failed} + 1`; \
1322                         failed_tests="$${failed_tests} $$i"; \
1323                 fi \
1324         done; \
1325         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1326         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1327           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1328
1329 testbundle: console.exe
1330         @echo "Testing mkbundle..."
1331         @$(MKBUNDLE) --static console.exe > mkbundle.stdout
1332         @$(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) ./a.out >> mkbundle.stdout
1333         @- rm -rf a.out
1334
1335 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
1336
1337 load-missing.dll: load-missing.il
1338         $(Q) $(ILASM) /dll /output:$@ $<
1339
1340 load-exceptions.exe t.dll: load-exceptions.cs t-missing.cs load-missing.dll $(TEST_DRIVER_DEPEND)
1341         $(Q) $(MCS) -t:library -out:t.dll -d:FOUND t-missing.cs
1342         $(Q) $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:$@ $<
1343         $(Q) $(MCS) -t:library -out:t.dll t-missing.cs
1344
1345 test-type-load: load-exceptions.exe
1346 if !POWERPC64
1347         $(Q) $(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
1348 endif
1349
1350 EXTRA_DIST += test-multi-netmodule-1-netmodule.cs test-multi-netmodule-2-dll1.cs test-multi-netmodule-3-dll2.cs test-multi-netmodule-4-exe.cs
1351
1352 test-multi-netmodule-1-netmodule.netmodule: test-multi-netmodule-1-netmodule.cs
1353         $(Q) $(MCS) -t:module -out:$@ $<
1354 test-multi-netmodule-2-dll1.dll: test-multi-netmodule-2-dll1.cs test-multi-netmodule-1-netmodule.netmodule
1355         $(Q) $(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library  -out:$@ $<
1356 test-multi-netmodule-3-dll2.dll: test-multi-netmodule-3-dll2.cs test-multi-netmodule-1-netmodule.netmodule
1357         $(Q) $(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library -out:$@ $<
1358 test-multi-netmodule-4-exe.exe: test-multi-netmodule-4-exe.cs test-multi-netmodule-2-dll1.dll test-multi-netmodule-3-dll2.dll
1359         $(Q) $(MCS) -r:test-multi-netmodule-2-dll1.dll -out:$@ $<
1360
1361 test-multi-netmodule: test-multi-netmodule-4-exe.exe
1362         $(Q) $(RUNTIME) test-multi-netmodule-4-exe.exe > test-multi-netmodule-4-exe.exe.stdout 2> test-multi-netmodule-4-exe.exe.stderr
1363
1364 EXTRA_DIST += custom-attr-errors.cs custom-attr-errors-lib.cs
1365
1366 custom-attr-errors.exe custom-attr-errors-lib.dll: custom-attr-errors.cs custom-attr-errors-lib.cs $(TEST_DRIVER_DEPEND)
1367         $(Q) $(MCS) /t:library -D:WITH_MEMBERS custom-attr-errors-lib.cs
1368         $(Q) $(MCS) -r:TestDriver.dll -r:custom-attr-errors-lib.dll custom-attr-errors.cs
1369         $(Q) $(MCS) /t:library custom-attr-errors-lib.cs
1370
1371 test-cattr-type-load: custom-attr-errors.exe
1372         $(Q) $(RUNTIME) custom-attr-errors.exe > custom-attr-errors.exe.stdout 2> custom-attr-errors.exe.stderr
1373
1374 EXTRA_DIST += reflection-load-with-context-lib.cs reflection-load-with-context-second-lib.cs reflection-load-with-context.cs
1375
1376 reflection-load-with-context-second-lib.dll: reflection-load-with-context-second-lib.cs
1377         $(Q) $(MCS) /t:library -out:$@ $<
1378 reflection-load-with-context-lib.dll: reflection-load-with-context-lib.cs reflection-load-with-context-second-lib.dll
1379         $(Q) $(MCS) /t:library -r:reflection-load-with-context-second-lib.dll -out:$@ $<
1380 reflection-load-with-context.exe: reflection-load-with-context-lib.dll
1381
1382 test-reflection-load-with-context: reflection-load-with-context.exe
1383         $(Q) $(RUNTIME) reflection-load-with-context.exe > reflection-load-with-context.exe.stdout 2> reflection-load-with-context.exe.stderr
1384
1385
1386 EXTRA_DIST += debug-casts.cs
1387 # This depends on TLS, so its not ran by default
1388 debug-casts: debug-casts.exe
1389         $(Q) $(RUNTIME) --debug=casts debug-casts.exe
1390
1391 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-new-threads-dont-join-stw-2.cs sgen-new-threads-collect.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs sgen-bridge-gchandle.cs
1392
1393 test-sgen:
1394         $(MAKE) test-sgen-regular
1395         $(MAKE) test-sgen-toggleref
1396         $(MAKE) test-sgen-bridge
1397         $(MAKE) test-sgen-bridge2
1398
1399 TESTS_SGEN_REGULAR_SRC =        \
1400         finalizer-wait.cs       \
1401         critical-finalizers.cs  \
1402         sgen-descriptors.cs     \
1403         sgen-gshared-vtype.cs   \
1404         sgen-weakref-stress.cs  \
1405         sgen-cementing-stress.cs        \
1406         sgen-case-23400.cs      \
1407         sgen-new-threads-dont-join-stw.cs       \
1408         sgen-new-threads-dont-join-stw-2.cs     \
1409         sgen-new-threads-collect.cs     \
1410         gc-graystack-stress.cs  \
1411         bug-17590.cs    \
1412         sgen-domain-unload.cs   \
1413         sgen-domain-unload-2.cs
1414
1415 TESTS_SGEN_REGULAR=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_REGULAR_SRC:.cs=.exe))
1416
1417 if FULL_AOT_TESTS
1418 TESTSAOT_SGEN_REGULAR=$(TESTS_SGEN_REGULAR:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1419 endif
1420
1421 if HYBRID_AOT_TESTS
1422 TESTSAOT_SGEN_REGULAR=$(TESTS_SGEN_REGULAR:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1423 endif
1424
1425 test-sgen-regular: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR)
1426         $(MAKE) test-sgen-regular-ms
1427         $(MAKE) test-sgen-regular-ms-conc
1428         $(MAKE) test-sgen-regular-ms-conc-par
1429         $(MAKE) test-sgen-regular-ms-conc-split
1430         $(MAKE) test-sgen-regular-ms-split
1431         $(MAKE) test-sgen-regular-ms-conc-split-95
1432         $(MAKE) test-sgen-regular-ms-clear-at-gc
1433         $(MAKE) test-sgen-regular-ms-conc-clear-at-gc
1434         $(MAKE) test-sgen-regular-ms-conc-split-clear-at-gc
1435
1436 test-sgen-regular-ms: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1437         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1438 test-sgen-regular-ms-conc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1439         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1440 test-sgen-regular-ms-conc-par: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1441         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc-par" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1442 test-sgen-regular-ms-conc-split: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1443         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1444 test-sgen-regular-ms-split: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1445         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1446 test-sgen-regular-ms-conc-split-95: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1447         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc,minor=split,alloc-ratio=95" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1448 test-sgen-regular-ms-clear-at-gc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1449         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=major=marksweep" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1450 test-sgen-regular-ms-conc-clear-at-gc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1451         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1452 test-sgen-regular-ms-conc-split-clear-at-gc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1453         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=major=marksweep-conc,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1454
1455 TESTS_SGEN_TOGGLEREF_SRC=       \
1456         sgen-toggleref.cs
1457
1458 TESTS_SGEN_TOGGLEREF=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_TOGGLEREF_SRC:.cs=.exe))
1459
1460 if FULL_AOT_TESTS
1461 TESTSAOT_SGEN_TOGGLEREF=$(TESTS_SGEN_TOGGLEREF:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1462 endif
1463
1464 if HYBRID_AOT_TESTS
1465 TESTSAOT_SGEN_TOGGLEREF=$(TESTS_SGEN_TOGGLEREF:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1466 endif
1467
1468 test-sgen-toggleref: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF)
1469         $(MAKE) test-sgen-toggleref-ms
1470         $(MAKE) test-sgen-toggleref-ms-conc
1471         $(MAKE) test-sgen-toggleref-ms-conc-split
1472         $(MAKE) test-sgen-toggleref-ms-split
1473         $(MAKE) test-sgen-toggleref-ms-split-95
1474         $(MAKE) test-sgen-toggleref-ms-clear-at-gc
1475         $(MAKE) test-sgen-toggleref-ms-conc-clear-at-gc
1476         $(MAKE) test-sgen-toggleref-ms-split-clear-at-gc
1477
1478 test-sgen-toggleref-ms: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1479         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1480 test-sgen-toggleref-ms-conc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1481         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1482 test-sgen-toggleref-ms-conc-split: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1483         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1484 test-sgen-toggleref-ms-split: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1485         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1486 test-sgen-toggleref-ms-split-95: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1487         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,minor=split,alloc-ratio=95" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1488 test-sgen-toggleref-ms-clear-at-gc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1489         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=toggleref-test" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1490 test-sgen-toggleref-ms-conc-clear-at-gc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1491         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=toggleref-test,major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1492 test-sgen-toggleref-ms-split-clear-at-gc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1493         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=toggleref-test,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1494
1495 TESTS_SGEN_BRIDGE_SRC=  \
1496         sgen-bridge.cs  \
1497         sgen-bridge-major-fragmentation.cs
1498
1499 TESTS_SGEN_BRIDGE=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE_SRC:.cs=.exe))
1500
1501 if FULL_AOT_TESTS
1502 TESTSAOT_SGEN_BRIDGE=$(TESTS_SGEN_BRIDGE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1503 endif
1504
1505 if HYBRID_AOT_TESTS
1506 TESTSAOT_SGEN_BRIDGE=$(TESTS_SGEN_BRIDGE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1507 endif
1508
1509 test-sgen-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE)
1510         $(MAKE) test-sgen-bridge-ms
1511         $(MAKE) test-sgen-bridge-ms-conc
1512         $(MAKE) test-sgen-bridge-ms-split
1513         $(MAKE) test-sgen-bridge-ms-new-bridge
1514         $(MAKE) test-sgen-bridge-ms-conc-new-bridge
1515         $(MAKE) test-sgen-bridge-ms-split-new-bridge
1516         $(MAKE) test-sgen-bridge-ms-tarjan-bridge
1517         $(MAKE) test-sgen-bridge-ms-split-tarjan-bridge
1518
1519 test-sgen-bridge-ms: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1520         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1521 test-sgen-bridge-ms-conc: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1522         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1523 test-sgen-bridge-ms-split: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1524         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1525 test-sgen-bridge-ms-new-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1526         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1527 test-sgen-bridge-ms-conc-new-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1528         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=bridge-implementation=new,major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1529 test-sgen-bridge-ms-split-new-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1530         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=bridge-implementation=new,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1531 test-sgen-bridge-ms-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1532         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1533 test-sgen-bridge-ms-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1534         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=Bridge --gc-params=bridge-implementation=tarjan,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1535
1536 TESTS_SGEN_BRIDGE2_SRC= \
1537         sgen-bridge-xref.cs
1538
1539 TESTS_SGEN_BRIDGE2=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE2_SRC:.cs=.exe))
1540
1541 if FULL_AOT_TESTS
1542 TESTSAOT_SGEN_BRIDGE2=$(TESTS_SGEN_BRIDGE2:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1543 endif
1544
1545 if HYBRID_AOT_TESTS
1546 TESTSAOT_SGEN_BRIDGE2=$(TESTS_SGEN_BRIDGE2:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1547 endif
1548
1549 test-sgen-bridge2: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2)
1550         $(MAKE) test-sgen-bridge2-ms
1551         $(MAKE) test-sgen-bridge2-ms-conc
1552         $(MAKE) test-sgen-bridge2-ms-split
1553         $(MAKE) test-sgen-bridge2-ms-new-bridge
1554         $(MAKE) test-sgen-bridge2-ms-conc-new-bridge
1555         $(MAKE) test-sgen-bridge2-ms-split-new-bridge
1556         $(MAKE) test-sgen-bridge2-ms-tarjan-bridge
1557         $(MAKE) test-sgen-bridge2-ms-split-tarjan-bridge
1558
1559 test-sgen-bridge2-ms: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1560         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1561 test-sgen-bridge2-ms-conc: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1562         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1563 test-sgen-bridge2-ms-split: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1564         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1565 test-sgen-bridge2-ms-new-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1566         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1567 test-sgen-bridge2-ms-conc-new-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1568         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=bridge-implementation=new,major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1569 test-sgen-bridge2-ms-split-new-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1570         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=bridge-implementation=new,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1571 test-sgen-bridge2-ms-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1572         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1573 test-sgen-bridge2-ms-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1574         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=bridge-implementation=tarjan,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1575
1576 TESTS_SGEN_BRIDGE3_SRC= \
1577         sgen-bridge-gchandle.cs
1578
1579 TESTS_SGEN_BRIDGE3=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE3_SRC:.cs=.exe))
1580
1581 if FULL_AOT_TESTS
1582 TESTSAOT_SGEN_BRIDGE3=$(TESTS_SGEN_BRIDGE3:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1583 endif
1584
1585 if HYBRID_AOT_TESTS
1586 TESTSAOT_SGEN_BRIDGE3=$(TESTS_SGEN_BRIDGE3:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1587 endif
1588
1589 test-sgen-bridge3: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3)
1590         $(MAKE) test-sgen-bridge3-ms
1591         $(MAKE) test-sgen-bridge3-ms-conc
1592         $(MAKE) test-sgen-bridge3-ms-split
1593         $(MAKE) test-sgen-bridge3-ms-new-bridge
1594         $(MAKE) test-sgen-bridge3-ms-conc-new-bridge
1595         $(MAKE) test-sgen-bridge3-ms-split-new-bridge
1596         $(MAKE) test-sgen-bridge3-ms-tarjan-bridge
1597         $(MAKE) test-sgen-bridge3-ms-split-tarjan-bridge
1598
1599 test-sgen-bridge3-ms: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1600         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1601 test-sgen-bridge3-ms-conc: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1602         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1603 test-sgen-bridge3-ms-split: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1604         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1605 test-sgen-bridge3-ms-new-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1606         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1607 test-sgen-bridge3-ms-conc-new-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1608         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1609 test-sgen-bridge3-ms-split-new-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1610         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,minor=split,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1611 test-sgen-bridge3-ms-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1612         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1613 test-sgen-bridge3-ms-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1614         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,minor=split,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1615
1616 TESTS_SGEN_OOM_SRC =    \
1617         sgen-oom-cementing-stress.cs    \
1618         sgen-oom-new-threads-dont-join-stw-2.cs \
1619         sgen-oom-bridge-major-fragmentation.cs \
1620         gc-oom-handling.cs      \
1621         gc-oom-handling2.cs
1622
1623 TESTS_SGEN_OOM=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_OOM_SRC:.cs=.exe))
1624
1625 if FULL_AOT_TESTS
1626 TESTSAOT_SGEN_OOM=$(TESTS_SGEN_OOM:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1627 endif
1628
1629 if HYBRID_AOT_TESTS
1630 TESTSAOT_SGEN_OOM=$(TESTS_SGEN_OOM:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1631 endif
1632
1633 tests-sgen-oom: $(TESTS_SGEN_OOM) $(TESTSAOT_SGEN_OOM) test-runner.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw-2.exe sgen-bridge-major-fragmentation.exe
1634         $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=max-valloc-size=50M,bridge=Bridge" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_OOM)
1635
1636 AOT_CONFIGURATIONS=     \
1637         "|regular"      \
1638         "--gc=boehm|boehm"
1639
1640 #LLVM crashes, got to fix it first.
1641 #       "--llvm|llvm"   \
1642 #       "--llvm --gc=boehm|llvm+boehm"
1643
1644
1645 test-aot:
1646         @failed=0; \
1647         passed=0; \
1648         failed_tests="";\
1649         profile=$(DEFAULT_PROFILE);     \
1650         tmpfile=`mktemp -t mono_aot_outputXXXXXX` || exit 1;    \
1651         rm -f test-aot-$${name}.stdout test-aot-$${name}.stderr; \
1652         for assembly in $(mcs_topdir)/class/lib/$$profile/*.dll ; do    \
1653                 asm_name=`basename $$assembly`; \
1654                 echo "... $$asm_name";  \
1655                 for conf in $(AOT_CONFIGURATIONS); do   \
1656                         name=`echo $$conf | cut -d\| -f 2`;     \
1657                         params=`echo $$conf | cut -d\| -f 1`;   \
1658                         test_name="$${asm_name}|$${name}";      \
1659                         echo "  $$test_name";   \
1660                         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;        \
1661                         then \
1662                                 passed=`expr $${passed} + 1`; \
1663                         else \
1664                                 failed=`expr $${failed} + 1`; \
1665                                 failed_tests="$${failed_tests} $$test_name"; \
1666                         fi \
1667                 done;   \
1668         done;   \
1669         rm      $$tmpfile;      \
1670         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1671         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1672         for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1673
1674
1675 # Generated tests for runtime invoke
1676 EXTRA_DIST += gen-runtime-invoke.cs
1677
1678 runtime-invoke.gen.cs: gen-runtime-invoke.exe
1679         $(Q) $(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
1680
1681 EXTRA_DIST += make-imt-test.cs
1682
1683 imt_big_iface_test.cs: make-imt-test.exe
1684         $(Q) $(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
1685
1686 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
1687
1688 test-inline-call-stack-library.dll: $(srcdir)/test-inline-call-stack-library.cs
1689         $(MCS) -t:library -out:$@ $<
1690
1691 test-inline-call-stack.exe$(PLATFORM_AOT_SUFFIX): test-inline-call-stack-library.dll$(PLATFORM_AOT_SUFFIX)
1692 test-inline-call-stack.exe: test-inline-call-stack.cs test-inline-call-stack-library.dll $(TEST_DRIVER_DEPEND)
1693         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:$@ $<
1694
1695 EXTRA_DIST += unhandled-exception-base-configuration.config
1696 EXTRA_DIST += unhandled-exception-legacy-configuration.config
1697 EXTRA_DIST += appdomain-unload.exe.config
1698 EXTRA_DIST += unhandled-exception-test-case.2.cs
1699 EXTRA_DIST += unhandled-exception-test-runner.2.cs
1700 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
1701         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
1702 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
1703         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
1704 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
1705         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
1706 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
1707         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
1708         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
1709         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
1710         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
1711
1712 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
1713
1714 test-unhandled-exception: unhandled-exception-test-runner.2.exe
1715         $(Q) $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
1716
1717 safehandle.2.exe winx64structs.exe thunks.exe pinvoke3.exe pinvoke2.exe pinvoke-2.2.exe pinvoke17.exe pinvoke13.exe \
1718         pinvoke11.exe pinvoke_ppcs.exe pinvoke_ppci.exe pinvoke_ppcf.exe pinvoke_ppcd.exe pinvoke_ppcc.exe pinvoke.exe \
1719         marshalbool.exe marshal9.exe marshal5.exe marshal.exe handleref.exe cominterop.exe bug-Xamarin-5278.exe: libtest.la
1720
1721 event-get.2.exe$(PLATFORM_AOT_SUFFIX): event-il.exe$(PLATFORM_AOT_SUFFIX)
1722 event-get.2.exe: event-il.exe
1723
1724 module-cctor-loader.2.exe$(PLATFORM_AOT_SUFFIX): module-cctor.exe$(PLATFORM_AOT_SUFFIX)
1725 module-cctor-loader.2.exe: module-cctor.exe
1726
1727 reference-loader.exe$(PLATFORM_AOT_SUFFIX): TestingReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX) TestingReferenceReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)
1728 reference-loader.exe: TestingReferenceAssembly.dll TestingReferenceReferenceAssembly.dll
1729
1730 assemblyresolve_asm.dll$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX)
1731         MONO_PATH="assemblyresolve_deps:$(CLASS)" $(top_builddir)/runtime/mono-wrapper $(AOT_BUILD_FLAGS) assemblyresolve_asm.dll
1732 assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1733
1734 assemblyresolve_deps:
1735         mkdir -p assemblyresolve_deps
1736 assemblyresolve_deps/TestBase.dll: assemblyresolve_deps $(srcdir)/assemblyresolve_TestBase.cs
1737         $(MCS) -target:library -out:assemblyresolve_deps/TestBase.dll $(srcdir)/assemblyresolve_TestBase.cs
1738 assemblyresolve_deps/Test.dll: assemblyresolve_deps assemblyresolve_deps/TestBase.dll $(srcdir)/assemblyresolve_Test.cs
1739         $(MCS) -target:library -r:assemblyresolve_deps/TestBase.dll -out:assemblyresolve_deps/Test.dll $(srcdir)/assemblyresolve_Test.cs
1740 assemblyresolve_asm.dll: assemblyresolve_deps/Test.dll $(srcdir)/assemblyresolve_asm.cs
1741         $(MCS) -target:library -r:assemblyresolve_deps/TestBase.dll -r:assemblyresolve_deps/Test.dll -out:assemblyresolve_asm.dll $(srcdir)/assemblyresolve_asm.cs
1742
1743 assemblyresolve_event3.exe$(PLATFORM_AOT_SUFFIX): assemblyresolve_asm.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1744 assemblyresolve_event3.exe: assemblyresolve_asm.dll assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll
1745
1746 assemblyresolve_event4.exe$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1747 assemblyresolve_event4.exe: assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll
1748
1749 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
1750 bug-80307.exe: $(srcdir)/bug-80307.cs
1751         $(MCS) -r:$(CLASS)/System.Web.dll -out:$@ $(srcdir)/bug-80307.cs
1752         cd $(top_builddir)/runtime && $(MAKE) test-support-files
1753
1754 EXTRA_DIST += bug-81673-interface.cs
1755
1756 bug-81673.exe$(PLATFORM_AOT_SUFFIX): bug-81673-interface.dll$(PLATFORM_AOT_SUFFIX)
1757 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
1758         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1759         $(MCS) -r:bug-81673-interface.dll -out:bug-81673.exe $(srcdir)/bug-81673.cs
1760         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1761
1762 EXTRA_DIST += bug-36848-a.cs
1763
1764 bug-36848.exe$(PLATFORM_AOT_SUFFIX): bug-36848-a.dll$(PLATFORM_AOT_SUFFIX)
1765 bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
1766         $(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
1767         $(MCS) -r:bug-36848-a.dll -out:bug-36848.exe $(srcdir)/bug-36848.cs
1768         $(MCS) -define:WITH_STOP -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
1769
1770 EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
1771
1772 bug-81691.exe$(PLATFORM_AOT_SUFFIX): bug-81691-b.dll$(PLATFORM_AOT_SUFFIX)
1773 bug-81691.exe bug-81691-a.dll bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
1774         $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs 
1775         $(MCS) -r:bug-81691-a.dll -target:library -out:bug-81691-b.dll $(srcdir)/bug-81691-b.cs
1776         $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
1777         rm -f bug-81691-a.dll
1778
1779 EXTRA_DIST += bug-81466-lib.il
1780
1781 bug-81466.exe$(PLATFORM_AOT_SUFFIX): bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
1782 bug-81466.exe bug-81466-lib.dll: $(srcdir)/bug-81466.il $(srcdir)/bug-81466-lib.il
1783         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
1784         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
1785
1786 EXTRA_DIST += bug-324535-il.il
1787
1788 bug-324535.exe$(PLATFORM_AOT_SUFFIX): bug-324535-il.dll$(PLATFORM_AOT_SUFFIX)
1789 bug-324535.exe bug-324535-il.dll: $(srcdir)/bug-324535.cs $(srcdir)/bug-324535-il.il
1790         $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
1791         $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
1792
1793 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
1794
1795 custom-modifiers.2.exe$(PLATFORM_AOT_SUFFIX): custom-modifiers-lib.dll$(PLATFORM_AOT_SUFFIX)
1796 custom-modifiers.2.exe custom-modifiers-lib.dll: $(srcdir)/custom-modifiers.2.cs $(srcdir)/custom-modifiers-lib.il
1797         $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
1798         $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
1799
1800 EXTRA_DIST += bug-382986-lib.cs
1801
1802 bug-382986.exe$(PLATFORM_AOT_SUFFIX): bug-382986-lib.dll$(PLATFORM_AOT_SUFFIX)
1803 bug-382986.exe bug-382986-lib.dll: $(srcdir)/bug-382986.cs $(srcdir)/bug-382986-lib.cs
1804         $(MCS) -target:library -out:bug-382986-lib.dll $(srcdir)/bug-382986-lib.cs
1805         $(MCS) -r:bug-382986-lib.dll -out:bug-382986.exe $(srcdir)/bug-382986.cs
1806
1807 EXTRA_DIST += bug-17537-helper.cs
1808
1809 bug-17537.exe$(PLATFORM_AOT_SUFFIX): bug-17537-helper.exe$(PLATFORM_AOT_SUFFIX)
1810 bug-17537-helper.exe: $(srcdir)/bug-17537-helper.cs
1811         $(MCS) -out:$@ $<
1812         chmod -x $@
1813 bug-17537.exe: bug-17537-helper.exe
1814
1815 EXTRA_DIST += coreclr-security.cs
1816
1817 test-coreclr-security : coreclr-security.exe
1818         @$(RUNTIME_MOONLIGHT) --security=core-clr-test coreclr-security.exe
1819
1820 EXTRA_DIST += generic-unboxing.2.il generic-boxing.2.il
1821
1822 generic-unboxing.2.dll: $(srcdir)/generic-unboxing.2.il
1823         $(ILASM) /dll /output:$@ $<
1824 generic-boxing.2.dll: $(srcdir)/generic-boxing.2.il generic-unboxing.2.dll
1825         $(ILASM) /dll /output:$@ $<
1826
1827 EXTRA_DIST += generic-unbox.2.cs
1828
1829 generic-unbox.2.exe$(PLATFORM_AOT_SUFFIX): generic-unboxing.2.dll$(PLATFORM_AOT_SUFFIX)
1830 generic-unbox.2.exe: $(srcdir)/generic-unbox.2.cs generic-unboxing.2.dll
1831         $(MCS) -r:generic-unboxing.2.dll -out:$@ $<
1832
1833 EXTRA_DIST += generic-box.2.cs
1834
1835 generic-box.2.exe$(PLATFORM_AOT_SUFFIX): generic-unboxing.2.dll$(PLATFORM_AOT_SUFFIX) generic-boxing.2.dll$(PLATFORM_AOT_SUFFIX)
1836 generic-box.2.exe : $(srcdir)/generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
1837         $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll -out:$@ $<
1838
1839 EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
1840
1841 generic-delegate2-lib.2.dll: $(srcdir)/generic-delegate2-lib.2.il
1842         $(ILASM) /dll /output:$@ $<
1843
1844 generic-delegate2.2.exe$(PLATFORM_AOT_SUFFIX): generic-delegate2-lib.2.dll$(PLATFORM_AOT_SUFFIX)
1845 generic-delegate2.2.exe: $(srcdir)/generic-delegate2.2.cs generic-delegate2-lib.2.dll
1846         $(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $<
1847
1848 bug-3903.exe: bug-3903.cs
1849         $(MCS_NO_LIB)  $(srcdir)/bug-3903.cs -nostdlib -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/mscorlib.dll -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
1850
1851 gshared:
1852         $(MAKE) test-generic-sharing
1853
1854 gshared-aot:
1855         @$(MAKE) AOT=1 gshared
1856
1857 test-generic-sharing-normal: $(TESTS_GSHARED) $(TESTSAOT_GSHARED)
1858         @for fn in $+ ; do      \
1859                 echo "Testing $$fn ...";        \
1860                 $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;      \
1861                 $(RUNTIME) -O=gshared,shared         $$fn > $$fn.stdout || exit 1;      \
1862                 $(RUNTIME) -O=gshared,-inline        $$fn > $$fn.stdout || exit 1;      \
1863                 $(RUNTIME) -O=gshared,-inline,shared $$fn > $fn.stdout || exit 1;       \
1864                 if [ x$(AOT) = x1 ]; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
1865         done
1866
1867 test-generic-sharing-managed: test-runner.exe $(TESTS_GSHARED) $(TESTSAOT_GSHARED) 
1868         $(Q) $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(TESTS_GSHARED)
1869
1870 if NACL_CODEGEN
1871 test-generic-sharing:
1872 else
1873 test-generic-sharing:
1874         @if test x$(M) != x0; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
1875 endif
1876
1877 EXTRA_DIST += async-exceptions.cs
1878 async-exceptions.exe : async-exceptions.cs
1879         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
1880 test-async-exceptions : async-exceptions.exe
1881         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
1882         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
1883
1884 EXTRA_DIST += modules.cs modules-m1.cs
1885 modules-m1.netmodule: modules-m1.cs
1886         $(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
1887 modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND) 
1888         $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
1889
1890 # Useful if mono is compiled with --enable-shared=no
1891 patch-libtool:
1892         cp "../../libtool" .
1893         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
1894         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
1895         touch libtest.c
1896
1897
1898 if NACL_CODEGEN
1899 test-process-exit:
1900 else
1901 EXTRA_DIST += threadpool-in-processexit.cs threadpool-in-processexit.exe.stdout.expected
1902 test-process-exit:
1903         @$(MCS) $(srcdir)/threadpool-in-processexit.cs -out:threadpool-in-processexit.exe
1904         @echo "Testing threadpool-in-processexit.exe..."
1905         @$(RUNTIME) threadpool-in-processexit.exe > threadpool-in-processexit.exe.stdout
1906         @diff -w threadpool-in-processexit.exe.stdout $(srcdir)/threadpool-in-processexit.exe.stdout.expected
1907 endif
1908
1909 # tests that expect a 1 exit code
1910 TESTS_UNHANDLED_EXCEPTION_1_SRC =       \
1911         unhandled-exception-1.cs
1912
1913 # tests that expect a 255 exit code
1914 TESTS_UNHANDLED_EXCEPTION_255_SRC =     \
1915         unhandled-exception-2.cs        \
1916         unhandled-exception-3.cs        \
1917         unhandled-exception-4.cs        \
1918         unhandled-exception-5.cs        \
1919         unhandled-exception-6.cs        \
1920         unhandled-exception-7.cs        \
1921         unhandled-exception-8.cs
1922
1923 TESTS_UNHANDLED_EXCEPTION_1=$(filter-out $(DISABLED_TESTS),$(TESTS_UNHANDLED_EXCEPTION_1_SRC:.cs=.exe))
1924 TESTS_UNHANDLED_EXCEPTION_255=$(filter-out $(DISABLED_TESTS),$(TESTS_UNHANDLED_EXCEPTION_255_SRC:.cs=.exe))
1925
1926 if FULL_AOT_TESTS
1927 TESTSAOT_UNHANDLED_EXCEPTION_1=$(TESTS_UNHANDLED_EXCEPTION_1:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1928 TESTSAOT_UNHANDLED_EXCEPTION_255=$(TESTS_UNHANDLED_EXCEPTION_255:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1929 endif
1930
1931 if HYBRID_AOT_TESTS
1932 TESTSAOT_UNHANDLED_EXCEPTION_1=$(TESTS_UNHANDLED_EXCEPTION_1:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1933 TESTSAOT_UNHANDLED_EXCEPTION_255=$(TESTS_UNHANDLED_EXCEPTION_255:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1934 endif
1935
1936 test-unhandled-exception-2: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_255)
1937         $(MAKE) test-unhandled-exception-2-1-with-managed-handler
1938         $(MAKE) test-unhandled-exception-2-1-without-managed-handler
1939         $(MAKE) test-unhandled-exception-2-255-with-managed-handler
1940         $(MAKE) test-unhandled-exception-2-255-without-managed-handler
1941
1942 test-unhandled-exception-2-1-with-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_1) test-runner.exe
1943         $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(TESTS_UNHANDLED_EXCEPTION_1)
1944 test-unhandled-exception-2-1-without-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_1) test-runner.exe
1945         TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(TESTS_UNHANDLED_EXCEPTION_1)
1946 test-unhandled-exception-2-255-with-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_255) test-runner.exe
1947         $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(TESTS_UNHANDLED_EXCEPTION_255)
1948 test-unhandled-exception-2-255-without-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_255) test-runner.exe
1949         TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(TESTS_UNHANDLED_EXCEPTION_255)
1950
1951 EXTRA_DIST += appdomain-loader.cs appdomain-tester.cs
1952
1953 appdomain-loader.exe: appdomain-tester.exe
1954
1955 test-appdomain-unload: appdomain-loader.exe appdomain-tester.exe
1956         $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.1.stdout || exit 1;
1957         $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.2.stdout || exit 1;
1958         MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.3.stdout || exit 1;
1959         MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.4.stdout || exit 1;
1960
1961 EXTRA_DIST += console-output.cs console-output.exe.stderr.expected console-output.exe.stdout.expected
1962 test-console-output: console-output.exe
1963         @$(RUNTIME) console-output.exe 1>console-output.exe.stdout
1964         @$(RUNTIME) console-output.exe 2>console-output.exe.stderr
1965         @diff -w console-output.exe.stdout $(srcdir)/console-output.exe.stdout.expected \
1966                 && diff -w console-output.exe.stderr $(srcdir)/console-output.exe.stderr.expected
1967
1968 test-pedump: test-runner.exe
1969         $(with_mono_path) $(mono_build_root)/tools/pedump/pedump --verify error test-runner.exe
1970
1971 .PHONY: test-gac-loading
1972
1973 runtest-gac-loading: test-runner.exe
1974         $(MAKE) -C testing_gac runtest
1975
1976 compile-gac-loading:
1977         $(MAKE) -C testing_gac compile-tests
1978
1979 TESTS_STRESS_PROCESS_SRC=       \
1980                 process-stress-1.cs     \
1981                 process-stress-2.cs     \
1982                 process-stress-3.cs     \
1983                 process-leak.cs
1984
1985 TESTS_STRESS_PROCESS=$(filter-out $(DISABLED_TESTS),$(TESTS_STRESS_PROCESS_SRC:.cs=.exe))
1986
1987 if FULL_AOT_TESTS
1988 TESTSAOT_STRESS_PROCESS=$(TESTS_STRESS_PROCESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1989 endif
1990
1991 if HYBRID_AOT_TESTS
1992 TESTSAOT_STRESS_PROCESS=$(TESTS_STRESS_PROCESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1993 endif
1994
1995 test-process-stress: $(TESTS_STRESS_PROCESS) $(TESTSAOT_STRESS_PROCESS) test-runner.exe
1996         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 600 $(TESTS_STRESS_PROCESS)
1997
1998 coreclr-gcstress:
1999         $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
2000
2001 # Tests for the Mono lldb plugin
2002 EXTRA_DIST += test_lldb.py test-lldb.cs
2003 test-lldb: test-lldb.exe
2004         python test_lldb.py $(JITTEST_PROG)
2005
2006 noinst_LTLIBRARIES = libtest.la
2007
2008 AM_CPPFLAGS = $(GLIB_CFLAGS)
2009
2010 if HOST_WIN32
2011 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
2012 # This shows up when compiling mono_test_marshal_delegate ()
2013 libtest_la_CFLAGS=-fno-optimize-sibling-calls
2014 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
2015 # can't find them. So we use --kill-at to remove the @ suffix as well.
2016 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
2017 else
2018 libtest_la_LDFLAGS = -rpath `pwd`
2019 endif
2020 libtest_la_SOURCES = libtest.c
2021 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
2022
2023 CLEANFILES = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat