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