7d5db0d3f069a270de4278fac35246935fc8acda
[mono.git] / mcs / tests / makefile
1 CSC=csc.exe
2
3 MCS=../mcs/mcs.exe
4 VERIFY=../tools/verifier.exe
5
6 TEST_SOURCES = \
7         test-1   test-2   test-3   test-4   test-5   test-6   test-7   test-8   test-9   test-10 \
8         test-11  test-12  test-13  test-14  test-15  test-16  test-17  test-18  test-19  test-20 \
9         test-21  test-22  test-23  test-24  test-25  test-26  test-27  test-28           test-30 \
10         test-31  test-32  test-33  test-34  test-35  test-36  test-37           test-39  test-40 \
11         test-41  test-42  test-43  test-44  test-45  test-46  test-47  test-48  test-49  test-50 \
12         test-51  test-52  test-53  test-54  test-55  test-56  test-57           test-59  test-60 \
13         test-61  test-62  test-63  test-64  test-65  test-66  test-67  test-68  test-69  test-70 \
14         test-71  test-72  test-73  test-74  test-75  test-76  test-77  test-78  test-79  test-80 \
15         test-81  test-82  test-83  test-84  test-85  test-86  test-87  test-88  test-89  test-90 \
16         test-91  test-92  test-93  test-94  test-95  test-96  test-97  test-98  test-99  test-100\
17         test-101 test-102 test-103 test-104 test-105 test-106 test-107 test-108 test-109 test-110\
18         test-111 test-112 test-113 test-114 test-115 test-116 test-117 test-118 test-119 
19
20 UNSAFE_SOURCES = \
21         unsafe-1 unsafe-2
22
23 TEST_NOPASS = \
24         test-29 test-38 \
25         test-120
26
27 # Test 120 does not pass because the MS.NET runtime is buggy.
28
29 all: test-compiler test-unsafe
30
31 test-compiler:
32         -rm *.exe
33         for i in $(TEST_SOURCES); do \
34                 if $(MCS) $$i.cs > /dev/null; then \
35                         if ./$$i.exe; then \
36                                 echo $$i: ok; \
37                         else \
38                                 echo test $$i failed; exit; \
39                         fi; \
40                 else \
41                         echo compiler failed on $$i;   exit; \
42                 fi \
43         done
44
45 test-unsafe:
46         for i in $(UNSAFE_SOURCES); do \
47                 if $(MCS) --unsafe $$i.cs > /dev/null; then \
48                         if ./$$i.exe; then \
49                                 echo $$i: ok; \
50                         else \
51                                 echo test $$i failed; exit; \
52                         fi; \
53                 else \
54                         echo compiler failed on $$i;   exit; \
55                 fi \
56         done
57
58 test-jit:
59         for i in $(TEST_SOURCES:.cs=.exe); do \
60                 if mono ./$$i.exe; then \
61                         echo $$i: ok; \
62                 else \
63                         echo test $$i failed; exit; \
64                 fi \
65         done
66
67
68
69 verify:
70         for i in $(TEST_SOURCES); do \
71                 if $(MCS) -o mcs-gen-code.exe $$i.cs > /dev/null; then \
72                         if $(CSC) /out:csc-gen-code.exe $$i.cs > /dev/null; then \
73                                 if $(VERIFY) mcs-gen-code.exe csc-gen-code.exe > /dev/null; then \
74                                         echo $$i: identical assemblies; \
75                                 else \
76                                         echo $$i: unidentical assemblies; exit; \
77                                 fi; \
78                         fi \
79                 fi \
80         done
81
82
83 casts.cs: gen-cast-test.cs
84         $(CSC) /out:csc-cast.exe gen-cast-test.cs
85         ./csc-cast > casts.cs
86
87 casts-csc.exe: casts.cs
88         $(CSC) /out:casts-csc.exe casts.cs
89
90 casts.exe: casts.cs
91         $(MCS) casts.cs
92
93 csc-casts.out: casts-csc.exe
94         ./casts-csc.exe > csc-casts.out
95
96 msc-casts.out: casts.exe
97         ./casts.exe > msc-casts.out
98
99 test-casts: csc-casts.out msc-casts.out
100         cmp csc-casts.out msc-casts.out
101
102 clean:
103         rm *.exe
104         rm *.out
105         rm casts.cs
106