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