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