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