2004-05-06 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         marshal5.cs             \
146         marshal6.cs             \
147         marshal7.cs             \
148         marshal8.cs             \
149         marshal9.cs             \
150         marshal10.cs            \
151         thread.cs               \
152         thread5.cs              \
153         thread6.cs              \
154         thread-static.cs        \
155         context-static.cs       \
156         float-pop.cs            \
157         interfacecast.cs        \
158         array3.cs               \
159         classinit.cs            \
160         classinit2.cs           \
161         synchronized.cs         \
162         async_read.cs           \
163         threadpool.cs           \
164         threadpool1.cs          \
165         base-definition.cs      \
166         bug-27420.cs            \
167         bug-47295.cs            \
168         bug-46781.cs            \
169         bug-48015.cs            \
170         bug-42136.cs
171
172 DISABLED_TESTS=                 \
173         remoting2.exe           \
174         remoting3.exe           \
175         appdomain-unload.exe    \
176         thread6.exe
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 "$(DISABLED_TESTS)" $(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 "$(DISABLED_TESTS)" $(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 "$(DISABLED_TESTS)" $(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 "$(DISABLED_TESTS)" $(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 "$(DISABLED_TESTS)" $(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 "$(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"; 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