2003-07-21 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
[mono.git] / mcs / tests / Makefile
1 thisdir = tests
2 SUBDIRS = 
3 include ../build/rules.make
4
5 DISTFILES = README.tests $(wildcard *.cs)
6
7 # We don't want debugging info :-)
8
9 USE_MCS_FLAGS :=
10
11 #
12 # If you add any tests here, please do also add them to README.Tests !
13 #
14
15 #
16 # Empty slot: test-189
17 #
18
19 TEST_SOURCES = \
20         test-1   test-2   test-3   test-4   test-5   test-6   test-7   test-8   test-9   test-10 \
21         test-11  test-12  test-13  test-14  test-15  test-16  test-17  test-18  test-19  test-20 \
22         test-21  test-22  test-23  test-24  test-25  test-26  test-27  test-28  test-29  test-30 \
23         test-31  test-32  test-33  test-34  test-35  test-36  test-37  test-38  test-39  test-40 \
24         test-41  test-42  test-43  test-44           test-46  test-47  test-48  test-49  \
25         test-51  test-52           test-54  test-55  test-56  test-57           test-59  test-60 \
26         test-61  test-62  test-63  test-64  test-65  test-66           test-68  test-69  test-70 \
27         test-71  test-72  test-73  test-74  test-75  test-76  test-77  test-78  test-79  test-80 \
28         test-81  test-82  test-83  test-84  test-85  test-86  test-87  test-88  test-89  test-90 \
29                  test-92  test-93  test-94  test-95  test-96  test-97  test-98  test-99  test-100\
30         test-101 test-102 test-103 test-104 test-105                   test-108 test-109 test-110\
31         test-111 test-112 test-113 test-114 test-115 test-116 test-117 test-118 test-119 \
32         test-121          test-123          test-125 test-126 test-127 test-128 test-129 test-130 \
33         test-131                   test-134 test-135 test-136 test-137 test-138 test-139 test-140 \
34         test-141 test-142 test-143 test-144 test-145 test-146 test-147 test-148 test-149 test-150 \
35                           test-153 test-154 test-155 test-156 test-157 test-158 test-159 test-160 \
36         test-161 test-162 test-163 test-164 test-165 test-166 test-167 test-168 test-169 test-170 \
37                  test-172 test-173 test-174 test-175 test-176 test-177 test-178 test-179 test-180 \
38         test-181 test-182 test-183 test-184 test-185 test-186 test-187 test-188          test-190 \
39         test-191 test-192 test-193 test-194 test-195 test-196 test-197 test-198 test-199 test-200 \
40         test-201 test-202 test-203 test-204 test-205 test-206
41
42
43 UNSAFE_SOURCES = \
44         unsafe-1 unsafe-2 unsafe-3 test-58 test-171 unsafe-5 unsafe-6
45
46 WINDOWS_SOURCES = \
47         test-50 test-67
48
49 # A test is a 'no pass' if it fails on either windows or linux
50 # Test 120 does not pass because the MS.NET runtime is buggy.
51
52 TEST_NOPASS = \
53         test-45  test-53  test-91  test-106 test-107 test-120 test-122 test-132 test-133 test-66 test-177
54
55 all-local install-local:
56
57 # casts
58
59 bootstrap-cast.exe: gen-cast-test.cs
60         $(BOOT_COMPILE) /target:exe /out:$@ $<
61
62 casts.cs: bootstrap-cast.exe
63         $(RUNTIME) $< >$@
64
65 casts-mcs.exe: casts.cs
66         $(CSCOMPILE) /target:exe /out:$@ $<
67
68 casts-boot.exe: casts.cs
69         $(BOOT_COMPILE) /target:exe /out:$@ $<
70
71 boot-casts.out: casts-boot.exe
72         $(RUNTIME) $< >$@
73
74 mcs-casts.out: casts-mcs.exe
75         $(RUNTIME) $< >$@
76
77 test-casts: boot-casts.out mcs-casts.out
78         cmp $^
79
80 # compilation is part of the testing too, so we don't actually 
81 # do anything in test-local.
82
83 test-local: 
84
85 run-test-local: test-compiler-jit test-unsafe-compiler-jit test-casts
86
87 clean-local:
88         rm -f *.exe *.out *.pdb casts.cs
89
90 dist-local: dist-default
91         rm -f $(distdir)/casts.cs
92
93 test-compiler-jit: multi
94         @rm -f *.exe ; \
95         echo "Flags \"$(TEST_RUNTIME)\" ... " ; \
96         for i in $(TEST_SOURCES) ; do \
97             echo -n "$$i: "; \
98             if $(INTERNAL_MCS) $$i.cs >/dev/null ; then \
99                 true ; \
100             else \
101                 echo FAILED COMPILATION ; exit 1; \
102             fi ; \
103             if $(TEST_RUNTIME) ./$$i.exe >/dev/null ; then \
104                 echo OK ; \
105             else \
106                 echo FAILED ; exit 1; \
107             fi ; \
108         done
109
110 test-unsafe-compiler-jit:
111         @echo "Running UNSAFE tests ..." ; \
112         echo "Flags \"$(TEST_RUNTIME)\" ... " ; \
113         for i in $(UNSAFE_SOURCES) ; do \
114             echo -n "$$i: "; \
115             if $(INTERNAL_MCS) /unsafe $$i.cs >/dev/null ; then \
116                 true ; \
117             else \
118                 echo FAILED COMPILATION ; exit 1\
119             fi ; \
120             if $(TEST_RUNTIME) ./$$i.exe >/dev/null ; then \
121                 echo OK ; \
122             else \
123                 echo FAILED ; exit 1\
124             fi ; \
125         done
126
127
128 #
129 # Tests that require separate compilation
130 #
131 multi: multi-1 multi-2
132         echo Multi-assembly test passes
133
134 multi-1:
135         $(INTERNAL_MCS) /target:library dll-1.cs
136         $(INTERNAL_MCS) /r:dll-1.dll prog-1.cs /out:prog-1.exe
137         $(TEST_RUNTIME) prog-1.exe
138
139 #
140 # Tests that the order for internal/public in external 
141 # assemblies does not affect the outcome of a build.
142 #
143 multi-2:
144         $(INTERNAL_MCS) /target:library pi.cs
145         $(INTERNAL_MCS) /target:library pp.cs
146         $(INTERNAL_MCS) pu.cs -r:pi.dll -r:pp.dll
147         $(INTERNAL_MCS) pu.cs -r:pp.dll -r:pi.dll