2003-10-13 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
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         pinvoke9.cs             \
51         pinvoke10.cs            \
52         pinvoke11.cs            \
53         pinvoke12.cs            \
54         pinvoke13.cs            \
55         pinvoke14.cs            \
56         pinvoke15.cs            \
57         pinvoke16.cs            \
58         pinvoke17.cs            \
59         pinvoke18.cs            \
60         invoke.cs               \
61         invoke2.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         many-locals.cs          \
90         string-compare.cs       \
91         test-prime.cs           \
92         params.cs               \
93         reflection.cs           \
94         interface.cs            \
95         iface.cs                \
96         iface2.cs               \
97         iface3.cs               \
98         iface4.cs               \
99         virtual-method.cs       \
100         intptrcast.cs           \
101         indexer.cs              \
102         stream.cs               \
103         console.cs              \
104         shift.cs                \
105         jit-int.cs              \
106         jit-uint.cs             \
107         jit-long.cs             \
108         long.cs                 \
109         jit-ulong.cs            \
110         jit-float.cs            \
111         pop.cs                  \
112         time.cs                 \
113         appdomain.cs        \
114         appdomain1.cs           \
115         appdomain2.cs           \
116         appdomain3.cs           \
117         appdomain-client.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         marshal4.cs             \
147         marshal5.cs             \
148         marshal6.cs             \
149         marshal7.cs             \
150         marshal8.cs             \
151         marshal9.cs             \
152         marshal10.cs            \
153         thread.cs               \
154         thread5.cs              \
155         thread6.cs              \
156         thread-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
171 # These only compile with MS CSC
172 TEST_CSC_SRC=                   \
173         vararg.cs
174
175 TEST_IL_SRC=                    \
176         cpblkTest.il            \
177         jmpTest.il                      \
178         calliTest.il            \
179         ckfiniteTest.il         \
180         locallocTest.il         \
181         initblkTest.il          \
182         even-odd.il             \
183         qt-instance.il          \
184         bug-29859.il
185
186
187 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
188 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
189 TESTBS=$(BENCHSRC:.cs=.exe)
190
191 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC)
192
193 %.exe: %.il
194         ilasm -out:$@ $<
195
196 %.exe: %.cs TestDriver.dll
197         $(CSC) -r TestDriver.dll -out:$@ $<
198
199 test:   testjit
200
201 TestDriver.dll:
202         $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
203
204 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
205         @failed=0; \
206         passed=0; \
207         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
208         for i in $(TESTSI_CS); do       \
209                 if $(srcdir)/test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
210                 then \
211                         passed=`expr $${passed} + 1`; \
212                 else \
213                         if [ $$? = 2 ]; then break; fi; \
214                         failed=`expr $${failed} + 1`; \
215                 fi \
216         done; \
217         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
218
219 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
220         @failed=0; \
221         passed=0; \
222         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
223         for i in $(TESTSI_IL); do       \
224                 if $(srcdir)/test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
225                 then \
226                         passed=`expr $${passed} + 1`; \
227                 else \
228                         if [ $$? = 2 ]; then break; fi; \
229                         failed=`expr $${failed} + 1`; \
230                 fi \
231         done; \
232         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
233
234 testb: $(TEST_PROG) $(TESTBS)
235         for i in $(TESTBS); do  \
236                 $(srcdir)/test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
237         done
238
239 testjit: $(TESTSI_CS) $(TESTBS) libtest.la
240         @failed=0; \
241         passed=0; \
242         failed_tests="";\
243         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
244         for i in $(TESTSI_CS) $(TESTBS); do     \
245                 rm -f $${i}.so; \
246                 if $(srcdir)/test-driver $(JITTEST_PROG) $$i $(RUNTIME_ARGS); \
247                 then \
248                         passed=`expr $${passed} + 1`; \
249                 else \
250                         if [ $$? = 2 ]; then break; fi; \
251                         failed=`expr $${failed} + 1`; \
252                         failed_tests="$${failed_tests} $$i"; \
253                 fi \
254         done; \
255         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
256         if [ $$failed > 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
257
258 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
259         @failed=0; \
260         passed=0; \
261         failed_tests="";\
262         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
263         for i in $(TESTSI_CS) $(TESTBS); do     \
264                 rm -f $${i}.so; \
265                 $(JITTEST_PROG) --aot $${i} > /dev/null; \
266                 if $(srcdir)/test-driver $(JITTEST_PROG) $$i $(RUNTIME_ARGS); \
267                 then \
268                         passed=`expr $${passed} + 1`; \
269                 else \
270                         if [ $$? = 2 ]; then break; fi; \
271                         failed=`expr $${failed} + 1`; \
272                         failed_tests="$${failed_tests} $$i"; \
273                 fi \
274         done; \
275         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
276         if [ $$failed > 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi; 
277
278 testinterp: $(TESTSI_CS) libtest.la
279         @failed=0; \
280         passed=0; \
281         failed_tests="";\
282         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
283         for i in $(TESTSI_CS) $(TESTSI_IL); do \
284                 if $(srcdir)/test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
285                 then \
286                         passed=`expr $${passed} + 1`; \
287                 else \
288                         if [ $$? = 2 ]; then break; fi; \
289                         failed=`expr $${failed} + 1`; \
290                         failed_tests="$${failed_tests} $$i"; \
291                 fi \
292         done; \
293         echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
294         if [ $$failed > 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi ;
295
296 testjitspeed: $(JITTEST_PROG) $(TESTBS)
297         for i in $(TESTBS); do  \
298                 echo $$i;       \
299                 time $(JITTEST_PROG) $$i;       \
300         done
301
302 check:
303         @echo no check yet
304
305 noinst_LTLIBRARIES = libtest.la
306
307 INCLUDES = $(GLIB_CFLAGS)
308
309 libtest_la_LDFLAGS = -rpath `pwd`
310 libtest_la_SOURCES = libtest.c
311
312 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) TestDriver.dll
313