Add new test, I forgot to add this a few weeks ago test-178.cs
[mono.git] / mcs / tests / makefile
1 #
2 # You can change "RUNTIME" to control what runtime to use
3 # ie, make vs make RUNTIME=mono
4
5 CSC=csc.exe
6
7 MCS=../mcs/mcs.exe
8 MCS2=mono ../mcs/mcs.exe
9 VERIFY=../tools/verifier.exe
10
11 TEST_SOURCES = \
12         test-1   test-2   test-3   test-4   test-5   test-6   test-7   test-8   test-9   test-10 \
13         test-11  test-12  test-13  test-14  test-15  test-16  test-17  test-18  test-19  test-20 \
14         test-21  test-22  test-23  test-24  test-25  test-26  test-27  test-28  test-29  test-30 \
15         test-31  test-32  test-33  test-34  test-35  test-36  test-37  test-38  test-39  test-40 \
16         test-41  test-42  test-43  test-44           test-46  test-47  test-48  test-49  \
17         test-51  test-52           test-54  test-55  test-56  test-57           test-59  test-60 \
18         test-61  test-62  test-63  test-64  test-65                    test-68  test-69  test-70 \
19         test-71  test-72  test-73  test-74  test-75  test-76  test-77  test-78  test-79  test-80 \
20         test-81  test-82  test-83  test-84  test-85  test-86  test-87  test-88  test-89  test-90 \
21                  test-92  test-93  test-94  test-95  test-96  test-97  test-98  test-99  test-100\
22         test-101 test-102 test-103 test-104 test-105                   test-108 test-109 test-110\
23         test-111 test-112 test-113 test-114 test-115 test-116 test-117 test-118 test-119 \
24         test-121          test-123          test-125 test-126 test-127 test-128 test-129 test-130 \
25         test-131                   test-134 test-135 test-136 test-137 test-138 test-139 test-140 \
26         test-141 test-142 test-143 test-144 test-145 test-146 test-147 test-148 test-149 test-150 \
27                           test-153 test-154 test-155 test-156 test-157 test-158 test-159 test-160 \
28         test-161 test-162 test-163 test-164 test-165 test-166 test-167 test-168 test-169 test-170 \
29                  test-172 test-173 test-174 test-175 test-176
30
31 UNSAFE_SOURCES = \
32         unsafe-1 unsafe-2 unsafe-3 test-58.cs test-171.cs
33
34 WINDOWS_SOURCES = \
35         test-50 test-67
36
37 # A test is a 'no pass' if it fails on either windows or linux
38 # Test 120 does not pass because the MS.NET runtime is buggy.
39 TEST_NOPASS = \
40         test-45  test-53  test-91  test-106 test-107 test-120 test-122 test-132 test-133 test-66 test-177
41
42 all: test-compiler test-unsafe test-windows
43
44
45 # Compile with mono, run with MS jit
46 test-compiler:
47         @rm -f *.exe; \
48         for i in $(TEST_SOURCES); do \
49                 echo -n "Running $$i ... "; \
50                 if $(MCS) $$i.cs > /dev/null; then \
51                         if $(RUNTIME) ./$$i.exe > /dev/null; then \
52                                 echo $$i: ok; \
53                         else \
54                                 echo FAILED; exit 1; \
55                         fi; \
56                 else \
57                         echo FAILED TO COMPILE; exit 1; \
58                 fi \
59         done
60
61 # Compile with mono, run with MS jit
62 test-unsafe:
63         @for i in $(UNSAFE_SOURCES); do \
64                 echo -n "Running (unsafe) $$i ... "; \
65                 if $(MCS) --unsafe $$i.cs > /dev/null; then \
66                         if $(RUNTIME) ./$$i.exe > /dev/null; then \
67                                 echo OK; \
68                         else \
69                                 echo FAILED; exit 1; \
70                         fi; \
71                 else \
72                         echo FAILED WHILE COMPILING; exit 1; \
73                 fi \
74         done
75
76 # Compiled (previously) with mono, run with mono jit
77 test-jit:
78         @for i in $(TEST_SOURCES:.cs=.exe); do \
79                 echo -n "Running jit $$i ... "; \
80                 if mono ./$$i.exe > /dev/null; then \
81                         echo OK; \
82                 else \
83                         echo FAILED; exit 1; \
84                 fi \
85         done
86
87 # Compiled with mono, run with MS jit
88 test-windows:
89         @echo Running windows-only tests - these will fail on linux; \
90         for i in $(WINDOWS_SOURCES); do \
91                 echo -n "Running $$i ... "; \
92                 if $(MCS) $$i.cs > /dev/null; then \
93                         if ./$$i.exe > /dev/null; then \
94                                 echo OK; \
95                         else \
96                                 echo FAILED; exit 1; \
97                         fi; \
98                 else \
99                         echo FAILED TO COMPILE; exit 1; \
100                 fi \
101         done
102
103 # Compile with mono, run with mono jit
104 test-compiler-mono:
105         @rm -f *.exe; \
106         for i in $(TEST_SOURCES); do \
107                 echo -n "Running $$i ... "; \
108                 if $(MCS2) $$i.cs > /dev/null; then \
109                         if mono ./$$i.exe > /dev/null; then \
110                                 echo OK; \
111                         else \
112                                 echo FAILED; exit 1; \
113                         fi; \
114                 else \
115                         echo FAILED TO COMPILE; exit 1; \
116                 fi \
117         done
118         echo "Running NO_PASS tests ..."
119         for i in $(TEST_NOPASS); do \
120                 echo -n "Running $$i ... "; \
121                 if $(MCS2) $$i.cs > /dev/null; then \
122                         echo OK; \
123                 else \
124                         echo FAILED TO COMPILE; exit 1; \
125                 fi \
126         done
127
128 # Compile with mono, run with mono jit
129 test-unsafe-mono:
130         @rm -f *.exe; \
131         for i in $(UNSAFE_SOURCES); do \
132                 echo -n "Running $$i ... "; \
133                 if $(MCS2) --unsafe $$i.cs > /dev/null; then \
134                         if mono ./$$i.exe > /dev/null; then \
135                                 echo OK; \
136                         else \
137                                 echo FAILED; exit 1; \
138                         fi; \
139                 else \
140                         echo FAILED TO COMPILE; exit 1; \
141                 fi \
142         done
143
144 verify:
145         @for i in $(TEST_SOURCES); do \
146                 if $(MCS) -o mcs-gen-code.exe $$i.cs > /dev/null; then \
147                         if $(CSC) /out:csc-gen-code.exe $$i.cs > /dev/null; then \
148                                 if $(VERIFY) mcs-gen-code.exe csc-gen-code.exe > /dev/null; then \
149                                         echo $$i: identical assemblies; \
150                                 else \
151                                         echo $$i: unidentical assemblies; exit; \
152                                 fi; \
153                         fi \
154                 fi \
155         done; \
156         echo Verification passed
157
158
159 casts.cs: gen-cast-test.cs
160         $(CSC) /out:csc-cast.exe gen-cast-test.cs
161         ./csc-cast > casts.cs
162
163 casts-csc.exe: casts.cs
164         $(CSC) /out:casts-csc.exe casts.cs
165
166 casts.exe: casts.cs
167         $(MCS) casts.cs
168
169 csc-casts.out: casts-csc.exe
170         ./casts-csc.exe > csc-casts.out
171
172 msc-casts.out: casts.exe
173         ./casts.exe > msc-casts.out
174
175 test-casts: csc-casts.out msc-casts.out
176         cmp csc-casts.out msc-casts.out
177
178 clean:
179         rm *.exe
180         rm *.out
181         rm casts.cs
182