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