Moved and integrated the exiting threads.
[mono.git] / mono / tests / Makefile.am
1 check-local: test
2
3 TEST_PROG = ../interpreter/mint
4 JITTEST_PROG = ../mini/mono
5
6 TEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
7 JITTEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(JITTEST_PROG)
8
9 RUNTIME_ARGS=--config tests-config --optimize=all
10
11 RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/default $(top_builddir)/runtime/mono-wrapper
12
13 CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe --unsafe -nowarn:0162
14 ILASM = $(RUNTIME) $(mcs_topdir)/ilasm/ilasm.exe
15
16 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
17
18 TEST_CS_SRC=                    \
19         array-init.cs           \
20         arraylist.cs            \
21         checked.cs              \
22         char-isnumber.cs        \
23         create-instance.cs      \
24         field-layout.cs         \
25         pack-layout.cs          \
26         hash-table.cs           \
27         test-ops.cs             \
28         obj.cs                  \
29         string.cs               \
30         stringbuilder.cs        \
31         switch.cs               \
32         outparm.cs              \
33         delegate.cs             \
34         bitconverter.cs         \
35         exception.cs            \
36         exception2.cs           \
37         exception3.cs           \
38         exception4.cs           \
39         exception5.cs           \
40         exception6.cs           \
41         exception7.cs           \
42         exception8.cs           \
43         exception10.cs          \
44         exception11.cs          \
45         exception12.cs          \
46         exception13.cs          \
47         exception14.cs          \
48         exception15.cs          \
49         exception16.cs          \
50         struct.cs               \
51         valuetype-gettype.cs    \
52         typeof-ptr.cs           \
53         static-constructor.cs   \
54         pinvoke.cs              \
55         pinvoke1.cs             \
56         pinvoke2.cs             \
57         pinvoke3.cs             \
58         pinvoke10.cs            \
59         pinvoke11.cs            \
60         pinvoke13.cs            \
61         pinvoke15.cs            \
62         pinvoke17.cs            \
63         pinvoke18.cs            \
64         invoke.cs               \
65         invoke2.cs              \
66         runtime-invoke.cs               \
67         invoke-string-ctors.cs          \
68         reinit.cs               \
69         box.cs                  \
70         array.cs                \
71         enum.cs                 \
72         enum2.cs                \
73         property.cs             \
74         enumcast.cs             \
75         assignable-tests.cs     \
76         array-cast.cs           \
77         cattr-compile.cs        \
78         cattr-field.cs          \
79         cattr-object.cs         \
80         custom-attr.cs          \
81         double-cast.cs          \
82         newobj-valuetype.cs     \
83         arraylist-clone.cs      \
84         setenv.cs               \
85         vtype.cs                \
86         isvaluetype.cs          \
87         iface6.cs               \
88         ipaddress.cs            \
89         array-vt.cs             \
90         interface1.cs           \
91         reflection-enum.cs      \
92         reflection-prop.cs      \
93         reflection4.cs          \
94         reflection5.cs          \
95         reflection-const-field.cs \
96         many-locals.cs          \
97         string-compare.cs       \
98         test-prime.cs           \
99         params.cs               \
100         reflection.cs           \
101         interface.cs            \
102         iface.cs                \
103         iface2.cs               \
104         iface3.cs               \
105         iface4.cs               \
106         virtual-method.cs       \
107         intptrcast.cs           \
108         indexer.cs              \
109         stream.cs               \
110         console.cs              \
111         shift.cs                \
112         jit-int.cs              \
113         jit-uint.cs             \
114         jit-long.cs             \
115         long.cs                 \
116         jit-ulong.cs            \
117         jit-float.cs            \
118         pop.cs                  \
119         time.cs                 \
120         appdomain.cs        \
121         appdomain1.cs           \
122         appdomain2.cs           \
123         appdomain3.cs           \
124         appdomain-client.cs     \
125         appdomain-unload.cs \
126         loader.cs       \
127         pointer.cs              \
128         rounding.cs             \
129         hashcode.cs             \
130         delegate1.cs            \
131         delegate2.cs            \
132         delegate3.cs            \
133         delegate4.cs            \
134         delegate5.cs            \
135         delegate6.cs            \
136         delegate7.cs            \
137         delegate8.cs            \
138         remoting1.cs            \
139         remoting2.cs            \
140         remoting3.cs            \
141         remoting4.cs            \
142         remoting5.cs            \
143         nonvirt.cs              \
144         largeexp.cs             \
145         largeexp2.cs            \
146         marshalbyref1.cs        \
147         static-ctor.cs          \
148         inctest.cs              \
149         bound.cs                \
150         array-invoke.cs         \
151         decimal.cs              \
152         decimal-array.cs        \
153         marshal.cs              \
154         marshal1.cs             \
155         marshal2.cs             \
156         marshal3.cs             \
157         marshal5.cs             \
158         marshal6.cs             \
159         marshal7.cs             \
160         marshal8.cs             \
161         marshal9.cs             \
162         test-byval-in-struct.cs \
163         thread.cs               \
164         thread5.cs              \
165         thread6.cs              \
166         thread-static.cs        \
167         thread-static-init.cs   \
168         context-static.cs       \
169         float-pop.cs            \
170         interfacecast.cs        \
171         array3.cs               \
172         classinit.cs            \
173         classinit2.cs           \
174         synchronized.cs         \
175         async_read.cs           \
176         threadpool.cs           \
177         threadpool1.cs          \
178         base-definition.cs      \
179         bug-27420.cs            \
180         bug-47295.cs            \
181         bug-46781.cs            \
182         bug-48015.cs            \
183         bug-42136.cs            \
184         interlocked.cs          \
185         cross-domain.cs         \
186         appdomain-exit.cs       \
187         delegate-async-exit.cs  \
188         delegate-delegate-exit.cs       \
189         delegate-exit.cs        \
190         finalizer-abort.cs      \
191         finalizer-exception.cs  \
192         finalizer-exit.cs       \
193         main-exit.cs    \
194         main-returns-abort-resetabort.cs        \
195         main-returns-background-abort-resetabort.cs     \
196         main-returns-background-resetabort.cs   \
197         main-returns-background.cs      \
198         main-returns.cs \
199         subthread-exit.cs       \
200         desweak.cs
201
202 if X86
203 PLATFORM_DISABLED_TESTS=
204 endif
205
206 DISABLED_TESTS=                 \
207         delegate-async-exception.cs     \
208         delegate-delegate-exception.cs  \
209         $(PLATFORM_DISABLED_TESTS)
210
211 # These only compile with MS CSC
212 TEST_CSC_SRC=                   \
213         vararg.cs
214
215 TEST_IL_SRC=                    \
216         cpblkTest.il            \
217         jmpTest.il                      \
218         calliTest.il            \
219         ckfiniteTest.il         \
220         locallocTest.il         \
221         initblkTest.il          \
222         qt-instance.il          \
223         vararg.il                       \
224         bug-29859.il            \
225         even-odd.il
226
227
228 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
229 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
230 TESTBS=$(BENCHSRC:.cs=.exe)
231
232 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
233
234 %.exe: %.il
235         $(ILASM) -out:$@ $<
236
237 %.exe: %.cs TestDriver.dll
238         $(CSC) -r:TestDriver.dll -out:$@ $<
239
240 test:   testjit
241
242 TestDriver.dll:
243         $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
244
245 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
246         @failed=0; \
247         passed=0; \
248         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
249         for i in $(TESTSI_CS); do       \
250                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
251                 then \
252                         passed=`expr $${passed} + 1`; \
253                 else \
254                         if [ $$? = 2 ]; then break; fi; \
255                         failed=`expr $${failed} + 1`; \
256                 fi \
257         done; \
258         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
259
260 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
261         @failed=0; \
262         passed=0; \
263         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
264         for i in $(TESTSI_IL); do       \
265                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
266                 then \
267                         passed=`expr $${passed} + 1`; \
268                 else \
269                         if [ $$? = 2 ]; then break; fi; \
270                         failed=`expr $${failed} + 1`; \
271                 fi \
272         done; \
273         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
274
275 testb: $(TEST_PROG) $(TESTBS)
276         for i in $(TESTBS); do  \
277                 $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);       \
278         done
279
280 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
281         @failed=0; \
282         passed=0; \
283         failed_tests="";\
284         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
285                 rm -f $${i}.so; \
286                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
287                 then \
288                         passed=`expr $${passed} + 1`; \
289                 else \
290                         if [ $$? = 2 ]; then break; fi; \
291                         failed=`expr $${failed} + 1`; \
292                         failed_tests="$${failed_tests} $$i"; \
293                 fi \
294         done; \
295         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
296         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
297           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
298
299 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
300         @failed=0; \
301         passed=0; \
302         failed_tests="";\
303         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
304         for i in $(TESTSI_CS) $(TESTBS); do     \
305                 rm -f $${i}.so; \
306                 $(JITTEST_PROG) --aot $${i} > /dev/null; \
307                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
308                 then \
309                         passed=`expr $${passed} + 1`; \
310                 else \
311                         if [ $$? = 2 ]; then break; fi; \
312                         failed=`expr $${failed} + 1`; \
313                         failed_tests="$${failed_tests} $$i"; \
314                 fi \
315         done; \
316         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
317         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
318           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
319
320 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
321         @failed=0; \
322         passed=0; \
323         failed_tests="";\
324         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
325         for i in $(TESTSI_CS) $(TESTSI_IL); do \
326                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
327                 then \
328                         passed=`expr $${passed} + 1`; \
329                 else \
330                         if [ $$? = 2 ]; then break; fi; \
331                         failed=`expr $${failed} + 1`; \
332                         failed_tests="$${failed_tests} $$i"; \
333                 fi \
334         done; \
335         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
336         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
337           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
338
339 testjitspeed: $(JITTEST_PROG) $(TESTBS)
340         for i in $(TESTBS); do  \
341                 echo $$i;       \
342                 time $(JITTEST_PROG) $$i;       \
343         done
344
345 noinst_LTLIBRARIES = libtest.la
346
347 INCLUDES = $(GLIB_CFLAGS)
348
349 if PLATFORM_WIN32
350 libtest_la_LDFLAGS=-no-undefined -rpath `pwd`
351 else
352 libtest_la_LDFLAGS = -rpath `pwd`
353 endif
354 libtest_la_SOURCES = libtest.c
355 libtest_la_LIBADD = $(GLIB_LIBS)
356
357 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) *.dll *.stdout *.exe stest.dat