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