2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[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 # bug #71274
204 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
205 endif
206
207 if AMD64
208 # bug #71273
209 PLATFORM_DISABLED_TESTS=appdomain-unload.exe
210 endif
211
212 DISABLED_TESTS=                 \
213         delegate-async-exception.cs     \
214         delegate-delegate-exception.cs  \
215         $(PLATFORM_DISABLED_TESTS)
216
217 # These only compile with MS CSC
218 TEST_CSC_SRC=                   \
219         vararg.cs
220
221 TEST_IL_SRC=                    \
222         cpblkTest.il            \
223         jmpTest.il                      \
224         calliTest.il            \
225         ckfiniteTest.il         \
226         locallocTest.il         \
227         initblkTest.il          \
228         qt-instance.il          \
229         vararg.il                       \
230         bug-29859.il            \
231         even-odd.il
232
233
234 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
235 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
236 TESTBS=$(BENCHSRC:.cs=.exe)
237
238 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
239
240 %.exe: %.il
241         $(ILASM) -out:$@ $<
242
243 %.exe: %.cs TestDriver.dll
244         $(CSC) -r:TestDriver.dll -out:$@ $<
245
246 test:   testjit
247
248 TestDriver.dll:
249         $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
250
251 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
252         @failed=0; \
253         passed=0; \
254         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
255         for i in $(TESTSI_CS); do       \
256                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
257                 then \
258                         passed=`expr $${passed} + 1`; \
259                 else \
260                         if [ $$? = 2 ]; then break; fi; \
261                         failed=`expr $${failed} + 1`; \
262                 fi \
263         done; \
264         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
265
266 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
267         @failed=0; \
268         passed=0; \
269         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
270         for i in $(TESTSI_IL); do       \
271                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
272                 then \
273                         passed=`expr $${passed} + 1`; \
274                 else \
275                         if [ $$? = 2 ]; then break; fi; \
276                         failed=`expr $${failed} + 1`; \
277                 fi \
278         done; \
279         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
280
281 testb: $(TEST_PROG) $(TESTBS)
282         for i in $(TESTBS); do  \
283                 $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);       \
284         done
285
286 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
287         @failed=0; \
288         passed=0; \
289         failed_tests="";\
290         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
291                 rm -f $${i}.so; \
292                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
293                 then \
294                         passed=`expr $${passed} + 1`; \
295                 else \
296                         if [ $$? = 2 ]; then break; fi; \
297                         failed=`expr $${failed} + 1`; \
298                         failed_tests="$${failed_tests} $$i"; \
299                 fi \
300         done; \
301         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
302         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
303           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
304
305 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
306         @failed=0; \
307         passed=0; \
308         failed_tests="";\
309         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
310         for i in $(TESTSI_CS) $(TESTBS); do     \
311                 rm -f $${i}.so; \
312                 $(JITTEST_PROG) --aot $${i} > /dev/null; \
313                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
314                 then \
315                         passed=`expr $${passed} + 1`; \
316                 else \
317                         if [ $$? = 2 ]; then break; fi; \
318                         failed=`expr $${failed} + 1`; \
319                         failed_tests="$${failed_tests} $$i"; \
320                 fi \
321         done; \
322         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
323         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
324           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
325
326 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
327         @failed=0; \
328         passed=0; \
329         failed_tests="";\
330         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
331         for i in $(TESTSI_CS) $(TESTSI_IL); do \
332                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
333                 then \
334                         passed=`expr $${passed} + 1`; \
335                 else \
336                         if [ $$? = 2 ]; then break; fi; \
337                         failed=`expr $${failed} + 1`; \
338                         failed_tests="$${failed_tests} $$i"; \
339                 fi \
340         done; \
341         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
342         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
343           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
344
345 testjitspeed: $(JITTEST_PROG) $(TESTBS)
346         for i in $(TESTBS); do  \
347                 echo $$i;       \
348                 time $(JITTEST_PROG) $$i;       \
349         done
350
351 noinst_LTLIBRARIES = libtest.la
352
353 INCLUDES = $(GLIB_CFLAGS)
354
355 if PLATFORM_WIN32
356 libtest_la_LDFLAGS=-no-undefined -rpath `pwd`
357 else
358 libtest_la_LDFLAGS = -rpath `pwd`
359 endif
360 libtest_la_SOURCES = libtest.c
361 libtest_la_LIBADD = $(GLIB_LIBS)
362
363 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) *.dll *.stdout *.exe stest.dat