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