In mono/mini:
[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 $(LIBTOOL) --mode=execute $(TEST_PROG)
7 JITTEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default $(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         context-static.cs       \
168         float-pop.cs            \
169         interfacecast.cs        \
170         array3.cs               \
171         classinit.cs            \
172         classinit2.cs           \
173         synchronized.cs         \
174         async_read.cs           \
175         threadpool.cs           \
176         threadpool1.cs          \
177         base-definition.cs      \
178         bug-27420.cs            \
179         bug-47295.cs            \
180         bug-46781.cs            \
181         bug-48015.cs            \
182         bug-42136.cs            \
183         cross-domain.cs
184
185 if X86
186 PLATFORM_DISABLED_TESTS=
187 endif
188
189 DISABLED_TESTS=                 \
190         $(PLATFORM_DISABLED_TESTS)
191
192 # These only compile with MS CSC
193 TEST_CSC_SRC=                   \
194         vararg.cs
195
196 TEST_IL_SRC=                    \
197         cpblkTest.il            \
198         jmpTest.il                      \
199         calliTest.il            \
200         ckfiniteTest.il         \
201         locallocTest.il         \
202         initblkTest.il          \
203         qt-instance.il          \
204         vararg.il                       \
205         bug-29859.il            \
206         even-odd.il
207
208
209 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
210 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
211 TESTBS=$(BENCHSRC:.cs=.exe)
212
213 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
214
215 %.exe: %.il
216         $(ILASM) -out:$@ $<
217
218 %.exe: %.cs TestDriver.dll
219         $(CSC) -r:TestDriver.dll -out:$@ $<
220
221 test:   testjit
222
223 TestDriver.dll:
224         $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
225
226 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
227         @failed=0; \
228         passed=0; \
229         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
230         for i in $(TESTSI_CS); do       \
231                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
232                 then \
233                         passed=`expr $${passed} + 1`; \
234                 else \
235                         if [ $$? = 2 ]; then break; fi; \
236                         failed=`expr $${failed} + 1`; \
237                 fi \
238         done; \
239         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
240
241 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
242         @failed=0; \
243         passed=0; \
244         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
245         for i in $(TESTSI_IL); do       \
246                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
247                 then \
248                         passed=`expr $${passed} + 1`; \
249                 else \
250                         if [ $$? = 2 ]; then break; fi; \
251                         failed=`expr $${failed} + 1`; \
252                 fi \
253         done; \
254         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
255
256 testb: $(TEST_PROG) $(TESTBS)
257         for i in $(TESTBS); do  \
258                 $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);       \
259         done
260
261 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
262         @failed=0; \
263         passed=0; \
264         failed_tests="";\
265         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
266                 rm -f $${i}.so; \
267                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
268                 then \
269                         passed=`expr $${passed} + 1`; \
270                 else \
271                         if [ $$? = 2 ]; then break; fi; \
272                         failed=`expr $${failed} + 1`; \
273                         failed_tests="$${failed_tests} $$i"; \
274                 fi \
275         done; \
276         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
277         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
278
279 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
280         @failed=0; \
281         passed=0; \
282         failed_tests="";\
283         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
284         for i in $(TESTSI_CS) $(TESTBS); do     \
285                 rm -f $${i}.so; \
286                 $(JITTEST_PROG) --aot $${i} > /dev/null; \
287                 if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
288                 then \
289                         passed=`expr $${passed} + 1`; \
290                 else \
291                         if [ $$? = 2 ]; then break; fi; \
292                         failed=`expr $${failed} + 1`; \
293                         failed_tests="$${failed_tests} $$i"; \
294                 fi \
295         done; \
296         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
297         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
298
299 testinterp: $(TESTSI_CS) $(TESTSI_IL) 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) $(TESTSI_IL); do \
305                 if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
306                 then \
307                         passed=`expr $${passed} + 1`; \
308                 else \
309                         if [ $$? = 2 ]; then break; fi; \
310                         failed=`expr $${failed} + 1`; \
311                         failed_tests="$${failed_tests} $$i"; \
312                 fi \
313         done; \
314         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
315         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi ;
316
317 testjitspeed: $(JITTEST_PROG) $(TESTBS)
318         for i in $(TESTBS); do  \
319                 echo $$i;       \
320                 time $(JITTEST_PROG) $$i;       \
321         done
322
323 noinst_LTLIBRARIES = libtest.la
324
325 INCLUDES = $(GLIB_CFLAGS)
326
327 libtest_la_LDFLAGS = -rpath `pwd`
328 libtest_la_SOURCES = libtest.c
329 libtest_la_LIBADD = $(GLIB_LIBS)
330
331 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) *.dll *.stdout *.exe stest.dat