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