2004-08-04 Bernie Solomon <bernard@ugsolutions.com>
[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         typeof-ptr.cs           \
45         static-constructor.cs   \
46         pinvoke.cs              \
47         pinvoke1.cs             \
48         pinvoke2.cs             \
49         pinvoke3.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         runtime-invoke.cs               \
61         invoke-string-ctors.cs          \
62         reinit.cs               \
63         box.cs                  \
64         array.cs                \
65         enum.cs                 \
66         enum2.cs                \
67         property.cs             \
68         enumcast.cs             \
69         assignable-tests.cs     \
70         array-cast.cs           \
71         cattr-compile.cs        \
72         cattr-field.cs          \
73         cattr-object.cs         \
74         custom-attr.cs          \
75         double-cast.cs          \
76         newobj-valuetype.cs     \
77         arraylist-clone.cs      \
78         setenv.cs               \
79         vtype.cs                \
80         isvaluetype.cs          \
81         iface6.cs               \
82         ipaddress.cs            \
83         array-vt.cs             \
84         interface1.cs           \
85         reflection-enum.cs      \
86         reflection-prop.cs      \
87         reflection4.cs          \
88         reflection5.cs          \
89         reflection-const-field.cs \
90         many-locals.cs          \
91         string-compare.cs       \
92         test-prime.cs           \
93         params.cs               \
94         reflection.cs           \
95         interface.cs            \
96         iface.cs                \
97         iface2.cs               \
98         iface3.cs               \
99         iface4.cs               \
100         virtual-method.cs       \
101         intptrcast.cs           \
102         indexer.cs              \
103         stream.cs               \
104         console.cs              \
105         shift.cs                \
106         jit-int.cs              \
107         jit-uint.cs             \
108         jit-long.cs             \
109         long.cs                 \
110         jit-ulong.cs            \
111         jit-float.cs            \
112         pop.cs                  \
113         time.cs                 \
114         appdomain.cs        \
115         appdomain1.cs           \
116         appdomain2.cs           \
117         appdomain3.cs           \
118         appdomain-client.cs     \
119         appdomain-unload.cs \
120         pointer.cs              \
121         rounding.cs             \
122         hashcode.cs             \
123         delegate1.cs            \
124         delegate2.cs            \
125         delegate3.cs            \
126         delegate4.cs            \
127         delegate5.cs            \
128         delegate6.cs            \
129         delegate7.cs            \
130         remoting1.cs            \
131         remoting2.cs            \
132         remoting3.cs            \
133         remoting4.cs            \
134         remoting5.cs            \
135         nonvirt.cs              \
136         largeexp.cs             \
137         largeexp2.cs            \
138         marshalbyref1.cs        \
139         static-ctor.cs          \
140         inctest.cs              \
141         bound.cs                \
142         array-invoke.cs         \
143         decimal.cs              \
144         decimal-array.cs        \
145         marshal1.cs             \
146         marshal2.cs             \
147         marshal3.cs             \
148         marshal5.cs             \
149         marshal6.cs             \
150         marshal7.cs             \
151         marshal8.cs             \
152         marshal9.cs             \
153         marshal10.cs            \
154         test-byval-in-struct.cs \
155         thread.cs               \
156         thread5.cs              \
157         thread6.cs              \
158         thread-static.cs        \
159         context-static.cs       \
160         float-pop.cs            \
161         interfacecast.cs        \
162         array3.cs               \
163         classinit.cs            \
164         classinit2.cs           \
165         synchronized.cs         \
166         async_read.cs           \
167         threadpool.cs           \
168         threadpool1.cs          \
169         base-definition.cs      \
170         bug-27420.cs            \
171         bug-47295.cs            \
172         bug-46781.cs            \
173         bug-48015.cs            \
174         bug-42136.cs
175
176 if X86
177 PLATFORM_DISABLED_TESTS=
178 endif
179
180 DISABLED_TESTS=                 \
181         $(PLATFORM_DISABLED_TESTS)
182
183 # These only compile with MS CSC
184 TEST_CSC_SRC=                   \
185         vararg.cs
186
187 TEST_IL_SRC=                    \
188         cpblkTest.il            \
189         jmpTest.il                      \
190         calliTest.il            \
191         ckfiniteTest.il         \
192         locallocTest.il         \
193         initblkTest.il          \
194         qt-instance.il          \
195         vararg.il                       \
196         bug-29859.il            \
197         even-odd.il
198
199
200 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
201 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
202 TESTBS=$(BENCHSRC:.cs=.exe)
203
204 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
205
206 %.exe: %.il
207         ilasm -out:$@ $<
208
209 %.exe: %.cs TestDriver.dll
210         $(CSC) -r:TestDriver.dll -out:$@ $<
211
212 test:   testjit
213
214 TestDriver.dll:
215         $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
216
217 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
218         @failed=0; \
219         passed=0; \
220         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
221         for i in $(TESTSI_CS); do       \
222                 if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
223                 then \
224                         passed=`expr $${passed} + 1`; \
225                 else \
226                         if [ $$? = 2 ]; then break; fi; \
227                         failed=`expr $${failed} + 1`; \
228                 fi \
229         done; \
230         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
231
232 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
233         @failed=0; \
234         passed=0; \
235         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
236         for i in $(TESTSI_IL); do       \
237                 if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
238                 then \
239                         passed=`expr $${passed} + 1`; \
240                 else \
241                         if [ $$? = 2 ]; then break; fi; \
242                         failed=`expr $${failed} + 1`; \
243                 fi \
244         done; \
245         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
246
247 testb: $(TEST_PROG) $(TESTBS)
248         for i in $(TESTBS); do  \
249                 $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS);     \
250         done
251
252 testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
253         @failed=0; \
254         passed=0; \
255         failed_tests="";\
256         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
257         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
258                 rm -f $${i}.so; \
259                 if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
260                 then \
261                         passed=`expr $${passed} + 1`; \
262                 else \
263                         if [ $$? = 2 ]; then break; fi; \
264                         failed=`expr $${failed} + 1`; \
265                         failed_tests="$${failed_tests} $$i"; \
266                 fi \
267         done; \
268         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
269         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
270
271 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
272         @failed=0; \
273         passed=0; \
274         failed_tests="";\
275         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
276         for i in $(TESTSI_CS) $(TESTBS); do     \
277                 rm -f $${i}.so; \
278                 $(JITTEST_PROG) --aot $${i} > /dev/null; \
279                 if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
280                 then \
281                         passed=`expr $${passed} + 1`; \
282                 else \
283                         if [ $$? = 2 ]; then break; fi; \
284                         failed=`expr $${failed} + 1`; \
285                         failed_tests="$${failed_tests} $$i"; \
286                 fi \
287         done; \
288         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
289         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
290
291 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
292         @failed=0; \
293         passed=0; \
294         failed_tests="";\
295         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
296         for i in $(TESTSI_CS) $(TESTSI_IL); do \
297                 if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
298                 then \
299                         passed=`expr $${passed} + 1`; \
300                 else \
301                         if [ $$? = 2 ]; then break; fi; \
302                         failed=`expr $${failed} + 1`; \
303                         failed_tests="$${failed_tests} $$i"; \
304                 fi \
305         done; \
306         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
307         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi ;
308
309 testjitspeed: $(JITTEST_PROG) $(TESTBS)
310         for i in $(TESTBS); do  \
311                 echo $$i;       \
312                 time $(JITTEST_PROG) $$i;       \
313         done
314
315 check:
316         @echo no check yet
317
318 noinst_LTLIBRARIES = libtest.la
319
320 INCLUDES = $(GLIB_CFLAGS)
321
322 libtest_la_LDFLAGS = -rpath `pwd`
323 libtest_la_SOURCES = libtest.c
324 libtest_la_LIBADD = $(GLIB_LIBS)
325
326 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) TestDriver.dll *.stdout
327