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