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