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