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