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